# Connect Claude or ChatGPT

Give Claude, ChatGPT and other assistants sandboxes that keep running after the chat ends.

## Server URL

```text
https://www.sandcovery.com/api/mcp
```

## Claude

Claude on the web and Claude Desktop connect to Sandcovery as a custom connector. On a Free, Pro, or Max plan, open **Customize** > **Connectors**, select **Add**, then **Add custom connector**, and paste these two values:

```text title="Name"
Sandcovery
```

```text title="Remote MCP server URL"
https://www.sandcovery.com/api/mcp
```

Select **Continue**, keep the sign-in settings Claude marks **Detected**, and select **Add**. Then select **Connect**, sign in to Sandcovery, and choose your organization.

The Free plan holds one custom connector. On a Team or Enterprise plan, an Owner adds the connector under **Organization settings** > **Connectors** (**Add**, then **Custom**, then **Web**) with the same values, and each member selects **Connect** on it under **Customize** > **Connectors**.

## ChatGPT

1. In ChatGPT, open **Settings**, then **Apps**, and add a new app.
2. Name it Sandcovery, paste the server URL, and choose OAuth sign-in.
3. Sign in to Sandcovery and choose your organization.

## With an API key

Any assistant that lets you set a header can use a Sandcovery [API key](/docs/keys) instead of signing in. Send it as `Authorization: Bearer <key>`. For Claude Code:

```bash
claude mcp add --transport http sandcovery https://www.sandcovery.com/api/mcp --header "Authorization: Bearer $SANDCOVERY_API_KEY"
```

The assistant then reaches what the key reaches, within the key's spend limit and allowed providers.

## What the assistant reaches

When you sign in, you choose one of your organizations on the sign-in screen. The assistant then acts as you in that organization, with your role there, and lists only the tools your role can use. To switch organizations, disconnect Sandcovery in the assistant and connect it again.

An assistant connected with a key lists only the tools that key can call, so a management key sees no sandbox tools.

An organization admin, or a management key, can read the organization's usage totals and billing, including the credit balance, through two read-only tools:

- Get Usage Totals (`getUsageTotals`): the organization's usage totals.
- Get Billing (`getBilling`): the plan, prices and credit balance.

API keys, apps, provider credentials and billing changes stay on the Sandcovery website.

## Tools

