> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compute.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Let Cursor, Claude Code, or Codex call Compute through the Model Context Protocol.

Compute has two [MCP](https://modelcontextprotocol.io) servers: a **local stdio** server bundled with the CLI, and a **hosted** Streamable HTTP server at `mcp.compute.cx` for agents that cannot spawn a local process. After install and sign-in (or, for the hosted server, an OAuth connect), an agent can list GPUs, check credit, follow status, and manage secrets; both can dry-run and submit a run: the local server reads the entrypoint file from disk, the hosted server takes the Python source inline.

The Agent Skill at [https://compute.cx/SKILL.md](https://compute.cx/SKILL.md) is the workflow. MCP is the tool surface.

<Warning>
  `compute_run` spends prepaid credit. It requires `confirm_spend=true`. `compute_dry_run` prints the upload plan and creates **no** machine.
</Warning>

## Install the CLI

```bash theme={null}
curl -fsSL https://compute.cx/install.sh | sh
compute setup
compute doctor --json
```

`compute mcp` is not a human command. The host spawns it and speaks JSON-RPC on stdin/stdout.

## Local (stdio)

### Cursor

Project or user `mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "compute": {
      "command": "compute",
      "args": ["mcp"]
    }
  }
}
```

The server reads `COMPUTE_API_KEY` or `~/.compute/config.toml`. After `compute setup`, no extra env is required.

Cursor install link (CLI must already be on `PATH`):

[Add Compute MCP](cursor://anysphere.cursor-deeplink/mcp/install?name=compute\&config=eyJjb21tYW5kIjoiY29tcHV0ZSIsImFyZ3MiOlsibWNwIl19)

### What the local tools do

| Tool                                                           | Spends?       | Notes                                               |
| -------------------------------------------------------------- | ------------- | --------------------------------------------------- |
| `compute_doctor`                                               | No            | Connectivity and sanitized auth                     |
| `compute_list_gpus`                                            | No            | Live SKUs — do not invent names                     |
| `compute_credits` / `compute_credits_add`                      | Checkout only | Top-up minimum \$10; credit lands after the webhook |
| `compute_dry_run`                                              | No            | AST plan only; no upload                            |
| `compute_run`                                                  | Yes           | Requires `confirm_spend=true`                       |
| `compute_get_run` / `compute_get_logs` / `compute_get_receipt` | No            | Inspect                                             |
| `compute_cancel_run`                                           | No            | Idempotent teardown                                 |
| `compute_list_secrets` / `compute_set_secret`                  | No            | Values are never returned                           |
| `compute_report_issue` / `compute_get_report`                  | No            | File a durable report and read its status or reply  |

Do not paste API keys, session tokens, `config.toml`, Checkout session ids, secret values, or signed URLs into the agent chat or a report.

## Hosted (Streamable HTTP)

For cloud/hosted agents (Claude.ai- or ChatGPT-style connectors, background agents) that cannot spawn a local process:

```
https://mcp.compute.cx/mcp
```

No CLI install and no `COMPUTE_API_KEY` — authentication is Clerk OAuth 2.1 with PKCE. A request without a valid token gets a `401` with a `WWW-Authenticate` header pointing at the discovery document:

```bash theme={null}
curl https://mcp.compute.cx/.well-known/oauth-protected-resource/mcp
```

<Note>
  Dynamic Client Registration is enabled. The authorization server at `https://clerk.compute.cx` publishes a `registration_endpoint`, so an MCP host self-registers its client and completes the browser consent; nothing has to be pre-registered. The consent signs in the Compute account whose prepaid credit the runs will spend.
</Note>

Both servers expose the full set of 21 tools, including `compute_report_issue` and `compute_get_report`. The hosted server differs in the input of `compute_dry_run` and `compute_run`: instead of a `project_root`, they take the Python source inline as `files`, an array of `{path, content}` holding the entrypoint and every local module it imports (at most 64 `.py` files, 2 MiB total); third-party packages go in `pip`. The API plans the import closure from those files, so the hosted server never needs the calling agent's disk. `compute_run` still requires `confirm_spend=true`.

## Plugin (skill + MCP)

This docs repository is also an [Agent Plugin](https://agent-plugins.org): `plugin.json`, `mcp.json`, and `skills/compute/SKILL.md`. Import the repo into a [Cursor team marketplace](https://cursor.com/docs/plugins), or submit it at [cursor.com/marketplace/publish](https://cursor.com/marketplace/publish).

The skill is also a raw file:

```bash theme={null}
curl -fsSL https://compute.cx/SKILL.md
curl -fsSL https://compute.cx/.well-known/skills/compute/SKILL.md
```

## Next

[Agent Skill](/get-started/agent-skill) is the spend-aware workflow. [Run](/cli/run) is the flag reference.
