The mcp-server-code-runner allows you to execute code snippets in various programming languages and returns the results.
- Execute code snippets: Run code in multiple languages including JavaScript, PHP, Python, Ruby, and many others as defined in the constants.ts file
- Simple usage: Provide your code and specify the language to get execution results
- Flexible setup options: Install via npx in VS Code and Claude Desktop, or use Docker
- Windows compatibility: Alternative methods using
bunx
orcmd
for Windows users - Advanced features: Supports Streamable HTTP Transport for enhanced communication
- Integration capabilities: Works with applications configured to use the MCP Server
Allows running AutoHotkey code snippets with result display
Supports execution of AutoIt code snippets and shows results
Enables running Clojure code snippets and displays execution results
Provides ability to execute CoffeeScript code and view results
Provides execution environment for Crystal code snippets with output
Enables running Dart code snippets with output display
Supports execution of Elixir code snippets with result display
Enables execution of F# Script code with output display
Provides execution environment for Haskell code snippets with results
Allows execution of JavaScript code snippets and returns the results
Enables running Julia code snippets with result display
Allows running Kit code snippets and viewing execution output
Supports execution of Kotlin Script code snippets with output display
Allows running Lua code snippets and viewing execution results
Allows running OCaml Script code snippets and viewing results
Provides ability to run Perl code snippets and view the output
Enables running PHP code snippets and displays execution results
Supports execution of Python code snippets with output display
Provides ability to execute Racket code snippets and view output
Enables execution of Ruby code fragments with result display
Supports processing and execution of Sass code snippets with result display
Allows running Scala code snippets with output display
Provides ability to run BASH/SH shell scripts and view results
Supports execution of Swift code snippets and shows results
Enables running TypeScript code snippets with result display
Code Runner MCP Server
MCP Server for running code snippet and show the result.
It supports running multiple programming languages: JavaScript, PHP, Python, Perl, Perl 6, Ruby, Go, Lua, Groovy, PowerShell, BAT/CMD, BASH/SH, F# Script, C# Script, VBScript, TypeScript, CoffeeScript, Scala, Swift, Julia, Crystal, OCaml Script, R, AppleScript, Elixir, Clojure, Racket, Scheme, AutoHotkey, AutoIt, Kotlin Script, Dart, Haskell, Ni, Lisp, Kit, V, SCSS, Sass. Full list could be seen here in constants.ts.
Setup
npx for VS Code
Install the Code Runner MCP server in VS Code using below buttons:
Alternatively, you can add configuration in settings.json
:
npx for Claude Desktop
Configuration in claude_desktop_config.json
:
Docker
Use VS Code as example. Install the Code Runner MCP server in VS Code using below buttons:
Alternatively, you can add configuration in settings.json
:
npx issue on Widnows
On Windows, MCP servers may fail to connect with npx
.
You could try below two workarounds:
use bunx
- Install Bun.
- In configuration, change
npx
withbunx
.
use cmd
Below is VS Code configuration in settings.json
:
Run with Streamable HTTP Transport
Usage
Before using Code Runner MCP Server, please make sure interpreter or compiler of the programming language you want to run is set in PATH
environment variable.
Try below prompts in the application which has configured Code Runner MCP Server:
Run the JavaScript Code: console.log(5+6)
Where is temporary folder in my OS? Use run-code tool
How many CPUs do I have in my machine? Use run-code tool
Build your own MCP Server
Want to build your own MCP Server? Try Yeoman Generator for MCP Server to create your MCP Server project!
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
MCP Server for running code snippet and show the result.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server to run commands.Last updated -2265150TypeScriptMIT License
- AsecurityAlicenseAqualityMCP server for collecting code from files and directories into a single markdown document.Last updated -24PythonMIT License
- AsecurityAlicenseAqualityA MCP server for managing and storing code snippets in various programming languages, allowing users to create, list, and delete snippets via a standardized interface.Last updated -34JavaScriptMIT License
- AsecurityAlicenseAqualityThis project aims to build a Claude Code MCP server and implement its associated tools (explain\_code, review\_code, fix\_code, edit\_code, test\_code, simulate\_command, your\_own\_query). The server is implemented using Node.js and the MCP SDK. It receives tool requests from clients via Stdio, dynamicallyLast updated -77714JavaScriptMIT License