- `getPricing` (Get Pricing, Everyone): Reads the Pro and Enterprise prices from Stripe and the terms of a credit purchase. Each price is null while its plan is not on sale or billing is not set up.
- `estimateMonthlyCost` (Estimate Monthly Cost, Everyone): Prices one size on every provider Sandcovery routes to that runs `os`, from the current rate cards, for a sandbox that runs `hours_per_day` hours on every day of an average month of 365/12 days. It counts list prices alone, before any discount or free allowance, and creates nothing.
- `createSandbox` (Create a Sandbox, API Keys and Members): Needs an API key or a signed-in session. A session creates under the API key it names in `api_key_id`, with that key's limits and as that key, or with no key when it is an organization admin's. A member's session without a key, or naming a key not made for them, receives 403, and a key that is not a live API key of the organization answers 404. Routes the spec to the best candidate provider that has your stored credential, and falls back in order when a create fails with `capacity`, `quota`, `server_error`, or `timeout` and `allow_fallbacks` is not false. Every attempt is listed in `attempts`. A provider that refuses the create answers 502 `provider_error` naming it. Sandcovery destroys the sandbox at `expires_at` even when the client is gone.
- `estimateCost` (Estimate Cost, API Keys and Members): Prices a spec at each provider a create with the same caller, key and body would try, in the order it would try them, from the current rate cards, without creating anything. It plans as a create does: with the providers the organization has stored a key for, the free or sponsored vCPUh when they cover the spec, and the providers the organization can pay for on credits. A session that names a key in `api_key_id` plans as that key, under its maximum TTL and allowed providers. A session with no key plans as the organization. That includes a member who isn't an admin, though that member's create must name a key. Whenever a create's planning would refuse the spec, the estimate answers the same status and message instead of an empty list: 422 `unsupported` naming the sizes that fit, or 503 `no_provider_available` with empty `attempts`, such as when no provider key is stored, the key's allowed providers or `provider` leave none, the provider it names is coming soon, fewer free or sponsored vCPUh are left than the sandbox needs over its full TTL, or its full-TTL cost on credits is more than the credit balance. It never charges a card, tops up credits, or holds anything, so a create can still refuse when it reserves, such as at the concurrency or spend limit.
- `listSandboxes` (List Sandboxes, API Keys and Members): Lists sandboxes, newest first. An API key sees the sandboxes it created, and a session sees the whole organization.
- `getSandbox` (Get a Sandbox, API Keys and Members): Reads one sandbox.
- `destroySandbox` (Destroy a Sandbox, API Keys and Members): Destroys the sandbox at its provider and returns it. Destroying a destroyed sandbox returns it unchanged.
- `pauseSandbox` (Pause a Sandbox, API Keys and Members): Pauses a running sandbox, keeping its memory and filesystem where the provider can. The TTL keeps counting. A provider that cannot pause answers 422 `unsupported`.
- `resumeSandbox` (Resume a Sandbox, API Keys and Members): Resumes a paused sandbox. A provider that cannot pause answers 422 `unsupported`.
- `snapshotSandbox` (Snapshot a Sandbox, API Keys and Members): Saves the sandbox filesystem as a snapshot that `snapshot_id` can start a new sandbox from. A provider that cannot snapshot answers 422 `unsupported`. A sandbox on free vCPUh or credits takes no snapshot.
- `listSnapshots` (List Snapshots, API Keys and Members): Lists the organization's snapshots, newest first, whichever key or person took them. Each can start a sandbox through `snapshot_id`.
- `execSandbox` (Run a Command, API Keys and Members): Runs a command to its end and returns its exit code and buffered output. A non-zero exit code is a successful answer. An option the sandbox's provider cannot serve, such as a `timeout_seconds` past its longest command, answers 422 `unsupported` naming it, without running the command.
- `detachExecSandbox` (Start a Detached Command, API Keys and Members): Starts a command and answers once the provider reports it started, leaving it running in the background until it exits or the sandbox ends. Its output is not kept, so a command that must be checked writes to a file. A provider with no detached commands, or one that refuses this command, answers 422 `unsupported`.
- `listFiles` (List Files, API Keys and Members): Lists the entries of a directory. A provider with no file calls answers 422 `unsupported`.
- `downloadFile` (Download a File, API Keys and Members): Answers the bytes of a file. A provider with no file calls answers 422 `unsupported`.
- `uploadFile` (Upload a File, API Keys and Members): Writes the request body to a file, creating parent directories and replacing an existing file. The body is at most 100 MiB, and a larger one answers 413 `body_too_large`. A provider with no file calls answers 422 `unsupported`, and so does a body past the largest file Sandcovery writes to the sandbox's provider, naming that limit before the provider is called.
- `getPortPreview` (Get a Port Preview URL, API Keys and Members): Answers the provider's URL for a port inside the sandbox. The URL comes from the sandbox's provider, so its shape differs between providers. A provider with no port preview URLs answers 422 `unsupported`.
- `listAgentPresets` (List Agent Presets, API Keys and Members): Lists the open-source agents Sandcovery installs in an always-on sandbox, with each agent's own setup.
- `listAgents` (List Agents, API Keys and Members): Lists agents, newest first. An API key sees the agents it created, and a session sees the whole organization's.
- `getAgent` (Get an Agent, API Keys and Members): Reads one agent. With web=link it also carries a fresh link to the agent's web app once that is up, so a page waiting for the agent to start opens it without a second request.
- `stopAgent` (Stop an Agent, API Keys and Members): Destroys the agent's sandbox and ends its renewals. A start boots it again in a new sandbox, without the state the destroyed sandbox held, so the agent waits in `setup` again.
- `startAgent` (Start an Agent, API Keys and Members): Boots a stopped or failed agent in a fresh sandbox, destroying the sandbox a failed start left, taking a Hosted Agent slot again for a Hosted Agent whose slot ended, and checks an agent in `setup` again, running it once its own setup is done. Any other agent answers 409. Before it changes the agent, Sandcovery refuses with 403 or 422, as on a create, when the API key that created the agent, or the agent's routing, can no longer give its sandbox the life an agent needs, and with 403 when that key or the person who created the agent can no longer act for it.
- `restartAgent` (Restart an Agent, API Keys and Members): Stops the agent and starts it again in the same sandbox, keeping its state. An agent with no sandbox, or one that is starting or renewing, answers 409. Sandcovery refuses with 403 or 422, as on a create, when the API key that created the agent, or the agent's routing, can no longer give its sandbox the life an agent needs, and with 403 when that key or the person who created the agent can no longer act for it.
- `getAgentLogs` (Read an Agent's Logs, API Keys and Members): Reads the end of the agent's log file in its current sandbox. An agent with no running sandbox answers 409.
- `listActivity` (List Activity, API Keys and Members): Lists the activity log, newest first. An API key sees its own sandboxes, and a session sees the whole organization.
- `getUsageTotals` (Get Usage Totals, Admins and Management Keys): Estimated list-price cost and resource time of the current UTC day, ISO week, and UTC month, and of every sandbox run, from the start of each window to the moment of the call.
- `getSharedUsage` (Get Shared Usage, Everyone): Reads the figures a usage share shows, by its token. An unknown or revoked token answers 404.
- `getStats` (Get Stats, Every Key and Member): The organization's level, streak, records, and badges, read from every sandbox it started.
- `getStatsUnit` (Get a Stats Unit, Every Key and Member): One started sandbox of the organization in full, by where it stands in the stats server. A position past the last started sandbox answers 404.
- `getSharedStats` (Get Shared Stats, Everyone): Reads the stats of the organization that shared them, by the token of its link. An unknown or revoked token answers 404.
- `getLeaderboard` (Get the Leaderboard, Everyone): Organizations whose stats are public, the most vCPU-seconds first, each with its public link. An organization leaves the list as soon as its stats stop being public.
- `getBilling` (Get Billing, Admins and Management Keys): Reads the plan, the Pro and Enterprise prices, whether a GitHub Enterprise owns a connected GitHub account, the credit balance, whether credits are on sale, and auto top-up. Answers 404 while billing is not set up.
- `listCiJobs` (List CI Jobs, API Keys and Members): Lists the organization's CI jobs, newest first: each GitHub Actions job that asked for a Sandcovery runner label in a repository of a linked GitHub installation.
- `getCiJob` (Get a CI Job, API Keys and Members): Reads one CI job.
- `listCiProviders` (List CI Providers, API Keys and Members): Lists every provider the organization can run CI jobs on right now, on its own provider account, on its free or sponsored vCPUh, or on Sandcovery capacity paid from credits, with how a job treats each one. It applies a job's routing gates: only providers the linked installations' API keys allow, and credit providers only while the credit balance is above zero. With several installations it lists every provider any of their keys allows. A Free plan organization, whose jobs CI refuses, gets an empty list. A job asks for a size, not a provider: it tries ready providers first and falls back to the others only when no ready provider takes it.
- `listCiAccounts` (List Linked CI Accounts, API Keys and Members): Lists the names of the GitHub organizations and personal accounts linked to Sandcovery CI, oldest link first, so every member can see whether CI is set up. Admins read the full links under CI installations.
- `listProviders` (List Providers, Everyone): The public provider board: status, uptime, create latency, prices, and features of each provider. With `os`, it lists only providers whose sandboxes run that operating system.
- `getProvider` (Get a Provider, Everyone): One provider on the public provider board. A provider that is coming soon answers 404 with a message that says so, and its facts are in the catalog.
- `listCatalog` (List the Provider Catalog, Everyone): The sandbox provider catalog: every provider Sandcovery routes to and every provider coming soon, each with what Sandcovery measured and with the prices, limits, capabilities, operating systems, regions, and policy its public pages state, every fact beside the page it was read from. With `os`, it lists only providers that run that operating system for sandboxes or for CI runners.
