Python Exec Sandbox MCP Server

Sandboxed Python execution for AI agents. PEP 723 inline deps, multi-version Python, zero pollution.

Local serverstdioPython

What is the Python Exec Sandbox MCP server?

Most cloud and infrastructure work still happens through a UI a human drives. Python Exec Sandbox MCP server moves it into the conversation instead. Sandboxed Python execution for AI agents. PEP 723 inline deps, multi-version Python, zero pollution.

The short version

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.

  • Scripts execute in a sandbox (bubblewrap on Linux, Docker on macOS/other platforms)
  • Dependencies are declared inline and resolved ephemerally via uv
  • Nothing touches your host's Python, site-packages, or virtualenvs
  • Each execution is isolated and disposable

The tools it exposes

The server publishes 6 tools. What each one is for:

  • Cursor — The Cursor tool exposed by this server
  • execute_python — Execute a Python script with automatic dependency management
  • check_environment — Returns information about the execution environment: Python version, uv version, platform, sandbox status, and configuration
  • validate_script — Validates a script's PEP 723 metadata and dependencies without executing it
  • Setup — The Setup tool exposed by this server
  • Contributing — The Contributing tool exposed by this server

What it needs from you

All setups require: - Python 3.13+ -- to run the MCP server process - uv -- manages script execution, dependency resolution, and Python version downloads. Also provides uvx for running the server without installing it globally. Additional requirements depend on your chosen sandbox backend: | Setup | Additional requirements |

Getting it running

The server ships on npm as @devcontainers/cli, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

How it compares

This sits in the cloud and infrastructure group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Python Exec Sandbox's toolset — Cursor, execute_python, check_environment and 3 more — is a fair guide to whether it matches your workflow. It is maintained by lu-zhengda; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
CursorThe Cursor tool exposed by this server.
execute_pythonExecute a Python script with automatic dependency management.
check_environmentReturns information about the execution environment: Python version, uv version, platform, sandbox status, and configuration.
validate_scriptValidates a script's PEP 723 metadata and dependencies without executing it.
SetupThe Setup tool exposed by this server.
ContributingThe Contributing tool exposed by this server.

How to install the Python Exec Sandbox MCP server

{
  "mcpServers": {
    "python-exec-sandbox": {
      "command": "npx",
      "args": ["-y", "@devcontainers/cli"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

All setups require: - Python 3.13+ -- to run the MCP server process - uv -- manages script execution, dependency resolution, and Python version downloads. Also provides uvx for running the server without installing it globally. Additional requirements depend on your chosen sandbox backend: | Setup | Additional requirements |

Example prompts to try

  • Use Python Exec Sandbox to Cursor.
  • Use Python Exec Sandbox to execute python.
  • Use Python Exec Sandbox to check environment.

Frequently asked questions

It connects Python Exec Sandbox to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (Cursor, execute_python, check_environment, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Python Exec Sandbox directly.