MCP protocol-based code runner that executes user code inside Docker containers.
https://github.com/axliupore/mcp-code-runnerSkip the headache of setting up secure code execution environments. This MCP server gives your AI tools the ability to run code safely in isolated Docker containers—no complex sandboxing setup required.
You want your AI assistant to run code snippets, test algorithms, or validate solutions. But executing arbitrary code is risky, and building secure execution environments from scratch is time-consuming. Most developers end up either:
Instant Docker-Isolated Execution: Every code snippet runs in a fresh container that gets destroyed after execution. Your system stays clean and secure.
Native MCP Integration: Works seamlessly with Claude Desktop, Cline, and other MCP-compatible AI tools. Your assistant can execute code and get results without you lifting a finger.
Zero-Config Security: Docker handles the isolation. No complex permission systems, chroot jails, or custom security policies to configure.
Algorithm Testing: Your AI writes a sorting algorithm? It can immediately test it with sample data and show you the results.
Data Processing Scripts: Working on data analysis? Let your AI run pandas operations and return processed results directly in the conversation.
Code Validation: Debugging a complex function? Your AI can execute test cases and verify the logic works as expected.
Learning and Experimentation: Exploring new programming concepts? Your AI can run examples and show you the output in real-time.
Clone and setup:
git clone https://github.com/axliupore/mcp-code-runner.git
cd mcp-code-runner
npm install
Add to your MCP client (Claude Desktop config):
{
"mcpServers": {
"code-runner": {
"command": "node",
"args": ["path/to/mcp-code-runner/dist/index.js"]
}
}
}
Start executing: Your AI can now run code snippets and return results directly in your conversations.
The server handles Docker container lifecycle, execution timeouts, and result capture automatically. You focus on the code, not the infrastructure.
Requirements: Docker running locally, Node.js 18+. That's it.
Ready to give your AI tools the ability to execute code safely? This MCP server makes it trivial to add secure code execution to any MCP-compatible workflow.