AI
Connect AI assistants (MCP)
Ask Claude, Cursor or any MCP client about your traffic and revenue in plain words.
EarnedStats has an MCP server, so an AI assistant can read your analytics and answer questions like a teammate who knows your dashboard. It is read only: an assistant can look at your sites but never change anything.
1. Create a token
Open Account, AI assistants and create a token. Copy it right away: it is shown once. A token reaches only the sites in your account. Revoke it there at any time.
2. Connect your assistant
The server address is https://earnedstats.com/mcp (Streamable HTTP). Send the token as a header.
claude mcp add --transport http earnedstats https://earnedstats.com/mcp \
--header "Authorization: Bearer YOUR_TOKEN"{
"mcpServers": {
"earnedstats": {
"url": "https://earnedstats.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}{
"servers": {
"earnedstats": {
"type": "http",
"url": "https://earnedstats.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}Any other assistant that connects to a remote MCP server and can send an Authorization header works the same way.
Treat the token like a password. Keep it in your assistant settings or an environment variable, never in a shared repository.
3. Ask
- Which sources brought paying customers to example.com in the last 30 days?
- Compare this week with last week. What changed?
- Which blog posts lead to signups?
- Who is on the site right now, and where did they come from?
- Show me the journey of the last customer before they paid.
Tools
| Tool | What it returns |
|---|---|
list_sites | Your sites with id, domain, timezone and currency. |
get_overview | Visitors, pageviews, sessions, bounce rate, duration, revenue and conversion, with the previous period. |
get_breakdown | Visitors and revenue by source, channel, campaign, page, entry or exit page, goal, country, city, device, browser or system. |
get_revenue | Revenue, refunds, customers and payments, and where paying visitors came from. |
get_goals | Each goal with completions, converting visitors and revenue. |
get_realtime | Who is online now and the latest events. |
list_visitors | Visitors in a period with source, place, device, visits and spend. |
get_visitor | One visitor's sessions, pages, events and payments in order. |
Every tool that covers a period takes period (today, 7d, 30d, 90d, 12m, all, or custom with from and to) and optional filters such as {"country":"DE"}. Money comes in minor units (cents for USD) with the currency and its decimals.