Python Sandbox MCP Server

A MCP server that enables LLMs to run python code safely in isolated Docker containers.

Local serverstdioPython

What is the Python Sandbox MCP server?

A MCP server that enables LLMs to run python code safely in isolated Docker containers. That is what the python sandbox mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The tools it exposes

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

  • Real — time communication using Server-Sent Events (SSE)
  • MCP_SERVER_NAME — Server identifier (default: "python-sandbox-mcp-sse")
  • SNEKBOX_URL — Snekbox API endpoint (default: "http://localhost:8060/eval")
  • TEMP_DIR — Directory for temporary files storage

Getting it running

The server ships on a container image as ghcr.io/python-discord/snekbox, 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.

What it needs from you

Configuration is passed through the environment: SNEKBOX_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

How it compares

Among the file and storage access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Python Sandbox's toolset — Real, MCP_SERVER_NAME, SNEKBOX_URL and 1 more — is a fair guide to whether it matches your workflow. It is maintained by cloudywu0410; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Python Sandbox's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

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.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
Realtime communication using Server-Sent Events (SSE)
MCP_SERVER_NAMEServer identifier (default: "python-sandbox-mcp-sse")
SNEKBOX_URLSnekbox API endpoint (default: "http://localhost:8060/eval")
TEMP_DIRDirectory for temporary files storage

How to install the Python Sandbox MCP server

{
  "mcpServers": {
    "python-sandbox": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "ghcr.io/python-discord/snekbox"],
      "env": {
        "SNEKBOX_URL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SNEKBOX_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Python Sandbox to Real.
  • Use Python Sandbox to MCP SERVER NAME.
  • Use Python Sandbox to SNEKBOX URL.

Frequently asked questions

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