Code Executor MCP Server
Enables Docker isolation for code execution in the Pro tier, providing enhanced security and environment control for running untrusted code.
Supports execution of JavaScript code with safety checks, output capture, and blocking of dangerous patterns like child_process and eval().
Allows running Jest test suites with pass/fail summaries, enabling AI agents to execute and validate JavaScript tests programmatically.
Enables execution of pytest test suites with pass/fail summaries, allowing AI agents to run and validate Python tests programmatically.
Provides Python code execution with safety checks, output capture, and blocking of dangerous patterns like os.system and subprocess calls.
Enables execution of shell commands with destructive-pattern blocking, output capture, and safety filters to prevent harmful operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Executor MCP Serverrun a Python script to calculate factorial of 10"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
By MEOK AI Labs — Sovereign AI tools for everyone.
Code Executor MCP Server
Sandboxed code execution for AI agents. Run Python, JavaScript, and shell commands with comprehensive safety guards, output capture, timeout protection, and file access restrictions. Built for production use with blocked destructive patterns and configurable limits.
Tools
Tool | Description |
| Run Python or JavaScript code with safety checks and output capture |
| Execute shell commands with destructive-pattern blocking |
| Run test suites (pytest, jest, etc.) with pass/fail summary |
| Read files within allowed directories |
| List files in the execution sandbox |
| View current blocked patterns and safety configuration |
Safety Features
Blocks destructive shell commands:
rm -rf /, fork bombs, pipe-to-shellBlocks dangerous Python:
os.system,subprocess,eval(input), raw socketsBlocks dangerous JavaScript:
child_process,require('fs'),eval()File access restricted to Desktop, Documents, Downloads, /tmp
All execution happens in an isolated temp directory
Hard timeout cap at 60 seconds
Output truncated at 10KB to prevent memory issues
Installation
pip install mcpOptional for JavaScript support:
brew install node # or: apt install nodejsUsage
Run the server
python server.pyClaude Desktop config
{
"mcpServers": {
"code-executor": {
"command": "python",
"args": ["/path/to/code-executor-mcp/server.py"]
}
}
}Example calls
Execute Python:
Tool: execute_code
Input: {"code": "import math\nprint(f'Pi = {math.pi:.10f}')\nprint(f'e = {math.e:.10f}')", "language": "python"}
Output: {"output": "Pi = 3.1415926536\ne = 2.7182818285\n", "exit_code": 0, "elapsed_seconds": 0.045}Run shell command:
Tool: run_command
Input: {"command": "ls -la /tmp | head -20"}
Output: {"output": "total 128\ndrwxrwxrwt ...", "exit_code": 0, "elapsed_seconds": 0.012}Run tests:
Tool: run_tests
Input: {"test_command": "python -m pytest tests/ -v", "working_dir": "/path/to/project"}
Output: {"passed": true, "summary": "12 passed in 1.34s", "exit_code": 0}Blocked command example:
Tool: run_command
Input: {"command": "rm -rf /"}
Output: {"error": "Command blocked by safety filter (matches: rm\\s+-rf\\s+/)"}Pricing
Tier | Limit | Price |
Free | 50 executions/day, 30s timeout | $0 |
Pro | Unlimited, 120s timeout, Docker isolation | $9/mo |
Enterprise | Custom + network access + GPU execution | Contact us |
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/CSOAI-ORG/code-executor-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server