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

> ## Agent Instructions
> CrispStats is a hosted, privacy-first analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing and no data import except a site's history from a Plausible export (Settings, Import and export). Websites use the script. iOS, Android, React Native and Flutter use the mobile SDKs in the install guides. Those SDKs are source files, not a published package, and they do not read an advertising id.
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> The script tag is the main install; the npm package @crispstats/tracker does the same from code, never alongside the tag. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Connect Claude, ChatGPT or Cursor by signing in

> Add the CrispStats MCP server to Claude, ChatGPT or Cursor with only its URL. The app opens CrispStats in your browser, and one connection reaches every workspace you belong to, never above your role. No API key is copied anywhere.

Most MCP clients can connect to `https://crispstats.com/api/mcp` by signing in, the same way you sign in to other apps with your account. You add the server URL, the client opens CrispStats in your browser, and you allow the app. One connection reaches every workspace you belong to and can do what you can do in the dashboard, never more than your role in each workspace allows. There is no key to copy, store or rotate.

If your client cannot sign in, or you want a key you control from a script, for one workspace and only the permissions you tick, use an API key instead: see [connect AI assistants](https://docs.crispstats.com/ai/connect-ai-assistants.md).

## How it works

**1. Add the server URL**

In your client, add a remote MCP server with the URL `https://crispstats.com/api/mcp` and no headers.

**2. Sign in when the browser opens**

The client opens a CrispStats page. Sign in if you are not already. Anyone in a workspace can connect an app; you need to be in at least one.

**3. Review what it can do**

The page names the app and its client ID. Anyone can register an app, so allow it only if you started connecting from that app yourself.

The list says what the app can do, one short line each, all of it allowed, on all your workspaces and sites. It scrolls: the button under it is grey and says **Review all** until you reach the end of the list (selecting it takes you there), then becomes **Allow**. Every line holds only where your role allows it: where you are a viewer, the app only reads.

At the top of the list, choose **Read only** or **Read and write**. Read only lets the app read every report, visitor details, your people and your plan, and change nothing. Read and write is chosen at first.

Read and write includes everything: deleting sites, managing people and API keys too. To keep the app from changing anything, choose Read only.

Select **Allow**, or **Cancel** to send the app away with nothing.

**4. Ask away**

The browser goes back to the app. It can now read your reports across every workspace and, after showing you a preview, make the changes you ask for. See [MCP workspace tools](https://docs.crispstats.com/mcp/tools.md) for every tool and the role each needs.

## Each client

> [tab] Claude
>
> In claude.ai, open **Customize**, **Connectors**, select **Add** and **Add custom connector**, and enter `https://crispstats.com/api/mcp` as the remote MCP server URL. Leave the request headers empty. Claude opens CrispStats to sign in when you connect.
>
> Claude Desktop and the mobile apps use the same connector.
>
> In Claude Code, add the server without a header, then sign in from `/mcp`:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> claude mcp add --transport http --scope user crispstats https://crispstats.com/api/mcp
> ```
>
> Start a session, run `/mcp`, pick `crispstats` and choose to authenticate. Your browser opens the CrispStats page.

> [tab] ChatGPT
>
> Custom connectors in ChatGPT need a plan and settings that allow them, and the place they live has moved between releases. In the connector settings, create a connector with:
>
> | Field | Value |
> | - | - |
> | Name | `CrispStats` |
> | MCP server URL | `https://crispstats.com/api/mcp` |
> | Authentication | OAuth |
>
> ChatGPT registers itself with CrispStats and opens the sign-in page. ChatGPT shows the answers as text and tables; it does not draw CrispStats charts.

> [tab] Cursor
>
> Add the server to `~/.cursor/mcp.json` with only its URL:
>
> ```json ~/.cursor/mcp.json theme={"theme":{"light":"github-light","dark":"github-dark"}}
> {
>   "mcpServers": {
>     "crispstats": {
>       "url": "https://crispstats.com/api/mcp"
>     }
>   }
> }
> ```
>
> Open **Cursor Settings**, **MCP**. `crispstats` shows that it needs a login; select it and sign in in the browser that opens.

## What the app gets

* Every workspace you belong to, and every site you can open in each, including workspaces and sites added later. Each call is about one workspace: a site's tools use the site's workspace, and workspace tools take a `workspace` id from `list_workspaces`, which can be left out when you are in one workspace.
* What you can do in the dashboard, never more than your role in each workspace allows. Where you are a viewer it only reads; members change goals, funnels, notes, alerts, e-mail reports, uptime monitors and errors; owners and admins also change sites, sharing, channels, people and API keys. Some tools need the owner.
* Every change is previewed first. The app makes it only when it calls the tool again with `confirm: true`, after you agree.
* Five permissions no API key can hold: deleting sites, managing people, uptime monitors, error status and billing (read only: nothing here changes a plan or charges a card).
* An access token that lasts one hour and a refresh token the app uses to get a new one. The refresh token lasts 60 days from its last use, so an app you use keeps working and one you stop using signs out on its own.
* Nothing else: not your password, not the secrets of your existing API keys, not your card details.

Rate limits are the same as for API keys, counted per connected app.

## See and disconnect apps

Every app you allowed is listed under **API and MCP**, **Connected apps**, with the address it sends you back to, **Every workspace**, what it may do, when you allowed it and when it was last used. **Disconnect** ends it at once: its tokens stop working on the next request.

What the app reaches follows your membership on every call. Leave a workspace, or have it deleted, and the app no longer reaches it; get a new role or other sites there, and the app follows. The app stops working once you are in no workspace at all.

Apps connected before 3 December 2026 keep what they had: one workspace, read only, disconnected when you leave it or stop being an owner or admin of it. Connect the app again for the access described here.

## For client developers

CrispStats follows the MCP authorization spec:

| | |
| - | - |
| Protected resource metadata | `https://crispstats.com/.well-known/oauth-protected-resource/api/mcp` |
| Authorization server metadata | `https://crispstats.com/.well-known/oauth-authorization-server` |
| Client registration | Client ID Metadata Documents (an `https` URL as `client_id`), or dynamic client registration at `/oauth/register` |
| Grant types | `authorization_code` with PKCE (`S256` only), `refresh_token` (rotated on every use) |
| Resource | `https://crispstats.com/api/mcp` (RFC 8707); tokens for any other audience are refused |
| Redirect URIs | Exact match. `https`, or `http` on `localhost`, `127.0.0.1` or `[::1]` with any port |
| Scopes | The permission strings, such as `analytics:read` or `members:write`; `scopes_supported` in the authorization server metadata lists all of them. The consent screen offers every one whatever the client asks for, and the token response's `scope` names what the person allowed. |

A request to `/api/mcp` with no `Authorization` header gets `401` and a `WWW-Authenticate: Bearer resource_metadata="…"` header, which starts the flow. To read the public demo without signing in, use `https://crispstats.com/api/mcp?demo`.

Registrations nobody allowed are removed after 30 days.


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