MCP Server
Every question, deploy annotation, and site metric, served through a single authenticated Model Context Protocol connection.
Connection details
| Server URL | https://api.staats.ai/functions/v1/mcp/YOUR_ACCOUNT_KEY |
|---|---|
| Transport | Streamable HTTP (JSON-RPC 2.0 over POST) |
| Authentication | Key in the URL path (zero headers needed) |
Your account key starts with ak_ and lives in your dashboard. Because the key is embedded in the URL, native remote MCP configuration takes one line:
# Claude Code CLI (--scope user connects every project on the machine)
claude mcp add --scope user --transport http analytics "https://api.staats.ai/functions/v1/mcp/YOUR_ACCOUNT_KEY"
# Codex
codex mcp add analytics https://api.staats.ai/functions/v1/mcp/YOUR_ACCOUNT_KEY
// Cursor (~/.cursor/mcp.json or project .cursor/mcp.json)
{
"mcpServers": {
"analytics": { "url": "https://api.staats.ai/functions/v1/mcp/YOUR_ACCOUNT_KEY" }
}
}
The URL acts as your credential: keep it out of public repositories. Clients that prefer standard header authorization can send
Authorization: Bearer YOUR_ACCOUNT_KEY to https://api.staats.ai/functions/v1/mcp directly.
Leaked a key? Regenerate it from the dashboard — 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, and trend vs previous period. |
query | Aggregated metrics by dimension with flexible filtering (paths, referrers, countries, events). |
funnel | Ordered conversion steps (paths or events) with stage-by-stage drop-off calculations. |
what_changed | Automatic anomaly detection: traffic surges, viral referrers, and unusual days. |
record_annotation | Record deploy markers with commit hash and touched routes for before/after measurement. |
list_annotations | Retrieve chronological change logs and deploy milestones. |
compare_around | Compare metrics before vs after a deploy (with route-scoped analysis when routes were logged). |
get_site_context / update_site_context | Persistent site memory across sessions: site goals, audience, event dictionaries, and open notes. |
list_sites | List all sites on the account with public site codes. |
create_site | Create a new site and retrieve its script tag without leaving your agent chat. |
delete_site | Permanently delete a site and its data (requires typed domain confirmation). |
portfolio_overview | Multi-site portfolio breakdown sorted by highest traffic and growth. |
Tool responses are returned as token-efficient JSON structured for LLM reasoning. Proactive quota notices are returned from 80% usage onward.