---
title: MCP server · Sandboxes docs
description: Connect Claude, ChatGPT, Cursor, VS Code, Claude Code, Codex, Gemini CLI, Windsurf or any MCP client to Sandboxes with one address, under your policy.
url: https://www.quietrobot.ai/docs/sandboxes/mcp
---

# MCP server

Connect Claude, ChatGPT, Cursor, VS Code, Claude Code, Codex, Gemini CLI, Windsurf or any MCP client to Sandboxes with one address, under your policy.

> [!NOTE]
> Sandboxes is in early access. It is free to try, some parts are still in testing, and details may change.

The Sandboxes MCP server gives an AI its own Linux computer to work in, instead of your laptop. It can start a sandbox, clone a repository, install packages, run tests, start a dev server and send you a link to it. Every command goes through your organization's policy, so network rules, approvals, spending limits and the audit log apply just as they do to the SDKs.

There are two ways to run it: **hosted**, at one address, which most people want, or **on your own machine** with `npx`.

## Hosted: add one address

```text
https://api.quietrobot.ai/mcp
```

Add that address to your app and sign in with your Quiet Robot account the first time. There's nothing to install and no API key to paste. An owner or admin of the organization allows each app once, and it then shows on the **API keys** page with its name, such as "Claude (connected app)"; revoke it there to disconnect.

