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

# Claude Desktop

> Install the Cometly MCP server in Claude Desktop and ask Claude about your marketing data in plain English.

<Tip>
  **Claude web also works out of the box.** If you prefer to use Cometly in the [claude.ai](https://claude.ai) web interface or mobile app, add the connector there instead — `claude.ai` and `claude.com` work out of the box. The steps are the same: paste the MCP endpoint URL and approve access on first use.
</Tip>

## Prerequisites

* A Cometly workspace and a Space you have **Use Public API** permission in.
* Claude Desktop (latest — MCP support is in all current builds).
* Your numeric **Space ID** — copy it from the **ID** row at the bottom of the dashboard sidebar, or from [**Space Settings**](https://app.cometly.com/space/settings) → **Space Details**. See [Finding your Space ID](/mcp/overview#finding-your-space-id) for step-by-step instructions.

## Add the server

In Claude Desktop, open **Settings → Connectors** (or **Settings → MCP** depending on your build).

Click **Add custom connector** and fill in:

| Field | Value                                            |
| ----- | ------------------------------------------------ |
| Name  | `Cometly`                                        |
| URL   | The endpoint below, with your Space ID filled in |

Copy the endpoint URL and replace `{your-space-id}` with your numeric Space ID:

```text theme={null}
https://app.cometly.com/mcp/{your-space-id}/public-api
```

Click **Save**.

Or, if you'd rather edit the config file directly, open the Claude Desktop config:

* **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

…and add:

```json theme={null}
{
  "mcpServers": {
    "cometly": {
      "type": "http",
      "url": "https://app.cometly.com/mcp/42/public-api"
    }
  }
}
```

Replace `42` with your Space ID, save, and restart Claude Desktop.

## Authorize

The first time Claude tries to call a Cometly tool, it'll open your browser to the Cometly authorization page. Log in, confirm the Space, and click **Approve**.

You'll see a green dot next to `Cometly` in the connectors list once the handshake succeeds.

## Verify

Open a new chat and ask:

> Using the Cometly connector, list my conversion events from the last 7 days.

You should see Claude call the `list_events` tool and respond with real data. The first response is sometimes a little slower (cold connection); subsequent calls are fast.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Claude Desktop doesn't see the server">
    Make sure you fully quit and reopened Claude Desktop after editing `claude_desktop_config.json` — it only reads the config at startup.
  </Accordion>

  <Accordion title="OAuth window doesn't open">
    Older Claude Desktop builds occasionally swallow the OAuth URL. Re-add the connector via the **Connectors** UI instead of the config file; the UI flow is more reliable.
  </Accordion>

  <Accordion title="401 / 403 on every call">
    Your access token is missing or wrong. Remove the connector, restart Claude Desktop, and add it back — you'll re-walk the OAuth flow.
  </Accordion>
</AccordionGroup>

## What you can ask

* *"Show me purchases attributed to Facebook over the last 14 days with linear attribution."*
* *"Compare CPA between Google and Meta this month vs last month."*
* *"Find every contact created this week where Customer Plan is Premium."*
* *"Pull a full journey for contact 8231 and summarize it."*

Claude will pick the right tool ([`query_ad_metrics`](/mcp/tools/query-ad-metrics), [`list_events`](/mcp/tools/list-events), [`list_contacts`](/mcp/tools/list-contacts), [`get_contact`](/mcp/tools/get-contact)…) automatically and refer to your custom fields by their configured labels in its response.
