The `mcp-server-code-runner` package provides a server designed to execute code snippets across a vast array of programming languages, including JavaScript, Python, PHP, Go, Ruby, TypeScript, and many others, then display their results. It acts as an MCP (Model Context Protocol) server, integrating with compatible AI clients and development environments like VS Code or Claude Desktop to offer real-time code execution capabilities. While the current version 0.1.8 suggests an early-stage or pre-1.0 development phase, it is actively maintained and serves as a powerful utility for agents requiring quick, sandboxed code execution. Its key differentiators include extensive language support (over 30 languages) and flexible deployment options via `npx` or Docker, making it highly adaptable for various AI-driven development and testing workflows.
npm install mcp-server-code-runnerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates configuring the `mcp-server-code-runner` within VS Code's `settings.json` to enable code execution capabilities for AI agents. This JSON structure registers the server to be run via `npx` on demand.
Adjust PowerShell execution policies (e.g., `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`). Ensure Node.js and `npx` are correctly installed and added to your system's PATH. For some environments, explicitly calling `cmd.exe /c npx ...` in the MCP server configuration might be necessary to ensure proper shell handling.
Always use a reputable MCP client that prompts for explicit human confirmation before executing code. Consider running the server inside a Docker container for an isolated execution environment. Review the source code on GitHub for trusted servers.
Verify that all necessary language runtimes are installed. Check your system's PATH environment variable to ensure the directories containing the interpreters/compilers are included. For Node.js, ensure version 18 or later is installed for optimal `npx` functionality.
Install Node.js (which includes npm and npx) version 18 or later. Verify installation with `node -v` and `npx -v`. Ensure Node.js's installation directory is in your system's PATH.
Ensure `npx` is installed and the Node.js executable path is fully discoverable by the environment starting the MCP server. On Windows, try explicitly setting the `command` in your MCP server configuration to `cmd.exe` and passing `/c` before `npx` (e.g., `"command": "cmd.exe", "args": ["/c", "npx", "-y", "mcp-server-code-runner@latest"]`).
Ensure your Node.js installation is correct for your system's architecture. Reinstall Node.js if necessary. Verify that no other Node.js tasks are interfering. Consider the `cmd.exe /c npx` workaround as described for 'spawn npx ENOENT' to ensure correct shell context.
No dependency data recorded yet.