MCP · Model Context Protocol

A fast lane for AI agents

Use MCP to connect TopStat to Cursor, Claude Code or Codex — or call it from any terminal CLI. Ask in plain English to analyze traffic, understand revenue and manage your account.

Open dashboard Back to overview

One endpoint, five tools

TopStat exposes a standard MCP server over HTTP (JSON-RPC 2.0). Point any MCP client at the URL below — no SDK required.

MCP endpoint
https://topstat.top/api/mcp

Authentication: sign in to TopStat in your browser for session-based access, or use a read-only token from one of your public share links as a Bearer token.

Connect in 3 steps

Works with every MCP-capable client. Pick your tool below and paste the config.

1

Get a token

In the dashboard, open Public sharing and create a share link for your site — the token after ?token= is your read-only MCP key. Signed-in browser sessions also work.

2

Add the server

Paste the config into Cursor, Claude Code, Codex or any MCP client. Replace YOUR_TOKEN with the token from step 1.

3

Ask questions

In your editor or terminal, ask things like “How is traffic this week vs last week?” — the agent calls TopStat tools and answers with real numbers.

.cursor/mcp.json
{
  "mcpServers": {
    "topstat": {
      "url": "https://topstat.top/api/mcp",
      "transport": "http",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}
Terminal
claude mcp add --transport http topstat \
  https://topstat.top/api/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"
~/.codex/config.toml
[mcp_servers.topstat]
url = "https://topstat.top/api/mcp"
http_headers = { Authorization = "Bearer YOUR_TOKEN" }
Settings → Connectors → Add custom connector
https://topstat.top/api/mcp

Claude Desktop connects to remote MCP servers via custom connectors. Add the URL above, then sign in to TopStat in your browser so the session cookie can be used.

What your AI agent can do

Five tools are exposed over MCP — everything needed for day-to-day analytics questions.

ToolWhat it returns
topstat_list_sitesAll websites tracked in your account, with event counts.
topstat_get_statsVisitors, pageviews, channels, countries, devices and top pages for a period.
topstat_get_funnelsFunnels with step-by-step conversion analysis.
topstat_get_revenueRevenue totals and attribution by channel and country.
topstat_get_journeyA visitor's pageview replay, or the most active sessions.
How is traffic this week compared to last week?
Which channel brings the most paying customers?
Where do my buyers come from and what devices do they use?
Summarize funnel conversion for the last 30 days.

Ready to let AI dig into your data?

Create your first share token, connect your editor, and start asking.

Open dashboard