Sandboxrun

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 1, 2026

Run code in a secure E2B sandbox from the CLI or a stdio MCP server.

概覽

AI 產生的概覽

在短暫存在的 E2B 雲端沙箱中執行 Python 程式碼,回傳輸出、結果與錯誤,讓助理不必在你的電腦上執行程式。

可以做什麼
  • 在新建的 E2B 沙箱中執行 Python 程式片段,回傳沙箱 id、列印輸出、結構化結果、日誌行以及程式碼拋出的錯誤。
  • 程式碼採用 Jupyter Notebook 語法,運算式與儲存格行為與筆記本一致。
  • 每次呼叫都會從 code-interpreter 範本建立全新沙箱,各次執行之間不共用狀態。
適用情境
適合助理寫完 Python 程式後確認能否實際執行,或希望程式碼不在自己電腦上執行的情況。它只提供單一工具,較適合快速驗證而非長時間工作階段。
執行需求
透過 npx(需 Node.js)或 Docker 映像以 stdio 在本機執行。需要 E2B 帳號,並在 E2B_API_KEY 環境變數提供 API 金鑰,缺少時每次執行都會失敗。需要能連線至 E2B API 的網路。
安裝前請注意
E2B_API_KEY 是會產生費用的第三方憑證,會以 X-API-Key 標頭送往 E2B API,請勿寫入共用設定。程式碼與其輸出會離開本機進入 E2B 雲端沙箱,避免在片段中放入金鑰或私密資料。沙箱為短暫性,呼叫之間不會保留任何內容。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Sandboxrun,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

sandboxrun

sandboxrun gives an agent a safe place to run code it just wrote. Hand it a snippet and it comes back with what the snippet printed, the values it produced, and any error it hit — all executed inside a short-lived E2B sandbox, never on your own machine. It runs from the command line or as an MCP server for agents.

An E2B API key is required. Put it in the E2B_API_KEY environment variable; the key is sent to the API as the X-API-Key header and never appears in output. When the variable is missing, every run fails with an error that names it.

Install

bash
npx @reneturcios/sandboxrun run "print(6 * 7)"

Or run the container image:

bash
docker run -i -e E2B_API_KEY ghcr.io/cloudcorprecords/sandboxrun

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
export E2B_API_KEY="your E2B API key"
# Run a snippet inlinesandboxrun run "print('hello from the sandbox')"
# Run a file's contentssandboxrun run --file analysis.py
# Machine-readable outputsandboxrun run "import math; print(math.pi)" --json
sandboxrun --version

Exit codes: 0 on success, 1 when a run fails (including a missing E2B_API_KEY, an API error, or an error raised by the code itself), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/sandboxrun mcp

MCP client configuration:

json
{  "mcpServers": {    "sandboxrun": {      "command": "npx",      "args": ["-y", "@reneturcios/sandboxrun", "mcp"],      "env": { "E2B_API_KEY": "your E2B API key" }    }  }}

Tools

ToolInputWhat it returns
run_codecode (string, required)The execution as a text block: the sandbox id, printed output, structured results, log lines, and any error the code raised. Code uses Jupyter notebook syntax.

The documented E2B MCP server exposes this single tool, and sandboxrun exposes exactly that tool — nothing extra.

Under the hood each call creates a fresh sandbox from the code-interpreter template (POST https://api.e2b.app/sandboxes) and then executes the code in it. The upstream SDK talks to the sandbox's Jupyter kernel over a websocket channel; this rebuild shapes the execution as a REST request behind the same seam and records that transport simplification in its build report.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

來源:README.md,提交 226de0e

工具

1

run_code

Run python code in a secure sandbox by E2B. Using the Jupyter Notebook syntax.

輸入參數code必填

版本歷史

1
  1. v0.1.0最新Nov 1, 2026

評分

已滿足適用檢查項的 90%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分