Skip to main content

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, local voidrun, 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

After 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

  1. A VoidRun API reachable over HTTPS (hosted) or HTTP (local dev).
  2. A valid API key for your organization (from the dashboard or your operator).
  3. 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

Do not commit real API keys. Prefer environment substitution (Cursor ${env:VR_API_KEY}), VS Code inputs and ${input:…}, or Claude Code ${VR_API_KEY} inside headers in .mcp.json (see Claude env expansion).

Cursor

  1. Create an API key in the VoidRun dashboard.
  2. Expose it to the IDE as VR_API_KEY (or another name you reference in config).
  3. Project config (recommended for teams): add .cursor/mcp.json at the repo root:
  1. 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.
  2. Cursor → Settings → MCP: enable voidrun, then Reload Window after URL or header changes.
  3. Confirm tools (create_sandbox, execute_command, etc.) appear in the MCP tool list.
Official Cursor MCP shape is documented in Cursor’s own MCP / mcp.json help; VoidRun needs url plus static headers including X-API-Key.

VS Code and GitHub Copilot Chat

VS Code stores MCP in mcp.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).
  1. 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).
  2. Use a remote HTTP server entry. VS Code’s reference format (MCP configuration reference):
  1. 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):
Use --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:
Export 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-only claude_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:
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.
Local-only MCP in Claude Desktop (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 edit mcp.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) or http://localhost:<port>/api/mcp (local).
  • Header: X-API-Key: <key> (same as REST).
Consult that product’s MCP documentation for the exact JSON schema (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 refetches tools/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):
The full sequence is 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 take id 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: data is the array of sandboxes; meta includes page, limit, total, totalPages.
  • get_sandbox / create_sandbox: data is the sandbox object.
  • delete_sandbox: data may be null.
Agents: parse the tool result body as JSON, then read 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_file is usually raw file text in the tool body.

Example workflows

A. New sandbox, run command, delete

  1. create_sandbox with { "name": "agent-demo-001", "image": "code", "cpu": 1, "mem": 1024 } (adjust image to your catalog).
  2. From data, read the sandbox id.
  3. execute_command with { "id": "<id>", "command": "uname -a" }.
  4. delete_sandbox with { "id": "<id>" }.

B. Edit a file in the VM

  1. write_file { "id": "<id>", "path": "/root/app.py", "content": "…" }.
  2. execute_command { "id": "<id>", "command": "python3 /root/app.py" }.

C. Long-running server

  1. run_background_command { "id": "<id>", "command": "python3 -m http.server 8080", "cwd": "/root" }.
  2. list_processes to read the PID.
  3. kill_process when done.

Instructing an LLM agent

Use concrete tool names and the server name you configured (example voidrun):
  • “Use the voidrun MCP server: list_sandboxes, then create_sandbox if none match name X, then execute_command.”
  • “For list_sandboxes / get_sandbox / create_sandbox / delete_sandbox, the JSON matches REST: read data and meta.”
  • “The sandbox id argument is always id (hex document id), not a display name.”
  • “Do not put API keys in the repository; use mcp.json env substitution or the MCP UI.”
Optional: add a Cursor rule or 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.

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.