VoidRun MCP
The Model Context Protocol (MCP) lets coding agents and IDEs call VoidRun over Streamable HTTP (not stdio): one URL, JSON-RPC, same tenancy and auth as the REST API. This page covers where to paste config for each major tool, hosted VoidRun, localvoidrun, and how agents should read tool results.
Client compatibility (read this first)
VoidRun is a remote MCP server: your client opens HTTPS (or local HTTP) to{apiBase}/mcp. Clients that only support stdio (spawn a local command) cannot use VoidRun directly unless you run a separate local bridge (not provided here).
What you get
Architecture
initialize, clients must send the Mcp-Session-Id header on later requests. Cursor and the Inspector client set this automatically once the session is established.
Prerequisites
- A VoidRun API reachable over HTTPS (hosted) or HTTP (local dev).
- A valid API key for your organization (from the dashboard or your operator).
- For self-hosted deployments: a correctly provisioned host (base images, MongoDB, networking). MCP adds no extra port; it shares the API server.
MCP URL quick reference
Self-hosted: replace the host and path prefix with whatever
VR_API_URL points at (see Self-hosted deployments), then append /mcp.
Authentication
Cursor
- Create an API key in the VoidRun dashboard.
- Expose it to the IDE as
VR_API_KEY(or another name you reference in config). - Project config (recommended for teams): add
.cursor/mcp.jsonat the repo root:
- User-wide config: Cursor can also load MCP from your user settings path (see Cursor → Settings → MCP for “Open MCP config”); same JSON shape under
mcpServers. - Cursor → Settings → MCP: enable voidrun, then Reload Window after URL or header changes.
- Confirm tools (
create_sandbox,execute_command, etc.) appear in the MCP tool list.
mcp.json help; VoidRun needs url plus static headers including X-API-Key.
VS Code and GitHub Copilot Chat
VS Code stores MCP inmcp.json: either .vscode/mcp.json in the workspace (shareable with the repo) or the user MCP file opened via MCP: Open User Configuration (add and manage MCP servers).
- Copilot access: VS Code 1.99+ and a Copilot plan that allows MCP. Organizations: an admin may need to enable the MCP servers in Copilot policy (GitHub Copilot MCP).
- Use a remote HTTP server entry. VS Code’s reference format (MCP configuration reference):
- Save the file, use MCP: List Servers / the editor Start affordance if shown, then open Copilot Chat, choose Agent, and open the tools picker to confirm VoidRun tools load.
type must be http for VoidRun. VS Code tries Streamable HTTP first, then falls back to SSE for older servers (HTTP and SSE).
Claude Code
Claude Code is Anthropic’s CLI-centric workflow (terminal). Prefer--transport http for VoidRun.
One-off (user or local scope):
--scope project to write the team-shared .mcp.json at the project root, or --scope user for all projects. Options such as --header must appear before the server name (see Claude Code MCP docs).
Project file (.mcp.json, committed without secrets): Claude Code expands ${VAR} in url and headers:
VR_API_KEY in the shell before launching claude, or rely on your OS environment manager. Use /mcp inside Claude Code to verify connection and tool counts.
Claude remote connectors
Applies to claude.ai, Claude Desktop, Cowork, and mobile when using Anthropic’s hosted connector flow (not the legacy local-onlyclaude_desktop_config.json stdio command list).
Anthropic’s custom connectors path lets you attach a remote MCP URL from claude.ai, Claude Desktop, Cowork, and mobile, with traffic originating from Anthropic’s cloud (not only your laptop). That means:
- Your MCP URL (
https://api.void-run.com/api/mcpfor hosted VoidRun) must be reachable from the public internet (or you must allowlist Anthropic IP ranges). - Follow Customize → Connectors and Anthropic’s walkthrough: Get started with custom connectors using remote MCP.
Connector UIs evolve. If the connector flow does not let you attach a static
X-API-Key header, use Claude Code, Cursor, or VS Code with the examples above, or ask your operator to front VoidRun with the auth model your connector expects.claude_desktop_config.json spawning a stdio command) is a different mechanism from remote connectors; VoidRun’s first-party endpoint is still /api/mcp over HTTP.
JetBrains + GitHub Copilot
In supported JetBrains IDEs, open GitHub Copilot Chat in Agent mode, use the MCP / tools configuration UI to editmcp.json, and add a remote HTTP server. GitHub’s examples use url plus headers (sometimes under requestInit.headers); mirror the VS Code pattern: same VoidRun url and X-API-Key. See Extending Copilot Chat with MCP.
Other MCP-compatible tools
Any editor or agent runtime that supports remote MCP over HTTP (Streamable HTTP, with optional SSE fallback) can reuse:- URL:
https://api.void-run.com/api/mcp(hosted) orhttp://localhost:<port>/api/mcp(local). - Header:
X-API-Key: <key>(same as REST).
headers vs requestInit, env substitution, OAuth, etc.).
Hosted images and create_sandbox
On the hosted platform, valid system images are typically code, docker-lite, max, and docker (see System images). Pass an image value your deployment actually offers (from list_sandboxes / dashboard / GET /images), not a random tag, or create_sandbox may fail on hosts without that qcow2.
After server upgrades
Reload the MCP server or the IDE window so the client refetchestools/list (no config edit if URL and auth are unchanged).
MCP Inspector (debugging)
Useful to verify connectivity and tool names without the IDE. CLI (list tools):initialize (capture Mcp-Session-Id from the response) then tools/call with that header on follow-up requests; --cli often handles this for simple calls. Check upstream Inspector docs for your Node version (Node 22.7.5+ may be required).
UI: run npx @modelcontextprotocol/inspector, choose transport streamable-http, server URL https://…/api/mcp, and set X-API-Key in headers or auth.
Tools reference
All sandbox-scoped tools takeid as the sandbox document id (hex string from create_sandbox / list_sandboxes), not the DNS name, unless your workflow maps names to ids.
The server auto-wakes snapshotted sandboxes before filesystem and exec operations, so agents don’t need to check status first.
MCP resources
Use
resources/read with the exact URI. Template resources may not appear as separate chips in Cursor but still work where the client implements resources/read.
Response shapes (for agents)
Sandbox CRUD and list
create_sandbox, get_sandbox, delete_sandbox, and list_sandboxes return the same JSON envelope as REST:
list_sandboxes:datais the array of sandboxes;metaincludespage,limit,total,totalPages.get_sandbox/create_sandbox:datais the sandbox object.delete_sandbox:datamay be null.
data and meta. Some MCP clients wrap the payload again; unwrap until you see status / data.
Exec, filesystem, run_code
execute_command: structured stdout/stderr/exitCode style payload in the tool result (see REST/exec).run_code: structured interpreter result (stdout,stderr,exitCode, etc.).- Filesystem tools: JSON or plain text as returned;
read_fileis usually raw file text in the tool body.
Example workflows
A. New sandbox, run command, delete
create_sandboxwith{ "name": "agent-demo-001", "image": "code", "cpu": 1, "mem": 1024 }(adjustimageto your catalog).- From
data, read the sandboxid. execute_commandwith{ "id": "<id>", "command": "uname -a" }.delete_sandboxwith{ "id": "<id>" }.
B. Edit a file in the VM
write_file{ "id": "<id>", "path": "/root/app.py", "content": "…" }.execute_command{ "id": "<id>", "command": "python3 /root/app.py" }.
C. Long-running server
run_background_command{ "id": "<id>", "command": "python3 -m http.server 8080", "cwd": "/root" }.list_processesto read the PID.kill_processwhen done.
Instructing an LLM agent
Use concrete tool names and the server name you configured (examplevoidrun):
- “Use the voidrun MCP server:
list_sandboxes, thencreate_sandboxif none match name X, thenexecute_command.” - “For
list_sandboxes/get_sandbox/create_sandbox/delete_sandbox, the JSON matches REST: readdataandmeta.” - “The sandbox id argument is always
id(hex document id), not a display name.” - “Do not put API keys in the repository; use
mcp.jsonenv substitution or the MCP UI.”
AGENTS.md in your repo linking to this page.
Troubleshooting
Logs: API server stdout; Cursor Output → MCP; VS Code MCP output channel; self-hosted installs follow your operator’s logging configuration.
Related documentation
SDKs & API
REST auth,
VR_API_KEY, VR_API_URL, and how SDKs relate to HTTP.Quickstart
First sandbox with SDKs, CLI, and curl.
Shell execution
Exec, stream, background, and PTY concepts aligned with the API.
Self-hosted
Base URL and operator-specific differences.

