High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
MCP server for running code in Docker sandboxes
Sandbox MCP is a local MCP server that connects an agent to isolated Docker containers for code execution. It ships with sandbox setups for shell, Python, Rust, Go, JavaScript, Java, network tools, and APISIX, and you can add your own by placing a Dockerfile and JSON config in the sandboxes directory.
Builders who use MCP clients like Claude Desktop or Cursor and want safe code execution.
You can let your agent run, test, and inspect code in isolation instead of executing it on your machine.
What it does
Isolated code execution
Runs generated or user-provided code inside Docker containers instead of on the host system.
Multiple ready-made sandboxes
Includes sandbox setups for shell, Python, Rust, Go, JavaScript, Java, network tools, and APISIX.
Custom sandbox support
Lets you add new sandboxes in `$XDG_CONFIG_HOME/sandbox-mcp/sandboxes` using a Dockerfile and JSON config.
Local MCP server mode
Runs as a local MCP server that hosts and clients can connect to over stdio.
Test and review workflows
Supports code testing, validation, and automated feedback before code is merged or deployed.
How to get it
- 1Go 1.24 or higher
go install github.com/pottekkat/sandbox-mcp/cmd/sandbox-mcp@latest
- 2Get the path to the sandbox-mcp binary
which sandbox-mcp
- 3Before you use sandbox-mcp with LLMs, you need to initialize its configuration
# Create the configuration directory in # $XDG_CONFIG_HOME/sandbox-mcp and pull # the default sandboxes from GitHub sandbox-mcp --pull # Build the Docker images for the sandboxes sandbox-mcp --build
README

Sandbox MCP is a Model Context Protocol (MCP) server that enables LLMs (MCP hosts/clients) to run code in secure, isolated Docker containers.
While LLMs are really good at generating code, most can't run the code they generate. You end up running this untested code directly on your machine, which could have drastic unintended consequences.
Giving LLMs the tools to test the code safely prevents such issues and helps you generate more accurate code in fewer iterations.
Sandbox MCP gives the LLMs an easy-to-use execution environment that anyone can create and configure through a simple, AI-native MCP server that runs locally.
Inspired by Codapi. Some sandboxes are the same as Codapi sandboxes.
Use Cases
Sandbox MCP can be used for many different tasks, including but not limited to:
- Secure code execution: Run any code generated by an LLM in a secure, isolated environment, protecting your system from untrusted or potentially harmful code.
- Code testing: Automatically test and validate code in various languages and or configurations in various environments before integrating it into larger projects or production systems.
- User code validation: Safely execute and check user-submitted code or scripts, ensuring they behave as expected and do not perform malicious actions.
- Network troubleshooting: Diagnose connectivity issues, test endpoints, and analyze network performance using isolated network tools, all without exposing your system.
- Educational and interview coding: Instantly compile and run code snippets for learning, teaching, or technical interviews, providing immediate feedback in a safe, temporary environment.
- Automated code review and feedback: Enable LLMs to execute, test, and review code automatically, offering actionable feedback or suggestions before code is merged or deployed.
Demo
This demo shows how Sandbox MCP works with Claude Desktop.

Try the video if the GIF isn't clear.
Installation
Download Binary
You can download the appropriate binary for your operating system (for example, Darwin) and processor architecture (arm64) from the Releases page (sandbox-mcp_Darwin_arm64.tar.gz).
Install via Go
Prerequisites:
- Go 1.24 or higher
go install github.com/pottekkat/sandbox-mcp/cmd/sandbox-mcp@latest
Get the path to the sandbox-mcp binary:
which sandbox-mcp
Build from Source
See the Development section.
Usage
Initilization
Before you use sandbox-mcp with LLMs, you need to initialize its configuration:
# Create the configuration directory in
# $XDG_CONFIG_HOME/sandbox-mcp and pull
# the default sandboxes from GitHub
sandbox-mcp --pull
# Build the Docker images for the sandboxes
sandbox-mcp --build
[!NOTE] Make sure you have Docker installed and running.
With MCP Hosts/Clients
Add this to your claude_desktop_config.json for Claude Desktop or mcp.json for Cursor IDE:
{
"mcpServers": {
"sandbox-mcp": {
"command": "path/to/sandbox-mcp",
"args": [
"--stdio"
]
}
}
}
[!NOTE] Make sure to replace
path/to/sandbox-mcpwith the actual path to thesandbox-mcpbinary.
Available Sandboxes
| Sandbox | Description |
|---|---|
| shell | A secure, isolated Linux environment for running lightweight commands that does not require network access. |
| python | Safely execute Python code in a secure, isolated environment. |
| rust | Compile and run Rust code in an isolated environment. |
| network-tools | Use various network utilities in an isolated Linux sandbox. Perfect for network diagnostics and troubleshooting. See https://github.com/jonlabelle/docker-network-tools for a list of available tools. |
| go | Run Go code securely in an isolated environment with network access. |
| javascript | Run JavaScript code in an isolated environment using Node.js. |
| apisix | Run a lightweight instance of Apache APISIX, which can be configured through a YAML file and can be interacted through the curl command provided in the main.sh file. For example, curl -sI http://127.0.0.1:9080/ip. |
| java | Compile and run Java code in an isolated sandbox. Supports Java preview features. |
[!IMPORTANT]
Your Own Sandbox
You can create and add your own sandboxes in
$XDG_CONFIG_HOME/sandbox-mcp/sandboxes. A sandbox is essentially a Dockerfile and a JSON configuration. Check out the examples and the guide to learn more.
Development
Fork and clone the repository:
git clone https://github.com/username/sandbox-mcp.git
Change into the directory:
cd sandbox-mcp
Install dependencies:
make deps
Build the project:
make build
Update your MCP servers configuration to point to the local build:
{
"mcpServers": {
"sandbox-mcp": {
"command": "/path/to/sandbox-mcp/dist/sandbox-mcp",
"args": [
"--stdio"
]
}
}
}
License
Files in the repo
- .github
- cmd
- internal
- sandboxes
- test
- .gitignore
- .golangci.yaml
- .goreleaser.yaml
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- cover.png
- demo.gif
- demo.mp4
- go.mod
- go.sum
- LICENSE
- logo.png
- Makefile
- readme-banner.png
- README.md
- SECURITY.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More connectors

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code
Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.
Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.
Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.
20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。