mcp-server-code-execution-mode
by elusznik·★ 331·Score 51
An MCP server that executes Python code in isolated containers with MCP server proxying to reduce context bloat.
Overview
This MCP server implements Anthropic's and Cloudflare's ideas for reducing MCP tool definitions context bloat. Instead of exposing hundreds of individual tools to the LLM, it exposes one 'run_python' tool where the LLM writes Python code to discover, call, and compose other tools. This reduces context from 30K tokens to 200 tokens while proxying any stdio server. The server runs code in rootless Docker/Podman containers with strict security isolation (no network access, read-only filesystem, dropped capabilities).
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this when managing multiple MCP servers and facing context window limitations, or when you need secure Python execution with scientific libraries and persistent state.
When NOT to choose this
Don't choose this if you need JavaScript/TypeScript execution, or if you require direct tool access without code abstraction layer.
Tools this server exposes
1 tool extracted from the READMErun_pythonExecutes Python code in an isolated container environment with MCP server proxying capabilities.
Comparable tools
Installation
Installation
- Install Docker or Podman
- Install the server:
pip install mcp-server-code-execution-mode - Add to Claude Desktop configuration:
{
"mcpServers": {
"code-execution": {
"command": "python",
"args": ["-m", "mcp_server_code_execution_mode"],
"env": {}
}
}
}Or run directly: mcp-server-code-execution-mode
FAQ
- What security measures does this server implement?
- The server runs code in rootless containers with network isolation, read-only filesystem, dropped capabilities, unprivileged user, and resource limits.
- How does this reduce context usage compared to traditional MCP?
- Instead of loading all tool schemas into context (30K+ tokens), it exposes only one 'run_python' tool and loads schemas dynamically when requested (200 tokens).
On Hacker News
Recent discussion from the developer community.
- Story by rahimnathwani · 2025-12-19
Compare mcp-server-code-execution-mode with
Last updated · Auto-generated from public README + GitHub signals.