MCP
Connect Claude Code or any MCP client to your analytics over OAuth, with scopes you choose.
Atrix runs a hosted Model Context Protocol server at
https://mcp.analytics.atrix.dev/mcp (streamable HTTP). An assistant connected to it can list your projects
and run trends, funnels and retention against your real data.
Connect Claude Code
claude mcp add --transport http atrix-analytics https://mcp.analytics.atrix.dev/mcpThen run /mcp inside Claude Code, pick atrix-analytics and choose Authenticate. A browser window opens:
- Sign in to Atrix Analytics (if you are not already).
- Pick the organisation to connect.
- Review the scopes. You can untick any of them; the client gets only what you leave ticked.
- Approve. The browser hands a code back to Claude Code, which exchanges it for tokens.
There is nothing to paste: the command carries no credential. The client stores an OAuth token that is scoped, refreshable and revocable, instead of a long-lived key in plain text.
Other MCP clients (Claude Desktop, Cursor, VS Code, and any client that supports remote servers with OAuth) connect to the same URL.
What the OAuth flow does
The server follows the MCP authorization spec, so compliant clients discover everything themselves:
- An unauthenticated request to
/mcpgets401with aWWW-Authenticateheader pointing at the protected-resource document (/.well-known/oauth-protected-resource/mcp, RFC 9728). - That document names
https://app.analytics.atrix.devas the authorization server, whose metadata is at/.well-known/oauth-authorization-server(RFC 8414). - The client registers itself with dynamic client registration (
POST /oauth/register, RFC 7591). Only public clients are accepted: no client secret, PKCE with S256 required. - The user signs in and consents at
/oauth/authorize; the client exchanges the code at/oauth/token.
| Token | Lifetime |
|---|---|
| Authorisation code | 60 seconds, single use |
Access token (atx_oat_…) | 1 hour |
| Refresh token | 30 days, rotated on every use |
Reusing a spent refresh token or code revokes the whole grant. Every connection is listed in the console under Settings → Connections, where Disconnect revokes it and every token cut from it.
If no scopes are requested, the default is org:read projects:read query:read usage:read.
Tools
Every tool is read-only (readOnlyHint: true, destructiveHint: false, idempotentHint: true). A tool is only
listed when your token holds its scope.
| Tool | What it does | Scope |
|---|---|---|
list_orgs | Your organisation and your role in it | org:read |
list_projects | Projects with id, name, region, timezone and environments | projects:read |
get_project | One project: region, retention, timezone, currency, environments | projects:read |
list_events | Recent event names with volumes (1–365 days, default 30) | query:read |
run_trends | Trends: series, math (total, unique persons or sessions, sum, avg, min, max, p50, p90, p99), interval, breakdown, compare, formula | query:read |
run_funnel | A funnel of 2–20 steps with a conversion window (default 14 days), strict, ordered or unordered, with breakdown | query:read |
run_retention | Retention by target and returning event, 1–52 periods (default 7), first-time or recurring | query:read |
get_usage | Billing usage for the current period | usage:read |
In progress
get_usage currently answers available: false until billing usage is exposed through MCP. Write tools
(drafting flags and experiments, proposing tracking-plan events) and a docs search tool are planned; they will
create flags off and experiments as drafts, and going live will need the named scopes.
Try it
After connecting, ask things like:
- "List my Atrix projects."
- "What were the top 10 events in production over the last 7 days?"
- "Show the signup → first_booking funnel for the last 30 days, broken down by platform."
- "How does week-1 retention for users who signed up in August compare with July?"
Limits and safety
- Queries run in the project's region, like the console's.
- Tokens are checked against the control plane on every request (cached for at most 15 seconds), so revoking a connection takes effect almost immediately.
- Supported protocol versions: 2025-06-18, 2025-03-26 and 2024-11-05.