lu-zhengda avatar

Python Exec Sandbox

lu-zhengda/mcp-python-exec-sandbox

This server gives Claude the ability to execute Python code in throwaway sandboxes that vanish after each run. Scripts declare dependencies inline using PEP 723 metadata blocks, uv resolves them ephemerally, and nothing touches your host Python installation. It exposes execute_python for running code with configurable timeouts, validate_script for checking metadata without execution, and check_environment for inspecting the runtime. On Linux it uses bubblewrap for namespace isolation, elsewhere it spins up Docker containers. You can target Python 3.13 through 3.15 regardless of what's on your host machine. Reach for this when you need Claude to prototype with third-party packages or analyze data without polluting your system with accumulating virtualenvs and package conflicts.

tools
3
transport
STDIO
last updated
Feb 9, 2026

Tools

3 tools

Public tool metadata for what this MCP can expose to an agent.

execute_pythonExecute a Python script with automatic dependency management.

Execute a Python script with automatic dependency management.

No parameter schema in public metadata yet.

check_environmentReturns information about the execution environment: Python version, uv version, platform, sandbox status, and configuration.

Returns information about the execution environment: Python version, uv version, platform, sandbox status, and configuration.

No parameter schema in public metadata yet.

validate_scriptValidates a script's PEP 723 metadata and dependencies without executing it.

Validates a script's PEP 723 metadata and dependencies without executing it.

No parameter schema in public metadata yet.

Sponsors

Readme

mcp-python-exec-sandbox

CI PyPI Python License

Sandboxed Python execution for AI agents. Scripts run in ephemeral, isolated environments with inline dependencies (PEP 723) -- zero host pollution, zero leftover venvs, zero package conflicts.

Why?

Every coding agent can already run Python on your host. The problem is what happens next: packages accumulate, venvs sprawl, and a rogue pip install breaks your system. mcp-python-exec-sandbox eliminates this:


View the full README on GitHub

Details

Repository
github.com/lu-zhengda/mcp-python-exec-sandbox
Package
mcp-python-exec-sandbox
Transport
STDIO
Registry
MCP registry, active

More from lu-zhengda