> ## 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.

# Cursor

> Add the Cometly MCP server to Cursor and ask questions about your marketing data right from the chat sidebar.

## Prerequisites

* A Cometly workspace and a Space you are a member of.
* Cursor 0.42 or newer (any version with MCP support).

## Add the server

Open Cursor's settings (`Cmd + ,` on macOS, `Ctrl + ,` on Windows / Linux), search for **MCP**, and click **+ Add new MCP server**. Set:

| Field | Value |
| - | - |
| Name | `cometly` |
| Type | `HTTP` |
| URL | `https://app.cometly.com/mcp` |

Click **Save**.

Or, if you'd rather edit the config file directly, open `~/.cursor/mcp.json` and add:

```json theme={null}
{
  "mcpServers": {
    "cometly": {
      "url": "https://app.cometly.com/mcp"
    }
  }
}
```

## Authorize

The first time Cursor tries to talk to the server, it'll open your browser to the Cometly authorization page. Log in, choose which Spaces to grant (all of yours or specific ones, with a default), and click **Approve**. Cursor takes over from there and saves the token automatically.

## Verify

Back in Cursor, open the chat sidebar and type:

```
Using the cometly MCP server, list my conversion events from the last 7 days.
```

You should see a tool indicator pop up (`list_events`), then a response with real data from your Space. If you see `401 Unauthorized`, your token expired — just send the message again and Cursor will re-walk the OAuth flow.

## Troubleshooting

> [accordion] Cursor says 'failed to connect'
>
> Confirm the URL is `https://app.cometly.com/mcp` (no trailing slash). Cursor caches a failed handshake for a minute or so — wait and try again.

> [accordion] Every call answers with an authorization error
>
> You're using an older `/mcp/{space_id}/public-api` URL and the token was approved for a different Space. Switch the URL to `https://app.cometly.com/mcp`, or open `~/.cursor/mcp.json`, delete the cometly entry, restart Cursor, and re-add the server. Cursor will walk the OAuth flow again and you can include the right Space.

> [accordion] The model invents tools or parameters
>
> Make sure Cursor is using the latest Claude or GPT model. Some smaller models hallucinate MCP tool names — bigger frontier models read the input schema and follow it.

## What you can ask

* *"Show me my top 10 ad sets by ROAS for the last 30 days."*
* *"List purchases from contacts where Customer Plan is Premium this month."*
* *"What was my CPA on Meta last week vs the week before?"*
* *"Look up contact 12345 and tell me their full journey."*

Cursor will pick the right tool ([`query_ad_metrics`](https://docs.cometly.com/mcp/tools/query-ad-metrics), [`list_events`](https://docs.cometly.com/mcp/tools/list-events), [`get_contact`](https://docs.cometly.com/mcp/tools/get-contact)…) automatically. You don't have to name the tool.


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