pydantic/mcp-run-python
FreePydantic 出品,在安全的沙盒环境中运行 Python 代码,适合开发编程代理。
About pydantic/mcp-run-python
MCP Run Python is an MCP (Model Context Protocol) server that executes Python code in a sandboxed WebAssembly environment using Pyodide and Deno. It was originally part of Pydantic AI and provides secure execution by isolating code from the host operating system. Key features include automatic dependency detection and installation, full capture of standard output, standard error, and return values, support for asynchronous code, and detailed error reporting. The project has been archived and is no longer maintained, with the authors noting that Pyodide is not a safe sandbox for untrusted code—it can run arbitrary JavaScript, read/write files accessible to the Deno runtime, and exhaust memory without good limits. Users are advised to exercise extreme caution and to consider the successor project Monty for better security and lower latency.
Key Features
Pros & Cons
- Isolates Python execution from the host OS using WebAssembly
- Automatically manages and installs required packages
- Captures all output (stdout, stderr, return value) for inspection
- Supports asynchronous Python code
- Detailed error reports help with debugging
- Archived and no longer maintained; not recommended for new projects
- Pyodide can execute arbitrary JavaScript, posing security risks beyond Python
- Deno has no built-in way to limit memory usage, risking out-of-memory crashes
- Latency is high due to Pyodide's overhead, making it unsuitable for real-time use
- Requires both Python and Deno to be installed on the host system
- Only runs code in a browser-engine environment, limiting system library support