Luxor Sandbox MCP

io.github.LuxorLabs由 GitHub 帳號 LuxorLabs 發布v0.4.4更新於 Nov 19, 2026

Disposable microVM sandboxes for AI agents: run code, read/write files, git, preview URLs.

發布方自己的服務:sandbox.co

概覽

AI 產生的概覽

讓助理建立一次性的 Luxor 微虛擬機沙箱,用來執行程式碼、讀寫檔案、執行 git 操作並開放預覽連結。

可以做什麼
  • 執行程式碼與指令:一次性啟動-執行-銷毀,或用 exec 直接回傳 stdout/stderr/結束碼
  • 管理沙箱:建立、檢視、列出、暫停、恢復、衍生、延長、終止(單一或批次)
  • 操作檔案與 git:讀取、寫入、列出、檢視屬性、移動、刪除路徑;clone、checkout、diff、log
  • 對外開放服務:連接埠、預覽連結、檢視權杖以及網頁終端機
  • 管理基礎設施:快照、磁碟區、對外流量政策、範本與建置、SSH 金鑰與憑證
  • 檢查憑證與工作區用量,並取得二進位檔案的上傳/下載簽章連結
適用情境
適合讓代理在隔離的一次性機器上執行不受信任或臨時性的程式碼、測試程式碼儲存庫,或提供預覽連結而不影響本機。也適合需要從範本、快照或磁碟區取得可重現沙箱環境的工作流程。
執行需求
透過 npx 執行的本機 Node.js 程序(套件 @luxorai/mcp),或使用託管的 HTTP 端點。需要 Luxor 帳號以及一個憑證:LUXOR_API_KEY(lx_ 或 tk_ 前綴)或 LUXOR_AUTH_TOKEN;沒有憑證時只會註冊認證狀態工具。需要連線至 Luxor API 的網路,可用 LUXOR_API_ENDPOINT 覆寫。
安裝前請注意
此伺服器持有可執行程式碼並消耗額度的 API 金鑰,應視為高權限能力。沙箱按秒計費。許多工具會建立、覆寫、中斷或刪除狀態,包括批次終止與刪除路徑。程式碼輸出不受信任,應視為資料而非指令。可用 LUXOR_MCP_READONLY 或 LUXOR_MCP_DISABLED_TOOLS 限制工具;若將 HTTP 模式開放至回送位址以外,需設定 LUXOR_MCP_HTTP_TOKEN。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

Luxor MCP: @luxorai/mcp

A Model Context Protocol server for Luxor Sandbox, part of Luxor Agent Cloud by Luxor AI. Give any agent (Claude, Codex, Cursor) a disposable microVM it can create, run code in, read and write files, run git, and expose to the web. Sandboxes boot in ~2 seconds and are billed per second.

The agent writes code and Luxor runs it in isolation. (Luxor Code Review and Luxor's managed CI runners are separate products; this server currently exposes the Sandbox.)

The old @tenkicloud/mcp name keeps working and publishes the same code.

"Run this Python in a fresh sandbox and tell me what it prints."        │        ▼   tenki_run_code   boots a microVM → runs it → returns stdout → tears it down

Quickstart

bash
export LUXOR_API_KEY=lx_your_key_herenpx -y @luxorai/mcp     # speaks MCP over stdio

Nothing to clone or build. The package installs the command luxor-mcp (and tenki-mcp, the same program).

Use it in Claude Code

Connect to Luxor's hosted MCP service and sign in with your Luxor account:

bash
claude mcp add --transport http luxor https://mcp.luxor.ai/mcpclaude mcp login luxor

Claude Code's mcp add command stores the server configuration; mcp login performs the one-time browser authorization and workspace selection.

Alternatively, run the MCP server locally with an API key:

bash
claude mcp add luxor --env LUXOR_API_KEY=lx_your_key_here -- npx -y @luxorai/mcp

Or install it as a Claude Code plugin

The repo doubles as a plugin marketplace. This prompts for your API key on install and stores it in your OS keychain, so there is no env var to manage:

/plugin marketplace add LuxorLabs/tenki-mcp/plugin install luxor@luxor

If you added this marketplace before it was named luxor, your installs keep working as luxor@tenki and tenki@tenki. To switch to the new name, run /plugin marketplace remove tenki (this uninstalls its plugins and their saved API key), then add the marketplace again.

The luxor plugin names its tools luxor_*; the legacy tenki plugin keeps tenki_*.

Use it in Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "luxor": {      "command": "npx",      "args": ["-y", "@luxorai/mcp"],      "env": { "LUXOR_API_KEY": "lx_your_key_here" }    }  }}

