sandboxapi-mcp
Execute code in 8 programming languages via gVisor-sandboxed Docker containers. Supports Python, JS, TS, Go, Java, C++, C, and Bash.
README
SandboxAPI MCP Server
Give your AI agent the ability to execute code in 8 programming languages, safely.
SandboxAPI MCP Server connects any MCP-compatible AI client (Claude, Cursor, VS Code, Windsurf, etc.) to secure code execution. Every execution runs inside a gVisor-sandboxed Docker container with no network access, strict resource limits, and ephemeral filesystems.
Quick Start
Option 1: Remote Server (No Setup)
Connect directly to the hosted endpoint. No local installation required.
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"sandboxapi": {
"url": "https://mcp.sandboxapi.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
VS Code (.vscode/mcp.json):
{
"servers": {
"sandboxapi": {
"url": "https://mcp.sandboxapi.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"sandboxapi": {
"url": "https://mcp.sandboxapi.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Option 2: Docker
docker run -d \
-p 8081:8081 \
-e SANDBOXAPI_API_KEY=your_sandboxapi_key \
-e MCP_API_KEY=your_mcp_auth_key \
sandboxapi/mcp:latest
Then point your client to http://localhost:8081/mcp.
Option 3: Build from Source
git clone https://github.com/sandboxapi/sandboxapi-mcp.git
cd sandboxapi-mcp
go build -o sandboxapi-mcp .
export SANDBOXAPI_API_KEY=your_key
export MCP_API_KEY=optional_auth_key
./sandboxapi-mcp
Available Tools
execute_code
Execute code in a sandboxed container.
| Parameter | Type | Required | Description |
|---|---|---|---|
language |
string | Yes | python3, javascript, typescript, bash, java, cpp, c, go |
code |
string | Yes | Source code to execute (max 1MB) |
timeout |
number | No | Timeout in seconds (default: 10, max: 300) |
stdin |
string | No | Standard input to pass to the program |
execute_batch
Execute multiple code snippets. Each runs in its own isolated sandbox.
| Parameter | Type | Required | Description |
|---|---|---|---|
executions |
array | Yes | Array of {language, code, timeout?, stdin?} objects |
list_languages
List all supported programming languages with versions and example code. No parameters.
Supported Languages
| Language | Version | Aliases |
|---|---|---|
| Python | 3.12 | python3, python, py |
| JavaScript | Node 22 | javascript, js, node |
| TypeScript | 5.4 | typescript, ts |
| Go | 1.22 | go, golang |
| Java | 21 | java, jdk |
| C++ | GCC 14 | cpp, c++ |
| C | GCC 14 | c, gcc |
| Bash | 5.2 | bash, sh, shell |
Environment Variables
| Variable | Required | Description |
|---|---|---|
SANDBOXAPI_API_KEY |
Yes | API key for the SandboxAPI backend |
MCP_API_KEY |
No | Auth key for the MCP endpoint (omit for open access) |
MCP_PORT |
No | Port to listen on (default: 8081) |
SANDBOXAPI_URL |
No | API base URL (default: https://api.sandboxapi.dev) |
Security
Every code execution is isolated with defense-in-depth:
- gVisor (runsc) — User-space kernel intercepts all syscalls
- Network isolation — Executed code cannot make outbound connections
- Resource limits — CPU, memory, and disk usage are capped
- Ephemeral containers — Destroyed immediately after execution
- Read-only filesystem — No persistent writes between executions
- Code size limits — Source code capped at 1MB
- Timeout enforcement — Hard kill after configured timeout
API Key
Get your API key at sandboxapi.dev or through RapidAPI.
Links
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.