Claude and MCP
StatsRaven is an MCP server. Claude and other MCP clients can read your projects, run queries, show charts in the conversation and pin them to a sheet. You need no AI key in StatsRaven for this.
The address is your StatsRaven address followed by /mcp, for example https://stats.example.com/mcp. Settings, Claude and MCP shows it with ready setups and lets you turn MCP off.
Sign in with OAuth
Apps that support OAuth, such as Claude on the web and Claude Desktop, only need the address. Add StatsRaven as a custom connector with the /mcp address; the app opens StatsRaven, an admin signs in and allows it. The server must be reachable over HTTPS from the app. Connected apps are listed in Settings, Claude and MCP, where you can disconnect them.
Or use a token
Make a token in Settings, Claude and MCP, Tokens, or with statsraven admin-token. It is shown once. Send it as Authorization: Bearer YOUR_TOKEN.
Claude Code:
claude mcp add --transport http statsraven https://stats.example.com/mcp --header "Authorization: Bearer YOUR_TOKEN"
Add --scope user to use it in every project.
Cursor, in ~/.cursor/mcp.json or .cursor/mcp.json in a project:
{
"mcpServers": {
"statsraven": {
"url": "https://stats.example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
VS Code, in .vscode/mcp.json:
{
"servers": {
"statsraven": {
"type": "http",
"url": "https://stats.example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
Tools
| Tool | What it does |
|---|---|
get_schema | Projects, sources, fields, named patterns and what you taught StatsRaven. Clients call it first. |
run_query | Counts, sums, averages and percentiles grouped and filtered, with the SQL that ran. |
web_report | The website numbers from Overview: visitors, pages, channels, campaigns, places, devices, goals and revenue. |
online_now | Who is on your sites right now. |
funnel, funnel_dropoff | Funnels of pages and events, and where visits went when they left one. |
run_sql | One read-only SQL query, up to 500 rows. |
compare_browser_traffic | Server requests against snippet page views, to find bots and scrapers. |
search_logs, get_samples | Log text search and example records, with IP addresses and emails masked. |
show_chart | Shows a chart in the conversation, in clients that support MCP Apps. |
pin_chart | Pins a chart to the project's sheet. |
list_unlabeled_patterns, label_patterns | Lists log patterns without a name and saves names for them. |
save_fact | Saves a fact about your business to Teach, such as how to tell a signed-in user. |
create_alert | Makes an alert, such as "tell me if payments stop for an hour". Needs the Alerts add-on to run; without it the alert waits as a draft. |
Everything except pin_chart, label_patterns, save_fact and create_alert only reads. Each tool call is written to the change log with the token or app that made it.
Security
- A token or an allowed app reads every project, so only admins can make tokens or allow apps. Tokens see real values; sensitive field masking applies to people signed in as editors and viewers.
- Requests sent from web pages are refused, so a website you visit cannot reach your StatsRaven through your browser.
- OAuth access lasts an hour and renews on its own for 90 days of use. It stops when the admin who allowed it is no longer an admin.