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

# MCP Server

> Connect Cursor, Claude Code or Claude Desktop to the Commet MCP server and manage billing with a tool for every API operation.

## What is an MCP Server?

MCP is an open protocol that standardizes how applications provide context to LLMs. Among other benefits, it provides LLMs tools to act on your behalf.

## What can Commet's MCP Server do?

Commet's MCP server gives your AI agent native access to the full Commet platform through a single integration. You can manage all aspects of your billing infrastructure using natural language.

* **Organization** — See the live or sandbox organization fixed to the connection
* **Commet API** — Use every operation in the current public OpenAPI document
* **Docs** — Search the live Commet documentation

As an example, you could use this to create a full billing setup, manage plans and features, inspect customer subscriptions, or review invoices and usage data.

## Prerequisites

The MCP endpoint is the same for sandbox and live data:

```
https://commet.co/mcp/v2
```

OAuth opens Commet in the browser and asks you to choose one organization for the connection. The connection stays fixed to that organization even if you later switch organizations in the dashboard; reconnect to choose another one. API key authentication uses the exact sandbox or live organization that created the key. OAuth currently exposes the same API tools to owners, admins, and members.

To use it, you'll need to:

* [Create a Commet account](https://commet.co)
* Have an MCP-compatible client (Cursor, Claude Code, Claude Desktop, etc.)

> [!NOTE]
>
> Browser-based clients can use OAuth with no API key. If your client runs in CI, on a server, or anywhere browser login is not possible, pass a Commet API key in the `x-api-key` header.

> [!WARNING]
>
> Switch to a sandbox organization when experimenting or setting up billing for the first time. Operations on a live organization affect real customers immediately.

## How to use the MCP Server

Choose your preferred client below.

**Cursor**

Open the command palette and choose "Cursor Settings" > "MCP" > "Add new global MCP server".

```json theme={null}
{
  "mcpServers": {
    "commet": {
      "url": "https://commet.co/mcp/v2"
    }
  }
}
```

**Claude Code**

```bash theme={null}
claude mcp add --transport http commet https://commet.co/mcp/v2
```

**Claude Desktop**

Open Claude Desktop settings > "Developer" tab > "Edit Config".

```json theme={null}
{
  "mcpServers": {
    "commet": {
      "url": "https://commet.co/mcp/v2"
    }
  }
}
```

**Codex**

```bash theme={null}
codex mcp add commet --url https://commet.co/mcp/v2
```

The command opens the browser for OAuth authentication. Once complete, verify with:

```bash theme={null}
codex mcp list
```

**Copilot**

Add the following to your VS Code `settings.json`:

```json theme={null}
{
  "mcp": {
    "servers": {
      "commet": {
        "type": "http",
        "url": "https://commet.co/mcp/v2"
      }
    }
  }
}
```

**Gemini**

Add the following to `~/.gemini/settings.json`:

```json theme={null}
{
  "mcpServers": {
    "commet": {
      "httpUrl": "https://commet.co/mcp/v2"
    }
  }
}
```

**OpenCode**

Add the following to `opencode.json`:

```json theme={null}
{
  "mcp": {
    "commet": {
      "type": "remote",
      "url": "https://commet.co/mcp/v2"
    }
  }
}
```

**Windsurf**

```json theme={null}
{
  "mcpServers": {
    "commet": {
      "serverUrl": "https://commet.co/mcp/v2"
    }
  }
}
```

### API key authentication

For clients that cannot open browser login, add an `x-api-key` header:

```bash theme={null}
claude mcp add --transport http commet https://commet.co/mcp/v2 --header "x-api-key: ck_xxxxxxxxx"
```

For JSON-based clients:

```json theme={null}
{
  "mcpServers": {
    "commet": {
      "url": "https://commet.co/mcp/v2",
      "headers": {
        "x-api-key": "ck_xxxxxxxxx"
      }
    }
  }
}
```

API-key sessions authenticate as the user who created the key and use the exact organization that created the key. A sandbox key can only act on its sandbox organization; a live key can only act on its live organization. Create the key from a sandbox organization when experimenting.

## Available Tools

MCP v2 exposes one generated tool for every operation in the current Commet OpenAPI document. The generated names use `api_` plus the operation ID in snake case:

```text theme={null}
list-plans   → api_list_plans
create-plan  → api_create_plan
track-usage  → api_track_usage
```

Each generated tool groups its input the same way:

* `path` for URL parameters
* `query` for filters, cursors, and pagination
* `body` for the endpoint's exact OpenAPI request body
* `idempotencyKey` for optional POST, PUT, and PATCH idempotency

Generated tools always execute the latest API version published by Commet. They do not read or change an older API version pinned for the organization's SDKs.

The following Commet-specific tools remain available:

| Tool | Description |
| - | - |
| `get_current_organization` | Get the organization used by API tools |
| `search_docs` | Search the live Commet documentation by semantic query |

The previous endpoint, `https://commet.co/mcp`, is retired. It no longer exposes tools: it tells the connected agent to reconnect at `https://commet.co/mcp/v2`. Replace the URL in your client configuration and sign in again.

> [!WARNING]
>
> Before calling a write or delete tool, check `get_current_organization`. Operations on a live organization affect real customers and money immediately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.