Use it in Cursor

Add the same block to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

json
{  "mcpServers": {    "luxor": {      "command": "npx",      "args": ["-y", "@luxorai/mcp"],      "env": { "LUXOR_API_KEY": "lx_your_key_here" }    }  }}

Use it in Codex

The OpenAI Codex CLI reads MCP servers from ~/.codex/config.toml. Add:

toml
[mcp_servers.luxor]command = "npx"args = ["-y", "@luxorai/mcp"]env = { LUXOR_API_KEY = "lx_your_key_here" }

Confirm it's working

After adding the server, start a fresh session so the client loads it, then ask your agent one of:

  • "Check Luxor auth status.": confirms your credential was picked up.
  • "Run print(2+2) in a fresh Luxor sandbox.": a full boot → run → teardown round-trip.

If the tools don't show up, restart the client so it re-reads its config.

No key yet? Start the server without one and ask the agent to check tenki_auth_status; it reports what to set and where. See Auth.

Run it from a clone instead

For development, or to run an unreleased change:

bash
git clone https://github.com/LuxorLabs/tenki-mcp.git && cd tenki-mcpnpm install && npm run buildLUXOR_API_KEY=lx_your_key_here node dist/index.js

Substitute node /absolute/path/to/tenki-mcp/dist/index.js for the npx command in any of the configs above. See CONTRIBUTING.md for the full development loop.

Environment variables

VariableDefaultPurpose
LUXOR_API_KEY-API key (lx_…, or tk_…). One of this or LUXOR_AUTH_TOKEN is required.
LUXOR_AUTH_TOKEN-Session token (ory_st_… or cookie value). Takes precedence over LUXOR_API_KEY when both are set.
LUXOR_API_ENDPOINThttps://api.luxor.ai (the same API as https://api.tenki.cloud)Control-plane base URL (LUXOR_API_URL is an alias).
LUXOR_MCP_READONLYoff1 registers only read tools (no create/run/delete/spend).
LUXOR_MCP_DISABLED_TOOLS-Comma-separated tool names to skip registering.
LUXOR_MCP_AUDIToff1 logs each tool call name + arg keys to stderr.
LUXOR_MCP_TOOL_PREFIXtenkiluxor names every tool luxor_* instead of tenki_* (the luxor Claude Code plugin sets it). Descriptions and errors use the same names.
LUXOR_MCP_TRANSPORTstdiohttp serves Streamable HTTP instead (see below).
PORT3000HTTP transport port.
LUXOR_MCP_HTTP_HOST127.0.0.1HTTP bind host; non-loopback requires LUXOR_MCP_HTTP_TOKEN.
LUXOR_MCP_HTTP_TOKEN-Bearer token for the HTTP endpoint; optional on loopback, required on a non-loopback host.
LUXOR_MCP_PUBLIC_URL-Public base URL for an OAuth-protected hosted server.
LUXOR_MCP_OAUTH_ISSUER-OAuth authorization-server issuer. Enables delegated OAuth HTTP mode.
LUXOR_MCP_OAUTH_RESOURCE<public URL>/mcpRFC 8707 resource identifier accepted in access-token audiences. A comma-separated list serves one resource per domain; metadata and the 401 resource_metadata follow the request host, else the first.
LUXOR_MCP_OAUTH_SCOPEmcpRequired delegated scope.
LUXOR_MCP_RESOURCE_NAMELuxor MCPresource_name in the protected-resource metadata.
LUXOR_MCP_IDENTITY_URL-Internal Luxor Identity service endpoint used to exchange OAuth access tokens.
LUXOR_MCP_IDENTITY_SERVICE_TOKEN-Service credential for the private Identity token-exchange RPC.

Every LUXOR_* variable above is still accepted under its TENKI_* name (for example TENKI_API_KEY, TENKI_MCP_TRANSPORT). All LUXOR_* credentials are read before any TENKI_* one. Keys start with lx_; tk_… keys are still accepted. LUXOR_API_KEY is only used when it starts with lx_ or tk_; any other value is ignored.

