mcp-code-execution-mode

Execute Python code in rootless containers with dynamic MCP server tool discovery and proxying.

7|2|Updated May 16, 2026
One-click install
npx skills add https://github.com/reason-machines/mcp-skills --skill mcp-code-execution-mode-reason-machines
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: mcp-code-execution-mode
Source: https://github.com/reason-machines/mcp-skills/tree/main/skills/mcp-code-execution-mode
Command: npx skills add https://github.com/reason-machines/mcp-skills --skill mcp-code-execution-mode-reason-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Connecting LLMs to multiple MCP servers loads tens of thousands of tokens of tool schemas into every prompt, causing severe context bloat. This Skill solves that by exposing a single run_python tool that executes Python in isolated rootless containers, letting the agent discover and call MCP tools programmatically with roughly 200 tokens of constant overhead. ## Core Features & Use Cases - Token-Efficient Tool Access: Replaces bulk schema loading with on-demand discovery via search_tool_docs() and query_tool_docs(), reducing context overhead by over 95%. - Universal MCP Proxying: Auto-discovers any stdio MCP server (filesystem, GitHub, Slack) configured alongside it and calls their tools from Python code. - Secure Sandboxed Execution: Runs code in rootless Podman or Docker containers with no network, read-only filesystem, dropped capabilities, and configurable memory/timeout limits. - Use Case: Fetch open GitHub issues, analyze them with pandas, generate a chart, and post a summary to Slackโ€”all orchestrated inside one Python execution instead of many LLM round-trips. ## Quick Start Install the package with pip, configure it as an MCP server in Claude Desktop with Podman or Docker running, then ask the agent to run Python code that discovers and calls your other MCP servers' tools.

Frequently Asked Questions about mcp-code-execution-mode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce MCP tool schema token usage in Claude?โ–ผ

Use a code execution MCP server that exposes a single run_python tool instead of loading all tool schemas. The agent discovers tools on demand with search_tool_docs and calls them programmatically, keeping overhead around 200 tokens regardless of server count.

How do I call MCP tools from Python code?โ–ผ

Import the runtime module to discover servers and query tool schemas, then call tools via mcp_servers["github"].create_issue or attribute access like mcp_github.create_issue. The bridge auto-discovers all stdio MCP servers configured in the same client config.

Does mcp-code-execution-mode work with Docker or only Podman?โ–ผ

Both runtimes are supported. Podman is recommended, but you can set MCP_BRIDGE_RUNTIME=docker to use Docker Desktop instead. The runtime is auto-detected if the variable is unset.

Why do I get 'No container runtime available' errors?โ–ผ

This error means Podman or Docker is not installed or not running. Check status with podman machine list, start it with podman machine start, or switch to Docker by exporting MCP_BRIDGE_RUNTIME=docker.

Do variables persist between Python executions in the sandbox?โ–ผ

Variables and MCP clients persist across calls within the same session when MCP_BRIDGE_SESSION_PERSIST is true. However, sessions reset on bridge reload, so store critical state in files under /tmp for durability.

What are the security limitations of the code execution sandbox?โ–ผ

The sandbox runs rootless with all capabilities dropped, a read-only root filesystem, no-new-privileges, and no network access. Only /tmp is writable, and memory, CPU, and process limits are configurable via environment variables.