What is an analytics MCP server?
MCP is an open standard that lets an AI assistant call tools on a remote service. An analytics MCP server exposes reports as tools, so when you ask “why did revenue drop this week?” the assistant reads your real overview, breakdowns and attribution instead of guessing from training data. Statsy hosts one at https://statsy.co/mcp.
Without a server like this, an assistant can only reason about analytics you paste into the chat. With one, it can fetch the last 30 days by channel, compare them with the 30 days before, pull the funnel that lost people, and open one customer’s journey, all in a single answer. The tools return structured JSON, so the assistant can chain them and do arithmetic on the results.
Statsy’s server is stateless and speaks streamable HTTP, the current MCP transport. There is nothing to install or keep running on your machine. You add the URL to your assistant, approve the connection once in the Statsy dashboard, and start asking.
How do you connect Claude, Cursor or VS Code to Statsy?
Add the server URL to the client, then sign in when it asks. Your browser opens the Statsy dashboard to approve access for your workspace. The whole thing takes about a minute, and the MCP setup guide has every client’s exact steps.
Claude Code
claude mcp add --transport http statsy https://statsy.co/mcpThen run /mcp, choose statsy and sign in.
Claude app
Open Settings, Connectors, Add custom connector, paste the server URL, connect, and approve access in the window that opens.
Cursor
{ "mcpServers": { "statsy": { "url": "https://statsy.co/mcp" } } }In ~/.cursor/mcp.json or a project-level .cursor/mcp.json, then sign in from Cursor Settings, MCP.
VS Code
{ "servers": { "statsy": { "type": "http", "url": "https://statsy.co/mcp" } } }In .vscode/mcp.json. Start the server from that file and sign in when VS Code asks.
Headless agents
A client that cannot open a browser sends an account token in an Authorization: Bearer header instead of signing in.
What can you ask an AI assistant about your analytics?
Anything the dashboard can answer, and comparisons the dashboard makes you do by hand. The server exposes thirteen tools and three ready-made prompts: a weekly review, “why did revenue change?” and “which channel should I double down on?”.
| Tool | What the assistant gets |
|---|---|
list_sites | Your sites with id, public key, domain, time zone and currency. The starting point for every other tool. |
get_overview | Headline metrics for a period, optionally compared with the previous one. |
get_timeseries | One metric by hour, day, week or month, to find spikes and drops. |
get_breakdown | Top values of a dimension: channel, referrer, campaign, page, country, device, goal, AI source or keyword. |
get_attribution | Revenue by channel under last touch, first touch, linear, time decay or position based, with a 1 to 365 day lookback. |
list_funnels, get_funnel | Saved funnels, and a step-by-step report with drop-off and revenue per step. |
search_visitors | Visitors by id, email, name, user id, country, city or path. |
get_journey | One visitor’s full timeline: pageviews, goals, marketing touches and payments. |
get_bots | Bot and AI crawler requests by family, bot name or path. |
list_goals, create_goal | The goals configured for a site, and a new pageview or event goal. Creating needs the editor or owner role. |
add_note | A chart annotation such as a deploy or a launch. Needs the editor or owner role. |
Questions that work well, taken from real sessions:
- “Which channel brought the most revenue in the last 30 days, and how does that compare with the month before?”
- “Why did conversions drop this week? Check channels, pages and countries.”
- “Show the checkout funnel for the last 7 days and tell me which step lost the most people.”
- “What did the customer with this email do before they paid?”
- “How much of my traffic is AI crawlers, and which ones?”
- “Add a note on today saying we shipped the new pricing page.”
Is there a command line tool for Statsy?
Yes. @statsy.co/cli on npm installs a statsy command that prints the same reports as the dashboard, as tables in a terminal or as JSON in a script. It covers overviews, breakdowns, time series, funnels, live visitors, attribution and CSV export, and it is MIT licensed.
npm install -g @statsy.co/cli
statsy login # paste an account token once
statsy sites use ws_yoursitekey
statsy stats --period 30d --breakdown channel --metric revenue
statsy attribution --model first --lookback 90
statsy visitors --live # one JSON line per visitor with --json
statsy export --dimension path --period 90d > pages.csvIn CI, set STATSY_TOKEN and skip statsy login. Colour turns off when output is piped, and exit codes separate general errors, missing authentication, forbidden requests and rate limits, so a cron job can branch on them. The full command list is in the CLI reference.
What about the REST API?
Every report is JSON over HTTPS at https://api.statsy.co/api/v1, authenticated with a bearer token. It also accepts payments from systems Statsy does not integrate with, through the Payment API, so revenue attribution works for any checkout you can call a URL from.
curl -H "Authorization: Bearer sta_your_token" \
"https://api.statsy.co/api/v1/sites/ws_yoursitekey/attribution?model=last&lookback=90&from=30d"Account tokens act for a whole workspace; site tokens are limited to one site and behave like an editor. Tokens are stored only as hashes and can be revoked at any time. Requests are limited to 60 a minute on Growth and ten times that on Scale. Start with the REST API overview.
Is it safe to give an AI assistant access to analytics?
Access is granted by you, in the dashboard, per connection, and scoped to one workspace with your own role. Viewers can only read. Nothing is granted by knowing the URL, connections are rate limited to 120 requests a minute, and removing the connection in your assistant revokes it.
- OAuth 2.1 approval. The assistant never sees a password. You approve it once in the Statsy dashboard and can revoke it there or in the client.
- Your role, not more. An assistant connected by a viewer cannot create goals or notes. An ended trial keeps the read tools working and refuses the writes.
- No visitor secrets. The tools return the same aggregates, journeys and visitor fields the dashboard shows. Replay recordings are not exposed over MCP.
- Tokens are hashed. Account tokens used by headless clients are stored as SHA-256 hashes, shown once at creation, and can be revoked immediately. See security.
Why does an analytics tool need an AI interface at all?
Because the useful questions are comparisons and causes, and dashboards are built for glances. “Which channel should I spend tomorrow on?” needs attribution under two models, a funnel and last month’s numbers side by side. An assistant with tools does that in one turn.
Statsy’s numbers are unusual in that revenue is in them: every sale from Stripe, Lemon Squeezy, Paddle, Polar or Razorpay is credited to the visits that led to it. So the assistant is not answering “which post got clicks?” but “which post brought paying customers?”, which is the question that changes what you do next. Read how that works in marketing attribution software.
Among the tools we compare against, DataFast also lists an MCP server and a CLI; see the DataFast comparison. We do not claim that others lack one. Check each vendor’s own pages.