Back to Home
pydantic icon

mcp-run-python

Verified Safe

by pydantic

Overview

MCP server to securely run untrusted Python code in a sandboxed WebAssembly environment, typically as a tool for AI agents.

Installation

Run Command
uvx mcp-run-python stdio

Security Notes

The server's core function is to execute arbitrary Python code. This is achieved within a robust sandbox provided by Pyodide (WebAssembly) running on Deno. Deno's explicit permission model is used to limit file system access (read-only for execution, write for dependency installation to `./node_modules` only). Importantly, `process.env` is polyfilled to be an empty object within the sandbox, preventing secrets leakage or environment tampering by executed code. The main point of caution is the `--allow-net` flag which is enabled by default when running the server via the CLI (`mcp-run-python` command) but is configurable (`--disable-networking`). The `code_sandbox` helper in the Python library defaults to `allow_networking=False`, offering a more secure default for programmatic use.

Similar Servers

Stats

Interest Score80
Security Score8
Cost ClassMedium
Avg Tokens500
Stars148
Forks17
Last Update2025-12-11

Tags

PythonSandboxWebAssemblyDenoPyodideMCPCode ExecutionAI Agent Tool