Tools

82 tools: all 76 tool-worthy public unary API methods (enforced by a CI parity audit, which also fails if a tool calls a method the API no longer has; GitOperation is exposed as one tool per operation), two workflow helpers, and tenki_auth_status. Tool names use the tenki_ prefix by default; set LUXOR_MCP_TOOL_PREFIX=luxor (as the luxor plugin does) to name them luxor_*. A few admin surfaces (published images, saved Tailscale connections) and implementation-only control-plane methods are intentionally excluded. Grouped by domain:

DomainTools
Authtenki_auth_status (which credential is configured, and does it work; the only tool available when none is)
Identitytenki_whoami
Runtenki_run_code (one-shot: boot → run shell/python/js → tear down)
Sandboxestenki_create_sandbox · tenki_get_sandbox · tenki_get_sandbox_metrics · tenki_list_sandboxes · tenki_terminate_sandbox · tenki_pause_sandbox · tenki_resume_sandbox · tenki_fork_sandbox (copies of a running sandbox)
Session admintenki_extend_sandbox · tenki_update_sandbox · tenki_terminate_sandboxes (bulk) · tenki_report_sandbox_activity · tenki_list_workspace_sandboxes
Exectenki_exec (stdout/stderr/exit inline)
Filestenki_read_file · tenki_write_file · tenki_list_files · tenki_stat_path · tenki_make_dir · tenki_remove_path · tenki_move_path
Gittenki_git_clone · tenki_git_checkout · tenki_git_diff · tenki_git_log (the four operations the API supports; pass directory to target a cloned repo; run other git commands via tenki_exec)
Ports & previewsexpose · list-exposed · unexpose · create-preview-url · open-preview (viewer-token-gated, not public; port 7681 is the web terminal) · list/get/delete-preview-url · touch-preview · bind/unbind-preview-url · resolve-preview-token
Artifacts (binary transfer)tenki_get_upload_url · tenki_get_download_url (signed URLs for binary PUT/GET)
SSHtenki_update_ssh_keys · tenki_issue_ssh_cert · tenki_list_ssh_gateways
Snapshotscreate · get · list · list-session · list-workspace · list-dangling · update · delete · get-download-url
Volumescreate · get · list · update · delete · resize · attach · detach
Egress policiescreate · get · list · update · delete (named workspace allowlists that tenki_create_sandbox pins via egress_policies)
Templatescreate · get · list · update · delete · build · cancel-build · get-build · list-active-builds · list-builds · delete-build
Workspacetenki_get_workspace_usage · tenki_list_ci_runner_sizes · tenki_get_workspace_preview_domains · tenki_update_workspace_preview_domains

Full per-release breakdown in CHANGELOG.md.

Deprecated upstream, still served: tenki_expose_port / tenki_unexpose_port / tenki_list_exposed_ports (the API prefers the preview-URL tools), tenki_list_workspace_sandboxes / tenki_list_workspace_snapshots (prefer the credential-scoped lists), and the ExecuteCommand RPC behind tenki_exec / tenki_run_code / tenki_move_path (successor is the data-plane Run stream, which needs an HTTP/2 transport this server does not have yet). The parity audit prints these on every run.

Auth

