- Python Exec Sandbox
Python Exec Sandbox
Sandboxed Python execution for AI agents. Scripts run in ephemeral, isolated environments (bubblewrap on Linux, Docker on macOS) with PEP 723 inline dependencies — zero host pollution, zero leftover venvs, zero package conflicts. Supports multi-version Python (3.13–3.15), configurable timeouts, and output truncation.
Overview
Features
- Sandboxed execution — platform-specific isolation prevents host filesystem access (bubblewrap on Linux, Docker on macOS)
- PEP 723 inline metadata — declare dependencies directly in scripts with # /// script blocks
- Multi-version Python — run scripts on Python 3.13, 3.14, or 3.15 (uv downloads the right version automatically)
- Ephemeral environments — dependencies are resolved per-execution, never persisted
- Package caching — uv's global cache makes repeat installs near-instant
- Timeout enforcement — configurable per-execution timeouts (1–300s)
- Output truncation — prevents runaway output from overwhelming the agent
Tools
execute_python— execute a Python script with automatic dependency managementcheck_environment— returns Python version, uv version, platform, sandbox statusvalidate_script— validates PEP 723 metadata and dependencies without executing
Quick Start
claude mcp add python-sandbox -- uvx mcp-python-exec-sandbox
Server Config
{
"mcpServers": {
"python-sandbox": {
"command": "uvx",
"args": [
"mcp-python-exec-sandbox"
]
}
}
}Project Info
Created At
4 months agoUpdated At
4 months agoAuthor Name
lu-zhengdaStar
-Language
-License
-Recommend Servers
View AllFilesystem
@modelcontextprotocol
2 months ago
Amap Maps
@amap
高德地图官方 MCP Server
a year ago
Alloy
3 hours ago