# Connect an agent

The address is the same for every assistant:

```
https://console.boring-cloud.app/mcp
```

It is a remote MCP server (Streamable HTTP). The assistant opens a Boring Cloud page where the person signs in, chooses the workspace and the permissions, and allows access. There is no token to copy.

The console shows this address under **Agent setup**, with a button for the assistants that can be filled in by a link.

## By assistant

| Assistant                 | How                                                                                                                          |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Claude (web and desktop)  | **Agent setup → Add to Claude**, or Claude's settings → Connectors → add a custom connector, and paste the address           |
| ChatGPT                   | turn on Developer mode in ChatGPT's settings, then add an MCP server with the address. Depends on the plan and on its admins |
| GitHub Copilot in VS Code | **Agent setup → Add to VS Code**                                                                                             |
| Cursor                    | **Agent setup → Add to Cursor**                                                                                              |
| Claude Code               | `claude mcp add --transport http boringcloud https://console.boring-cloud.app/mcp`, then `/mcp` to sign in                                    |
| Codex                     | `codex mcp add boringcloud --url https://console.boring-cloud.app/mcp`                                                                        |
| Any other MCP client      | add a remote or HTTP server with the address and OAuth sign-in                                                               |

VS Code, in `.vscode/mcp.json`:

```json
{ "servers": { "boringcloud": { "type": "http", "url": "https://console.boring-cloud.app/mcp" } } }
```

Cursor, in `.cursor/mcp.json`:

```json
{ "mcpServers": { "boringcloud": { "url": "https://console.boring-cloud.app/mcp" } } }
```

## What the connection allows

- One workspace, and only the permissions ticked on the consent page.
- Never more than the person can do. If they lose access to an app or leave the workspace, the agent does too, at once.
- 90 days, then the assistant asks to connect again. The person can end it earlier in **Settings → Agent tokens**.
- An agent cannot open apps, read their data, invite people, see API keys or change the stack.

| Permission         | Allows                             | Tools that need it                                 |
| ------------------ | ---------------------------------- | -------------------------------------------------- |
| `apps:read`        | list apps, read the guide and URLs | `list_apps`, `get_app`, `get_app_url`, `get_guide` |
| `apps:create`      | create apps                        | `create_app`                                       |
| `apps:deploy`      | upload releases, roll back         | `deploy_app`, `rollback_app`                       |
| `apps:share`       | give and remove access             | `share_app`, `revoke_app_access`                   |
| `deployments:read` | read the release history           | `list_deployments`, `deployment_status`            |

If a tool answers `FORBIDDEN` and names a missing permission, the person must connect again and tick it.

## With a token

For machines without a browser, such as CI. Create the token in **Agent setup** and keep it in an environment variable. Never write it in a file that is committed.

Claude Code, in `.mcp.json`:

```json
{
  "mcpServers": {
    "boringcloud": {
      "type": "http",
      "url": "https://console.boring-cloud.app/mcp",
      "headers": { "Authorization": "Bearer ${BORINGCLOUD_TOKEN}" }
    }
  }
}
```

Codex, in `~/.codex/config.toml`:

```toml
[mcp_servers.boringcloud]
url = "https://console.boring-cloud.app/mcp"
bearer_token_env_var = "BORINGCLOUD_TOKEN"
```

Clients that only start local servers can run `boringcloud mcp`, which offers the same tools. See [CLI](https://boring-cloud.app/docs/cli.md).

## For client developers

OAuth 2.1 authorization code with PKCE (S256 only), public clients, no refresh token.

1. `POST /mcp` without a token answers `401` with `WWW-Authenticate: Bearer … resource_metadata="https://console.boring-cloud.app/.well-known/oauth-protected-resource/mcp"` (RFC 9728).
2. The server metadata is at `/.well-known/oauth-authorization-server` (RFC 8414).
3. Register with `POST /oauth/register` (RFC 7591). Redirect addresses must be `https`, a loopback address with any port, or the scheme of a known editor.
4. Send the person to `/oauth/authorize` with `response_type=code`, `client_id`, `redirect_uri`, `code_challenge`, `code_challenge_method=S256`, `state`, and optionally `scope` and `resource=https://console.boring-cloud.app/mcp`.
5. The answer contains `code`, `state` and `iss` (RFC 9207). Exchange the code within 60 seconds at `POST /oauth/token`. A code works once. Using it twice ends the access it gave.