Set one of LUXOR_API_KEY or LUXOR_AUTH_TOKEN (TENKI_API_KEY / TENKI_AUTH_TOKEN are still accepted). When both are set, the auth token wins. The header is chosen by token prefix: lx_… or tk_… → Authorization: Bearer, ory_st_… → X-Session-Token, otherwise a session cookie. Override the endpoint with LUXOR_API_ENDPOINT (default https://api.luxor.ai, the same API as https://api.tenki.cloud).

Without a credential the server still starts, registering only tenki_auth_status, so instead of an MCP client reporting an opaque "server failed to start", the agent can call that tool and get told what to set. Ask it "check Luxor auth status" any time other tools return auth errors: it reports the credential kind (API key vs session token), the endpoint, and whether a live identity probe succeeded, never the token itself. It reports status only; get a credential from the Luxor dashboard.

Host it over HTTP (v2.0-beta)

Besides stdio, the server speaks Streamable HTTP so it can be hosted for remote MCP clients:

bash
LUXOR_MCP_TRANSPORT=http PORT=3000 LUXOR_API_KEY=… npx -y @luxorai/mcp# → tenki-mcp running on http://127.0.0.1:3000/mcp (Streamable HTTP) [loopback only, no auth]

For a single-user deployment, HTTP mode can hold one shared LUXOR_API_KEY and therefore exposes a powerful capability. By default it:

  • binds to loopback (127.0.0.1) only: set LUXOR_MCP_HTTP_HOST=0.0.0.0 to expose it, but then
  • it requires a bearer token: set LUXOR_MCP_HTTP_TOKEN and send Authorization: Bearer <token>. It refuses to start on a non-loopback host without one.
  • DNS-rebinding protection is on (Host-header allowlist), so a malicious web page can't drive your local server.
bash
# expose to a network safely:LUXOR_MCP_TRANSPORT=http LUXOR_MCP_HTTP_HOST=0.0.0.0 PORT=3000 \  LUXOR_MCP_HTTP_TOKEN=$(openssl rand -hex 32) LUXOR_API_KEY=… npx -y @luxorai/mcp

Point an HTTP-capable MCP client at /mcp. Static-key mode uses one shared LUXOR_API_KEY for all sessions. Verified end-to-end (test/http-transport.test.mjs: auth gate, DNS-rebinding rejection, connect → tools/list → tool call over HTTP).

Hosted multi-tenant deployments instead use Luxor Identity's OAuth facade. The MCP server publishes RFC 9728 protected-resource metadata and exchanges each caller's access token through the private Identity service. Identity owns Hydra, validates the requested audience and scope, and issues a short-lived API delegation bound to the user, client, and workspace selected on the Luxor consent page. tenki-mcp has no Hydra Admin access and does not hold the delegation-signing secret.

How it works

Luxor's API is ConnectRPC: JSON over HTTP/1.1, not REST. Every control-plane call is POST https://api.luxor.ai/tenki.sandbox.v1.SandboxService/{Method} with a lowerCamelCase JSON body. Per-session file I/O runs on a separate data-plane endpoint returned at create time, authenticated with a short-lived session certificate. This server owns both transports so the tools stay one-liners.

Command output: tenki_exec and tenki_run_code capture stdout/stderr by redirecting to files (sh -c '… > out 2> err') and reading them back over the data plane, so you get the output inline through a plain HTTP client.

The wire details are ported from the live-verified n8n community node.

Security

This server holds a Luxor API key and can run code + spend credits, so treat it as a capability. Full model + CSA MCP Server Top-10 mapping in SECURITY.md. Quick controls:

  • Least privilege: every tool carries a title and MCP annotations: readOnlyHint on reads, and destructiveHint on every tool that can overwrite, modify, interrupt or delete existing state (only tools that create, resume, extend, attach or keep alive without changing existing state are non-destructive). Run LUXOR_MCP_READONLY=1 for an inspection-only server (read tools only), or LUXOR_MCP_DISABLED_TOOLS=tenki_run_code,… to drop specific tools.
  • HTTP transport is loopback-only by default and requires a bearer token to expose to a network (see Host it over HTTP).
  • Audit: LUXOR_MCP_AUDIT=1 logs each tool call's name to stderr.
  • Untrusted output: tenki_run_code/tenki_exec/tenki_read_file return output from untrusted code; clients should treat tool results as data, not instructions.

Report vulnerabilities via a private security advisory, not a public issue.

Related

License

MIT

來源:README.md,提交 a63b0ea

工具

1

tenki_auth_status

Check Credential Status

Report whether the server has a usable Tenki credential, which kind (API key vs OAuth session token), and the endpoint it targets — verified with a live identity probe. Call this first when other tools fail with auth errors, or when this is the only tool available (which means no credential is configured). Reports status only; it does not log in and never returns the token.

無需輸入參數。

版本歷史

4
  1. v0.4.4最新Nov 17, 2026
  2. v0.4.3Nov 16, 2026
  3. v0.4.1Nov 12, 2026
  4. v0.4.0Nov 11, 2026

評分

已滿足適用檢查項的 90%

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

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

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

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

其他 Sandbox 整合