Python Exec Sandbox

Created By
lu-zhengda4 months ago
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 management
  • check_environment — returns Python version, uv version, platform, sandbox status
  • validate_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 ago
Updated At
4 months ago
Author Name
lu-zhengda
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Alloy

3 hours ago