| App | How to add it |
|---|---|
| **Claude** (web, desktop app, phone) | Settings → Connectors → Add custom connector → paste the address. Connectors added on the web show up on your phone too. |
| **ChatGPT** | Settings → Apps & Connectors → Advanced → Developer mode, then Create, paste the address and pick OAuth. |
| **Cursor** | [Add to Cursor](https://cursor.com/en/install-mcp?name=quietrobot-sandboxes&config=eyJ1cmwiOiJodHRwczovL2FwaS5xdWlldHJvYm90LmFpL21jcCJ9) (one click), or add `{"mcpServers": {"quietrobot-sandboxes": {"url": "https://api.quietrobot.ai/mcp"}}}` to `~/.cursor/mcp.json`. |
| **VS Code** (GitHub Copilot) | [Add to VS Code](https://vscode.dev/redirect/mcp/install?name=quietrobot-sandboxes&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.quietrobot.ai%2Fmcp%22%7D) (one click), or `code --add-mcp '{"name":"quietrobot-sandboxes","type":"http","url":"https://api.quietrobot.ai/mcp"}'` |
| **Claude Code** | `claude mcp add --transport http quietrobot https://api.quietrobot.ai/mcp`, then `/mcp` to sign in. |
| **Codex** | `codex mcp add quietrobot --url https://api.quietrobot.ai/mcp`, then `codex mcp login quietrobot`. |
| **Gemini CLI** | `gemini mcp add --transport http quietrobot https://api.quietrobot.ai/mcp` |
| **Windsurf** | Add `{"mcpServers": {"quietrobot-sandboxes": {"serverUrl": "https://api.quietrobot.ai/mcp"}}}` to `~/.codeium/windsurf/mcp_config.json`. |

**With an API key instead of signing in.** For scripts, CI and apps without OAuth, send a key from the **API keys** page as a header: `Authorization: Bearer qr_live_...`. For example `claude mcp add --transport http quietrobot https://api.quietrobot.ai/mcp --header "Authorization: Bearer $QR_API_KEY"`. Use a [read-only key](https://www.quietrobot.ai/docs/sandboxes/authentication) if the agent should only look at sandboxes.

Long installs keep reporting progress, so they don't time out. The hosted server remembers the sandbox an app is working on between requests; sandboxes it starts stop at their time limit like any other.

> [!PREVIEW]
> **One-step installs.** A plugin for Claude Code, Codex and Cursor, and an extension for Gemini CLI, that add the connector together with four skills that teach the agent to use sandboxes well (test a project, preview a web app, write SDK code). This page will have the install lines when they're out.

## On your own machine

You need Node.js 20 or newer and an [API key](https://www.quietrobot.ai/docs/sandboxes/authentication).

**Claude Code**

```bash
claude mcp add quietrobot-sandboxes --env QR_API_KEY=qr_live_... -- npx -y @quietrobot/sandboxes-mcp
```

**Cursor** (`~/.cursor/mcp.json`), **Claude Desktop** (`claude_desktop_config.json`), **Windsurf** and most other clients take the same block:

```json
{
  "mcpServers": {
    "quietrobot-sandboxes": {
      "command": "npx",
      "args": ["-y", "@quietrobot/sandboxes-mcp"],
      "env": { "QR_API_KEY": "qr_live_..." }
    }
  }
}
```

**VS Code** (`.vscode/mcp.json`), with the key asked for once and stored by VS Code:

```json
{
  "servers": {
    "quietrobot-sandboxes": {
      "command": "npx",
      "args": ["-y", "@quietrobot/sandboxes-mcp"],
      "env": { "QR_API_KEY": "${input:qr-key}" }
    }
  },
  "inputs": [{ "id": "qr-key", "type": "promptString", "description": "Quiet Robot API key", "password": true }]
}
```

Restart the client, then ask it something like:

> Start a sandbox, clone github.com/you/app into it, install the dependencies and run the tests.

## Tools

| Tool | What it does |
|---|---|
| `create_sandbox` | Starts a sandbox: template, region, size, network rules, secrets, or from a snapshot. Optional: tools that need a sandbox start one for you. |
| `list_sandboxes` | Lists your organization's running and paused sandboxes. |
| `list_templates` | Lists the ready-made templates and your own. |
| `run_command` | Runs a shell command and returns the exit code and output. `background: true` starts a server or long job and returns at once. |
| `get_command` | Reads a background command's new output, or the result of one that was waiting for approval. |
| `stop_command` | Stops a running command. |
| `run_code` | Runs Python in a notebook-style kernel. Variables persist between calls, and charts come back as images. |
| `read_file`, `write_file`, `list_files` | Files in the sandbox. Relative paths are in `/home/sandbox`. |
| `expose_port` | Gives a web server in the sandbox a readable address, private (a short share link) or public, with an optional expiry such as `"1h"`. |
| `snapshot_sandbox`, `rewind_sandbox` | Saves the sandbox's files, or puts them back as a snapshot had them. |
| `resize_sandbox` | Gives the sandbox more or fewer vCPUs and memory, with its files kept. |
| `sandbox_report` | "What did the agent do?": a plain summary of what happened in a sandbox. |
| `pause_sandbox`, `resume_sandbox` | Freezes the sandbox (paused time isn't billed) and picks up again. |
| `destroy_sandbox` | Deletes it. |

The tools work on the current sandbox unless the agent names one with `sandboxId`, so an agent can juggle several.

## Approvals don't block the agent

When an [approval rule](https://www.quietrobot.ai/docs/sandboxes/approvals) holds a command, `run_command` answers right away that it is waiting for a person, with its execution id. The agent can carry on with other work and check back with `get_command`. You approve or deny it in the dashboard under **Approvals**, or from the approval email. A denied command comes back as denied, and the agent is told not to retry it.

## Settings

For the local server, set these in the `env` block:

| Variable | Default | |
|---|---|---|
| `QR_API_KEY` | | Required. |
| `QR_BASE_URL` | `https://api.quietrobot.ai` | Only for a self-hosted or test service. |
| `QR_MCP_TIMEOUT_SEC` | `1800` | Lifetime of sandboxes the server starts, in seconds. Your plan sets the maximum. |
| `QR_MCP_KEEP` | | `1` keeps the sandboxes the server started when the client exits. By default they are destroyed. |

Use a [read-only key](https://www.quietrobot.ai/docs/sandboxes/authentication) if the agent should only look at sandboxes, never start or change them.

## In your own server

The package also exports the server, so you can add the tools to an MCP server of your own or run it over another transport:

```ts
import { createServer } from "@quietrobot/sandboxes-mcp";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = createServer({ defaults: { template: "base", egress: { mode: "allowlist", allow: ["github.com"] } } });
await server.connect(new StdioServerTransport());
```

## When something goes wrong

* **The app can't sign in** (hosted): only owners and admins can allow an app. Ask one to add it, or use an API key header.

* **"No API key"**: the client didn't pass `QR_API_KEY`. Check the `env` block, then restart the client.
* **`401 unauthorized`**: the key is wrong, revoked or expired. Create a new one under **API keys**.
* **`402 usage_limit`** or **`403 plan_limit`**: your plan's limit. See [Plans and limits](https://www.quietrobot.ai/docs/sandboxes/plans-and-limits).
* **A command can't reach a site**: new sandboxes can reach the internet unless your organization's default or the sandbox's own rules lock it down. Ask the agent to create the sandbox with the domains it needs allowed, or change the default allow list in the dashboard under **Rules**. See [Outbound network](https://www.quietrobot.ai/docs/sandboxes/network).
* **The client doesn't show the tools**: run `npx -y @quietrobot/sandboxes-mcp` in a terminal. It should wait silently for input; press Ctrl+C to stop it. An error there is the one your client hit.
