---
title: "MCP server: your analytics in Claude, Cursor and other AI assistants"
description: "Connect claude.ai, Claude Desktop, Claude Code, Cursor or any MCP client to DataPocket: sign in with OAuth or use a read-only API key. Setup, the 17 read-only tools, units, limits and how visitor-supplied text is handled."
url: "https://datapocket.vo1d.studio/reference/mcp"
lang: "en"
updated: "2026-11-16"
---

# MCP server: your analytics in Claude, Cursor and other AI assistants

DataPocket runs a remote MCP server at `https://datapocket.vo1d.studio/api/mcp` (Streamable HTTP). On claude.ai, add it as a custom connector with that URL, sign in to DataPocket and choose which websites to share. Clients that send headers can use a read-only API key instead, for example `claude mcp add --transport http datapocket https://datapocket.vo1d.studio/api/mcp --header "Authorization: Bearer dpk_…"`. The assistant gets 17 read-only tools over the same data and rules as the read API.

## Connect from claude.ai (sign in, no key)

1. On claude.ai (or Claude Desktop), open Settings → Connectors and choose Add custom connector.
2. Enter the URL `https://datapocket.vo1d.studio/api/mcp` and add it. Leave the OAuth client fields empty.
3. Click Connect. DataPocket opens: sign in, tick the websites the assistant may read, and choose Allow.

The connection is read-only and limited to the websites you ticked. Your current membership and role are still checked on every call, so leaving a website ends its access. See and disconnect connected apps under Account → Connected apps; changing your password disconnects them all. Other MCP clients that support OAuth (dynamic client registration or client ID metadata documents, PKCE) connect the same way.

## Connect with an API key

1. In your website's Settings, under API keys, create a key with Read-only access. A site key (`dpk_…`) reads that site; an account token (`dpt_…`) reads every site you're a member of.
2. Add the server to your assistant with the key in the `Authorization` header (below).
3. Ask a question, such as "Which campaigns brought paying customers last month?". The assistant picks the tools.

Claude Code:

```bash
claude mcp add --transport http datapocket https://datapocket.vo1d.studio/api/mcp \
  --header "Authorization: Bearer dpk_…"
```

Cursor (`~/.cursor/mcp.json`), Claude Desktop and other clients that take a JSON config with remote servers:

```json
{
  "mcpServers": {
    "datapocket": {
      "type": "http",
      "url": "https://datapocket.vo1d.studio/api/mcp",
      "headers": {
        "Authorization": "Bearer dpk_…"
      }
    }
  }
}
```

Keep the key out of shared config files: most clients can read it from an environment variable.

## Tools

Every tool is read-only. Site tools take an optional `site_id` (from `list_sites`): required with an account token, optional with a site key. Tools over a period take `period` (or `from`/`to`) and `filters`, an array of `{dim, op, values}` objects with the read API's dimensions and operators.

| Tool | Returns | Read API equivalent |
|---|---|---|
| `list_sites` | Sites the key can read. | `/api/v1/sites` |
| `get_site` | Name, domain, timezone, currency, your role. | `/api/v1/site` |
| `get_overview` | Headline KPIs with the previous period. | `/stats/overview` |
| `get_timeseries` | KPIs per bucket (`granularity`). | `/stats/timeseries` |
| `get_breakdown` | Top values of one dimension (`dim`, `sort`, `search`, `limit`). | `/stats/breakdown` |
| `get_goals` | Goals with visitors, completions, conversion rate. | `/stats/goals` |
| `get_goal_properties` | A goal's property keys and top values. | `/stats/goal-properties` |
| `list_funnels` | Saved funnels and their steps. | `/stats/funnels` |
| `get_funnel` | Visitors at each step of one funnel. | `/stats/funnels/{id}` |
| `list_visitors` | Visitors in the period with identity when known. | `/stats/visitors` |
| `get_goal_journeys` | Who completed a goal and how long it took. | `/stats/journeys` |
| `get_goal_users` | Visitors who completed the most goals. | `/stats/goal-users` |
| `get_exit_links` | Outbound links clicked. | `/stats/exit-links` |
| `get_bot_traffic` | Crawler hits by category, top providers and pages. | `/stats/bots` |
| `get_realtime` | Visitors in the last 5 minutes and the latest events. | `/stats/realtime` |
| `list_annotations` | Chart notes and uptime outages. | `/annotations` |
| `get_insights` | The latest insights report. Never starts an analysis. | `/insights` |

Results come as JSON text and as `structuredContent`. Unlike the read API, money fields (`revenue`, `refunds`, `spent`…) are converted to major units of the site's currency, and results say so with `currency` and `money_unit: "major"`.

## Visitor-supplied text

Page paths, referrers, UTM values, goal names and properties, link targets, visitor names and emails, annotation text and the `subjects` of insight findings come from browsers and API calls, so anyone can put any text in them, including text written to steer an AI. The server tells the assistant, in its instructions and in each tool's description, to treat those fields as data and never as instructions. Values are returned as they were stored (with invisible and control characters already removed at ingest), never rewritten. The tools can't change anything, so the worst a planted instruction can do is mislead an answer: check surprising claims in the dashboard.

## Access, limits and errors

- Same keys and rules as the read API: your current membership and role are checked on every tool call, and a key you revoke stops working at once. OAuth connections work only here, not on the REST API, and only for the websites you approved; their access tokens last an hour and are refreshed automatically.
- Tool calls share the read API's per-key rate limit. One request carries at most 10 tool calls.
- Results are capped at about 50,000 characters; when a list is shortened, `truncated` names it with how many items were kept. Narrow the period, add filters or lower `limit` for the rest.
- Missing or invalid credentials are HTTP 401 with a `WWW-Authenticate: Bearer` challenge pointing at the OAuth metadata (`resource_metadata`), which is how OAuth clients discover sign-in. A site you can't read, a bad argument or a failed query comes back as a tool error the assistant can read and correct.
- The server is stateless and answers in JSON (protocol versions 2025-11-25, 2025-06-18 and 2025-03-26). It offers no SSE stream, resources or prompts.

## Questions

### Can the assistant change my data?

No. Every tool reads, none writes, and a read-only key couldn't write even if one did.

### Does it work with claude.ai web connectors?

Yes. Add a custom connector with the server URL, sign in to DataPocket and choose the websites to share. No API key needed.

### Which websites can a claude.ai connection read?

Only the ones you ticked when you connected, and only while you're still a member. To change the selection, disconnect it under Account → Connected apps and connect again.

### Which key should I use?

A read-only site key for one website. An account token if you want the assistant to compare several of your sites.

## Related

- [Read API: stats, visitors, funnels and insights](https://datapocket.vo1d.studio/reference/read-api)
- [REST API: payments and goals](https://datapocket.vo1d.studio/reference/rest-api)
- [AI crawler tracking](https://datapocket.vo1d.studio/docs/ai-bots)
- [All reference](https://datapocket.vo1d.studio/reference)
