mcp -code-runner
Code Runner MCP Server
claude mcp add --transport stdio formulahendry-mcp-server-code-runner npx -y mcp-server-code-runner@latest
How to use
The Code Runner MCP Server lets you execute code snippets in a wide range of programming languages and return the results via MCP (Model Context Protocol). After starting the server, you can send prompts such as running a snippet of JavaScript, Python, Ruby, Go, or many other supported languages, and the server will execute the code in a safe, isolated environment and return the output. It is designed to work with the Streamable HTTP Transport, so you can run code over HTTP and stream the results back to your client. The server is particularly useful in chatbots, IDE integrations, or any tool that needs to evaluate code snippets on the fly. The repository indicates a very broad language support, including JavaScript, Python, PHP, Ruby, Go, Lua, Kotlin Script, Swift, R, OCaml Script, and many others, with a complete list referenced in the code (constants.ts).
To use it, install and run the MCP server (for example via npx as shown in the configuration) and then send prompts like: "Run the JavaScript code: console.log(5+6)" or ask questions that require code execution such as exploring temporary directories or querying system information. The server is designed to integrate with editors or apps that configure MCP servers, making it easy to plug into your workflow.
How to install
Prerequisites:
- Node.js and npm installed on your system (for the npm/npx approach)
- Optional: Docker if you prefer containerized usage
Install via npx (recommended for quick setup):
- Ensure Node.js/npm are installed
- Run the MCP server once using npx:
npx -y mcp-server-code-runner@latest
This will bootstrap and start the MCP server in your environment. If you want to configure it for a VS Code or Claude Desktop setup, you can follow the configuration examples in the README where the server is wired with:
{"command": "npx", "args": ["-y", "mcp-server-code-runner@latest"]}
Install via Docker:
- Ensure Docker is installed and running
- Run the server container:
docker run --rm -i formulahendry/mcp-server-code-runner
Configure in your environment similarly to the examples in the README depending on your tool (VS Code, Claude Desktop, or custom MCP client).
Additional notes
Tips and notes:
- The server supports a very large set of languages; ensure the runtime or interpreter for the target language is available in PATH if you’re using a local install.
- If you encounter Windows npx issues, consider alternatives such as bunx or using cmd as the command with appropriate arguments, as described in the README.
- For HTTP transport, you can run the server with the --transport http option to stream results over HTTP.
- If you plan to deploy in CI or a container, you can pin to a specific latest version (e.g., mcp-server-code-runner@latest) to control updates.
- The npm_package for this server is mcp-server-code-runner.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud