MCP Catalogs
Home

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.

developer-toolssecurityai-llm
28
Forks
6
Open issues
5 mo ago
Last commit
2d ago
Indexed

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:

you:Teams managing multiple MCP servers who need to reduce token usage
you:Agents that need to orchestrate complex workflows with loops and conditionals
you:Security-conscious environments requiring sandboxed code execution
you:What security measures does this server implement?
you:How does this reduce context usage compared to traditional MCP?

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 README
  • run_python

    Executes Python code in an isolated container environment with MCP server proxying capabilities.

Comparable tools

cloudflare-code-modedocker-mcp-gatewayuniversal-tool-calling-protocol/code-mode

Installation

Installation

  1. Install Docker or Podman
  2. Install the server: pip install mcp-server-code-execution-mode
  3. 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.

Compare mcp-server-code-execution-mode with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.