MCP Server
Every question, deploy annotation, and site metric, served through a single authenticated Model Context Protocol connection.
Connect
One link for every agent: https://api.staats.ai/mcp. Add it once and your client opens a sign-in page the first time it connects: continue with GitHub or Google (that creates your account if you’re new) and allow the agent. There is no key to copy. Then ask your agent to add analytics.
# Claude Code (--scope user connects every project on the machine); then /mcp, Authenticate
claude mcp add --scope user --transport http staats https://api.staats.ai/mcp
# Codex
codex mcp add staats --url https://api.staats.ai/mcp
codex mcp login staats
// Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"staats": { "url": "https://api.staats.ai/mcp" }
}
}
// VS Code (.vscode/mcp.json; for every project, run "MCP: Open User Configuration")
{
"servers": {
"staats": { "type": "http", "url": "https://api.staats.ai/mcp" }
}
}
Devin Desktop and other clients that add remote MCP servers: add https://api.staats.ai/mcp
as an HTTP server, and sign in when it asks.
| Server URL | https://api.staats.ai/mcp |
|---|---|
| Transport | Streamable HTTP (JSON-RPC 2.0 over POST) |
| Authentication | OAuth 2.1: your agent signs you in and stores its own token |
In Claude Code, run /mcp and choose Authenticate; in Codex, codex mcp login staats; Cursor and VS Code ask on their own. Some clients sign in again after a restart.
An agent signed in this way works with every site on your account and the sites shared with you. It can rename a site or change its domain; deleting a site stays on your account page, and so does cutting an agent off. How long a site’s data is kept follows your plan.
Clients without sign-in
A client that can’t sign in through OAuth can connect with your account key instead. It starts with ak_ and lives on your account page:
https://api.staats.ai/functions/v1/mcp/YOUR_ACCOUNT_KEY
That URL is a credential: keep it out of public repositories. Clients that prefer header authorization can send Authorization: Bearer YOUR_ACCOUNT_KEY to https://api.staats.ai/functions/v1/mcp instead. Leaked a key? Regenerate it on your account page; the old key stops working within a minute, and your sites’ script tags are unaffected.
Site selection semantics
If your account has a single site, all tools execute against it automatically. When multiple sites exist, tools take an optional site argument: the public data-site code from the site's script tag (also returned by list_sites alongside each domain and name). Exact matches only; the server never guesses.
Available tools
| Tool | Purpose & Behavior |
|---|---|
get_overview | Summary of visitors, pageviews, top paths, referrers, revenue when the site records purchases, and trend vs previous period. Says so plainly when the site is too new for the comparison to mean much. |
query | Aggregated metrics by dimension with flexible filtering (paths, referrers, countries, events). Revenue by source, campaign or landing page shows what brings paying customers. |
funnel | Ordered conversion steps (paths or events) with stage-by-stage drop-off calculations. |
journeys | The routes visitors actually take, grouped and counted, for when you don't know the steps yet. |
what_changed | Anomaly detection over a period or a from/to range: traffic surges, new referrers, and unusual days. |
what_broke | JS errors (with affected visitors and the nearest recorded annotation, if any) plus visitor friction: navigation loops and refresh bursts. Takes a period or a from/to range. |
record_annotation | Mark a moment on the timeline (a launch, a deploy, a campaign) when you ask, with the commit and touched routes when known. |
list_annotations | Retrieve chronological change logs and deploy milestones. |
compare_around | Compare visitors, pageviews and revenue before vs after a moment: a timestamp (such as a commit's time from git log), an annotation, or a commit recorded on one, scoped to routes when given. |
list_sites | List all sites on the account with public site codes and how many days of history each keeps (your plan’s). |
create_site | Create a new site and retrieve its script tag without leaving your agent chat. |
update_site | Change a site's name or domain. Owner only. |
delete_site | Permanently delete a site and its data (requires typed domain confirmation). Not offered to an agent signed in through the link. |
portfolio_overview | Visitors and pageviews for every site, with change vs the previous period, busiest first. |
Tool responses are returned as token-efficient JSON structured for LLM reasoning. Once the account nears its event allowance, get_overview carries a short quota note.