SandboxAPI

io.github.MichielDeRuiter由 GitHub 帳號 MichielDeRuiter 發布v1.0.0更新於 Oct 24, 2026

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

已驗證Streamable HTTP可網頁執行雲端與基礎設施開發者工具

概覽

AI 產生的概覽

SandboxAPI 讓 AI 助理在隔離的 gVisor 沙箱中執行八種語言的程式碼,可透過託管遠端端點或自架 Docker 服務使用。

可以做什麼
  • 以 Python、JavaScript、TypeScript、Go、Java、C++、C 或 Bash 執行程式碼,可指定逾時與標準輸入
  • 批次送出多段程式碼,每段在各自獨立的沙箱中執行
  • 列出支援的語言及其版本與範例程式碼
適用情境
適合助理需要真正執行或測試程式碼、而不只是推理程式碼的情況,且希望執行過程與自己的電腦和網路隔離。適用於快速驗證腳本、比較不同語言與批次實驗。
執行需求
可使用託管遠端端點(OAuth 或 Bearer API 金鑰),也可在本機執行 Docker 映像或 Go 建置。自架需 SANDBOXAPI_API_KEY,MCP_API_KEY、MCP_PORT、SANDBOXAPI_URL 為選用。API 金鑰需向廠商網站或 RapidAPI 取得。
安裝前請注意
程式碼會傳送到第三方執行服務,不要在程式碼片段中放入金鑰或私密資料。需要 API 金鑰,服務商可能依用量計費。自架時若未設定 MCP_API_KEY,端點將對任何能連上它的人開放。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SandboxAPI,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.MichielDeRuiter%2Fsandboxapi-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "sandboxapi": {
      "type": "http",
      "url": "https://mcp.sandboxapi.dev/mcp"
    }
  }
}

README

SandboxAPI MCP Server

[MCP] [Languages] [License]

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):

json
{  "mcpServers": {    "sandboxapi": {      "url": "https://mcp.sandboxapi.dev/mcp",      "headers": {        "Authorization": "Bearer YOUR_API_KEY"      }    }  }}

VS Code (.vscode/mcp.json):

json
{  "servers": {    "sandboxapi": {      "url": "https://mcp.sandboxapi.dev/mcp",      "headers": {        "Authorization": "Bearer YOUR_API_KEY"      }    }  }}

Cursor (~/.cursor/mcp.json):

json
{  "mcpServers": {    "sandboxapi": {      "url": "https://mcp.sandboxapi.dev/mcp",      "headers": {        "Authorization": "Bearer YOUR_API_KEY"      }    }  }}

Option 2: Docker

bash
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

bash
git clone https://github.com/sandboxapi/sandboxapi-mcp.gitcd sandboxapi-mcpgo build -o sandboxapi-mcp .
export SANDBOXAPI_API_KEY=your_keyexport 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.

Links

License

MIT

來源:README.md,提交 edb9d15

工具

0
該伺服器需要 API 金鑰等憑證,因此 SourceWeft 無法在沒有憑證的情況下讀取其工具,也未收錄。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分