# mcp-code-execution-mode

mcp-code-execution-mode executes Python inside rootless containers and routes calls to MCP servers to keep token consumption minimal.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 174 installs · ★ 9 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/mcp-code-execution-mode/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/mcp-code-execution-mode

## What it does

Large tool catalogs can consume tens of thousands of tokens per turn. This component replaces heavy schema dumps with a single `run_python` entry point. The agent queries tools dynamically at runtime via helper methods like `search_tool_docs` and triggers actions programmatically, keeping setup overhead around 200 tokens.

Execution takes place inside an isolated sandbox with a read-only filesystem, blocked network access, and a default memory boundary of 512m. Sessions stay persistent across runs, so dataframes and written files remain accessible when `MCP_BRIDGE_SESSION_PERSIST` is active.

Running this bridge requires Python 3.11+ alongside an active Podman or Docker Desktop engine. Without an operational container runtime, code execution calls fail immediately.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp-code-execution-mode -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/mcp-code-execution-mode/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/mcp-code-execution-mode/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp-code-execution-mode -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/mcp-code-execution-mode/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp-code-execution-mode -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/mcp-code-execution-mode/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/mcp-skills skills/mcp-code-execution-mode
```

2. **Manually: put the files in place**
- File: `.github/skills/mcp-code-execution-mode/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp-code-execution-mode -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/mcp-skills --path skills/mcp-code-execution-mode
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/mcp-code-execution-mode/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill mcp-code-execution-mode -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/mcp-code-execution-mode/SKILL.md

## When to use it
- reduce token overhead from large MCP tool schema sets
- execute Python logic inside isolated rootless sandboxes
- search and load external tool definitions on demand
- orchestrate multiple MCP servers from a single script

## Example prompts
- Run python code in a sandbox to query open issues from GitHub
- Discover mcp tools dynamically and process sales data from the filesystem
- Execute an isolated Python script with persistent session state

## Similar
- [podman](https://affpapa.org/en/nevibecode/skills/podman.md) — skill · 463 installs
- [planetscale-autonomous-execution-mode](https://affpapa.org/en/nevibecode/skills/planetscale-autonomous-execution-mode.md) — skill · 2000 installs
- [container-host-checks](https://affpapa.org/en/nevibecode/skills/container-host-checks.md) — skill · ★ 71 repo stars
- [searxng-search](https://affpapa.org/en/nevibecode/skills/searxng-search.md) — skill · 838 installs
- [debug-openshell-cluster](https://affpapa.org/en/nevibecode/skills/debug-openshell-cluster.md) — skill · 739 installs
- [docker-sandboxes-network-credentials](https://affpapa.org/en/nevibecode/skills/docker-sandboxes-network-credentials.md) — skill · 1100 installs

From the same set: [reason-machines/mcp-skills](https://affpapa.org/en/nevibecode/by/reason-machines/mcp-skills.md) — 98 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
