Executes TypeScript and JavaScript code in a secure Deno sandbox with fine-grained permissions for file system and network access
Provides containerized deployment with security hardening, resource limits, and multi-layer isolation for production environments
Allows repository operations and GitHub API interactions through HTTP-based MCP connections with token authentication
Enables orchestration of Linear's API through code execution, supporting issue creation and project management with OAuth authentication
Runtime environment for the MCP server, enabling TypeScript execution and MCP client management
Executes Python code in isolated subprocesses with access to MCP tools and configurable security restrictions
Supports posting messages and interacting with Slack workspaces through orchestrated MCP tool calls
Primary language for code execution with full type safety, Zod validation, and sandbox isolation
Code Executor MCP
Stop hitting the 2-3 MCP server wall. One MCP to orchestrate them all - 98% token savings, unlimited tool access.
The Problem
You can't use more than 2-3 MCP servers before context exhaustion kills you.
Research confirms: Tool accuracy drops significantly after 2-3 servers
6,490+ MCP servers available, but you can only use 2-3
47 tools = 141k tokens consumed before you write a single word
You're forced to choose: filesystem OR browser OR git OR AI tools. Never all of them.
The Solution
Disable all MCPs. Enable only code-executor-mcp.
Inside the sandbox, access ANY MCP tool on-demand:
Result: Unlimited MCP access, zero context overhead.
Quick Start
1. Install
2. Configure
IMPORTANT: Code-executor discovers and merges MCP servers from BOTH locations:
Global:
~/.claude.json(cross-project MCPs like voice-mode, personal tools)Project:
.mcp.json(team-shared MCPs in your project root)
Config Merging: Global MCPs + Project MCPs = All available (project overrides global for duplicate names)
Add to your project .mcp.json or global ~/.claude.json:
Configuration Guide:
MCP_CONFIG_PATH: Optional - points to project.mcp.json(still discovers global~/.claude.json)DENO_PATH: Runwhich denoto find it (required for TypeScript execution)Global MCPs (
~/.claude.json): Personal servers available across all projectsProject MCPs (
.mcp.json): Team-shared servers in version controlConnection Flow: Claude Code → code-executor ONLY, then code-executor → all other MCPs
Quick Setup:
Minimal (Python-only):
3. Use
Claude can now access any MCP tool through code execution:
That's it. No configuration, no allowlists, no manual tool setup.
Why This Works
Progressive Disclosure Architecture
Traditional MCP: Expose all 47 tools upfront → 141k tokens
Code Executor: Expose 2 tools (with outputSchema) → tools load on-demand → 1.6k tokens
NEW in v0.7.1: All tools now include outputSchema exposed via protocol - AI agents know response structure without trial execution! (MCP SDK v1.22.0)
Real-World Example
Task: "Review auth.ts for security issues and commit fixes"
Without code-executor (impossible - hit context limit):
With code-executor (single AI message):
All in ONE tool call. Variables persist, no context switching.
Features
Feature | Description |
98% Token Savings | 141k → 1.6k tokens (47 tools → 2 tools) |
Unlimited MCPs | Access 6,490+ MCP servers without context limits |
Multi-Step Workflows | Chain multiple MCP calls in one execution |
Auto-Discovery | AI agents find tools on-demand (0 token cost) |
Deep Validation | AJV schema validation with helpful error messages |
Security | Sandboxed (Deno/Python), allowlists, audit logs, rate limiting |
Production Ready | TypeScript, 606 tests, 95%+ coverage, Docker support |
Advanced Usage
Allowlists (Optional Security)
Restrict which tools can be executed:
Discovery Functions
AI agents can explore available tools:
Zero token cost - discovery functions hidden from AI agent's tool list.
Multi-Action Workflows
Complex automation in a single tool call:
State persists across calls - no context switching.
Python Execution (Pyodide WebAssembly)
Secure Python execution with Pyodide sandbox:
Enable Python:
Example - Python with MCP tools:
Security guarantees:
✅ WebAssembly sandbox (same security as Deno)
✅ Virtual filesystem (no host file access)
✅ Network restricted to authenticated MCP proxy
✅ No subprocess spawning
✅ Memory limited by V8 heap
Limitations:
Pure Python only (no native C extensions unless WASM-compiled)
~2-3s first load (Pyodide npm package), <100ms cached
No multiprocessing/threading (use async/await)
10-30% slower than native Python (WASM overhead acceptable for security)
See SECURITY.md for complete security model.
Installation Options
npm (Recommended)
Docker (Production)
See DOCKER_TESTING.md for security details.
Local Development
Configuration
Complete Example (.mcp.json):
Environment Variables:
Variable | Required | Description | Example |
| ⚠️ Optional | Explicit path to project
|
|
| ✅ For TypeScript | Path to Deno binary |
|
| ⚠️ Recommended | Enable security audit logging |
|
| No | Custom audit log location |
|
| ⚠️ Recommended | Restrict file access |
|
| No | Enable Python executor |
(default) |
Security Note: Store API keys in environment variables, not directly in config files.
Auto-discovery (NEW in v0.7.3): Code-executor automatically discovers and merges:
~/.claude.json(global/personal MCPs).mcp.json(project MCPs)MCP_CONFIG_PATHif set (explicit override, still merges with global)
No configuration needed - just add MCPs to either location and code-executor finds them all!
TypeScript Support
Full type definitions included:
Security
Sandboxed execution: Deno (TypeScript) and Pyodide WebAssembly (Python) - complete isolation
Tool allowlists: Whitelist specific MCP tools per execution
Rate limiting: 30 requests/60 seconds (configurable)
Audit logging: All tool calls logged with timestamps
Deep validation: AJV schema validation before execution
SSRF protection: Blocks AWS metadata, localhost, private IPs
Python isolation: Pyodide WASM sandbox - virtual FS, no host access, network restricted
See SECURITY.md for security model and threat analysis.
Performance
Metric | Value |
Token savings | 98% (141k → 1.6k) |
Tool discovery | <5ms (cached), 50-100ms (first call) |
Validation | <1ms per tool call |
Sandbox startup | ~200ms (Deno), ~2-3s first/~100ms cached (Pyodide) |
Test coverage | 606 tests, 95%+ security, 90%+ overall |
Documentation
AGENTS.md - Repository guidelines for AI agents
CONTRIBUTING.md - Development setup and workflow
SECURITY.md - Security model and threat analysis
DOCKER_TESTING.md - Docker security details
CHANGELOG.md - Version history
FAQ
Q: Do I need to configure each MCP server?
A: No. Code-executor auto-discovers MCPs from ~/.claude.json (global) AND .mcp.json (project). Just add MCPs to either location.
Q: How does global + project config merging work? A: Code-executor finds and merges both:
Global (
~/.claude.json): Personal MCPs available everywhereProject (
.mcp.json): Team MCPs in version controlResult: All MCPs available, project configs override global for duplicate names
Q: How does validation work? A: AJV validates all tool calls against live schemas. On error, you get a detailed message showing expected parameters.
Q: What about Python support?
A: Full Python sandbox via Pyodide WebAssembly. Requires PYTHON_SANDBOX_READY=true environment variable. Same security model as Deno (WASM isolation, virtual FS, network restricted). Pure Python only - no native C extensions unless WASM-compiled. See SECURITY.md for details.
Q: Can I use this in production? A: Yes. 606 tests, 95%+ coverage, Docker support, audit logging, rate limiting.
Q: Does this work with Claude Code only? A: Built for Claude Code. Untested on other MCP clients, but should work per MCP spec.
License
MIT - See LICENSE
Links
Docker Hub: https://hub.docker.com/r/aberemia24/code-executor-mcp
Issues: https://github.com/aberemia24/code-executor-MCP/issues
Built with Claude Code | Based on Anthropic's Code Execution with MCP