Sponsored by Deepsite.site

Sandbox Mcp

Created By
pottekkat8 months ago
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
Content

Sandbox MCP Logo

GitHub Actions Workflow Status GitHub Release GitHub commits since latest release GitHub License

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.

Demo

This demo shows how Sandbox MCP works with Claude Desktop.

Sandbox MCP demo GIF

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-mcp with the actual path to the sandbox-mcp binary.

Available Sandboxes

shell

Run shell commands in a Linux environment with strict security and network constraints.

python

Run Python code with a set of pre-installed libraries.

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.

network-tools

Use various network tools in an isolated Linux sandbox. The container has network access.

See jonlabelle/docker-network-tools for a list of available tools.

go

Run simple Go code in an isolated sandbox.

apisix

Run Apache APISIX in a sandbox. Custom routes, plugins, and upstreams can be configured through a YAML file and it can be tested using curl commands. Has network access.

javascript

Run JavaScript code using Node.js.

rust

Run Rust code in a Linux sandbox.

java

Run Java code.

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

MIT License

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.