SandboxAPI

السجل الرسمي أدوات المطورين

Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

Remote (streamable-http)
Claude Code
claude mcp add --transport http sandboxapi 'https://mcp.sandboxapi.dev/mcp'
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "sandboxapi": {
            "type": "http",
            "url": "https://mcp.sandboxapi.dev/mcp"
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. SandboxAPI MCP Server
  2. Quick Start
  3. Available Tools
  4. Supported Languages
  5. Environment Variables
  6. Security
  7. API Key
  8. Links
  9. License

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.

ParameterTypeRequiredDescription
languagestringYespython3, javascript, typescript, bash, java, cpp, c, go
codestringYesSource code to execute (max 1MB)
timeoutnumberNoTimeout in seconds (default: 10, max: 300)
stdinstringNoStandard input to pass to the program
execute_batch

Execute multiple code snippets. Each runs in its own isolated sandbox.

ParameterTypeRequiredDescription
executionsarrayYesArray of {language, code, timeout?, stdin?} objects
list_languages

List all supported programming languages with versions and example code. No parameters.

Supported Languages

LanguageVersionAliases
Python3.12python3, python, py
JavaScriptNode 22javascript, js, node
TypeScript5.4typescript, ts
Go1.22go, golang
Java21java, jdk
C++GCC 14cpp, c++
CGCC 14c, gcc
Bash5.2bash, sh, shell

Environment Variables

VariableRequiredDescription
SANDBOXAPI_API_KEYYesAPI key for the SandboxAPI backend
MCP_API_KEYNoAuth key for the MCP endpoint (omit for open access)
MCP_PORTNoPort to listen on (default: 8081)
SANDBOXAPI_URLNoAPI 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.

License

MIT

الأسئلة الشائعة

ما هو SandboxAPI؟

Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.

كيف أثبّت SandboxAPI؟

يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http sandboxapi 'https://mcp.sandboxapi.dev/mcp'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج SandboxAPI إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل SandboxAPI مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون SandboxAPI؟

ينشره sandboxapi. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.