---
title: "Analytics through MCP - Tracwell docs"
description: "Connect Tracwell analytics to Codex, Claude Code, Cursor, or VS Code through MCP."
canonical: "https://tracwell.app/docs/agents"
markdown: "https://tracwell.app/docs/agents.md"
---

# Connect Tracwell to your agent

Connect an agent to analytics and scoped goal/funnel writes through Tracwell's Streamable HTTP MCP server.

New to Tracwell and MCP? Start with [Ask your analytics from Claude or Cursor](https://tracwell.app/guides/ask-analytics-from-claude-or-cursor) . Working in a terminal or a local coding agent? The [Tracwell CLI](https://tracwell.app/docs/cli) uses the same tools with one-line commands.

## Create a connection

Add `https://tracwell.app/mcp` to an OAuth-capable assistant, sign in to Tracwell, and choose websites and permission. Only workspace owners can approve connections. Manage connections in **Settings → MCP**.

Connection details

- **Transport**

  Streamable HTTP

  **Server URL**

  `https://tracwell.app/mcp`

  **Authorization**

  OAuth sign-in, or `Bearer YOUR_MCP_KEY` for API-key clients

MCP works on every plan, including Free and complimentary access. If a paid plan lapses, the workspace moves to Free and MCP keeps working. When you approve a connection you choose its websites and what it can do; reading analytics is always included. You can revoke connections in Settings → MCP.

## Claude desktop and claude.ai

1. Open [Tracwell in the Claude directory](https://claude.ai/directory/connectors/tracwell) .
2. Select **Connect**. Sign in to Tracwell and choose websites and access.

The connector also works in the Claude mobile apps. On Team and Enterprise plans an owner enables it for the organization first, then each person connects it. If the directory isn't available to you, open **Settings → Connectors**, choose **Add custom connector** and enter `https://tracwell.app/mcp`.

## ChatGPT

1. Open **Settings → Apps & Connectors → Advanced settings** and turn on **Developer mode**.
2. Create a connector. Name it Tracwell, enter `https://tracwell.app/mcp` and choose **OAuth**.
3. Save, then sign in to Tracwell and choose websites and access.
4. In a chat, turn on Tracwell from the tools menu.

Developer mode depends on your ChatGPT plan, and workspace admins can turn it off.

## Codex app

1. Open **Settings → MCP servers** and choose **Add server**.
2. Name it `tracwell`, choose **Streamable HTTP**, enter `https://tracwell.app/mcp` and save.
3. Choose **Authenticate** next to Tracwell, then sign in and choose websites and access.

The Codex app, CLI and IDE extension share this setup.

## Claude Code

Terminal

```bash
claude mcp add --transport http --scope user tracwell https://tracwell.app/mcp
```

Then run /mcp in Claude Code and choose Authenticate.

## Cursor

\~/.cursor/mcp.json

```json
{
  "mcpServers": {
    "tracwell": { "url": "https://tracwell.app/mcp" }
  }
}
```

Cursor asks you to sign in the first time it uses Tracwell.

## Codex CLI

Terminal

```bash
codex mcp add tracwell --url https://tracwell.app/mcp
codex mcp login tracwell
```

The login command opens Tracwell in your browser to approve the connection.

## Amp

Terminal

```bash
amp mcp add tracwell https://tracwell.app/mcp
```

Start Amp and it opens Tracwell in your browser to sign in.

## VS Code

.vscode/mcp.json

```json
{
  "servers": {
    "tracwell": { "type": "http", "url": "https://tracwell.app/mcp" }
  }
}
```

Start the server from the file and sign in when asked.

## Use an API key instead

For CI pipelines and assistants that cannot sign in, create a key in **Settings → MCP → API keys** and send it as a Bearer token. Choose one of three permissions:

Key permissions

- **Read analytics**

  Reads reports for all websites or one website. The default.

  **Read and manage goals / funnels**

  Starts with `tw_rw_`. One website: reads its reports, creates and updates goals and funnels, and adds chart notes.

  **Add chart notes only**

  Starts with `tw_nw_`. One website. Works only with the [notes endpoint](https://tracwell.app/docs/notes) , not MCP.

The same keys can call the [Analytics API](https://tracwell.app/docs/api) from scripts without an assistant.

Keys are secret and rate-limited. Do not put a real key in source control or client-side application code.

Claude Code · Terminal

```bash
claude mcp add --transport http --scope user tracwell \
  https://tracwell.app/mcp \
  --header "Authorization: Bearer YOUR_READ_ONLY_KEY"
```

Codex · \~/.codex/config.toml (set TRACWELL\_MCP\_KEY first)

```toml
[mcp_servers.tracwell]
url = "https://tracwell.app/mcp"
bearer_token_env_var = "TRACWELL_MCP_KEY"
```

Cursor · \~/.cursor/mcp.json

```json
{
  "mcpServers": {
    "tracwell": {
      "url": "https://tracwell.app/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_READ_ONLY_KEY"
      }
    }
  }
}
```

VS Code · .vscode/mcp.json

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "tracwell-mcp-key",
      "description": "Tracwell MCP read-only key",
      "password": true
    }
  ],
  "servers": {
    "tracwell": {
      "type": "http",
      "url": "https://tracwell.app/mcp",
      "headers": {
        "Authorization": "Bearer ${input:tracwell-mcp-key}"
      }
    }
  }
}
```

## Discover, preview, save

Start with `analytics_projects`, discover event names with `analytics_events`, and inspect typed property values with `analytics_event_detail`. Follow pagination cursors to discover every saved definition or observed event name.

Preview a goal or funnel before saving it. Write keys expose only goal/funnel create and update commands. Every write requires a UUID `requestId`; reuse it with identical input after a timeout. Updates require the current `expectedRevision`. Read again after a revision conflict.

Conversion reports explain their denominator, identity and time window. They count anonymous visitors; Private mode estimates visitors daily. Sessions are recorded visits. Report links preserve the website, definition, exact timestamps and timezone.

## Chart notes

Every key can list chart notes with `notes_list`; write keys and write-approved OAuth connections can add one with `note_create`. To mark deploys from CI with a notes-only key, see [Chart notes](https://tracwell.app/docs/notes) .

## Try a question

Example prompts

- Compare visitors and conversion over the last 7 days.
- Which acquisition sources bring the most engaged visits?
- Preview a pricing-to-signup funnel, then save it with my write key.
