MCP Server
Ask Claude (or any AI assistant) questions about your analytics and get answers from real data. No dashboards, no queries — just ask.
What is MCP?
Model Context Protocol (MCP) is a standard that lets AI assistants call tools to access external data. Think of it as a plugin system for Claude.
The Himetrica MCP server gives Claude access to your analytics data. Once configured, you can ask questions like "How many visitors did I get this week?" and Claude will query your data and answer in natural language.
The MCP server is hosted by Himetrica — there's nothing to install or deploy. It calls the Read API under the hood. Connect it two ways: web apps like Claude.ai and ChatGPT sign in over OAuth (no key), while config-file clients (Claude Desktop, Claude Code, Cursor, Codex) use your secret key.
Setup
You need two things:
- Your secret key from Project Settings (
hm_sk_...) - A Starter plan or above
No install needed — the MCP server runs remotely on Himetrica's servers. Web connectors (Claude.ai, ChatGPT) skip the secret key entirely and authorize over OAuth — see below. Config-file clients use the secret key.
Claude.ai & ChatGPT (Web Connectors)
The web versions of Claude and ChatGPT connect to remote MCP servers over OAuth — no secret key, no config file. You paste one URL, sign in to Himetrica, approve access, and the connector is live. Use this connector URL:
https://app.himetrica.com/api/v1/mcpClaude.ai
- Go to Settings → Connectors and click Add custom connector.
- Paste the connector URL above and click Add.
- Click Connect — you'll be sent to Himetrica to sign in and Authorize access.
- Done. Ask Claude about your analytics in any chat.
ChatGPT
- Open Settings → Connectors (custom MCP connectors require enabling Developer mode under Settings → Connectors → Advanced).
- Click Create / Add, give it a name (e.g. Himetrica), and paste the same connector URL.
- Sign in to Himetrica and Authorize when prompted.
- Enable the connector in the composer (+ menu) and ask away.
OAuth, not API keys
Claude Desktop
Open Claude Desktop settings and add an MCP server, or edit the config file directly:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"himetrica": {
"url": "https://app.himetrica.com/api/v1/mcp",
"headers": {
"X-API-Key": "hm_sk_your_secret_key"
}
}
}
}Replace hm_sk_your_secret_key with your actual secret key. Restart Claude Desktop to apply.
Claude Code
Add the MCP server with one command:
claude mcp add himetrica https://app.himetrica.com/api/v1/mcp \
--transport http --header "X-API-Key: hm_sk_your_secret_key"Codex CLI
OpenAI's Codex CLI does not have a codex mcp add command — you configure MCP servers by editing ~/.codex/config.toml directly. Append this block to the file:
[mcp_servers.himetrica]
url = "https://app.himetrica.com/api/v1/mcp"
enabled = true
startup_timeout_sec = 30
tool_timeout_sec = 60
[mcp_servers.himetrica.http_headers]
X-API-Key = "hm_sk_your_secret_key"Replace hm_sk_your_secret_key with your actual secret key, then restart Codex. The longer timeouts give the remote MCP server room to respond on cold starts.
Note
https:// scheme.Cursor
Go to Cursor Settings > MCP and add a new server, or edit .cursor/mcp.json in your project:
{
"mcpServers": {
"himetrica": {
"url": "https://app.himetrica.com/api/v1/mcp",
"headers": {
"X-API-Key": "hm_sk_your_secret_key"
}
}
}
}Available Tools
The MCP server exposes these tools that Claude can call:
| Tool | Description |
|---|---|
get_analytics | Overview stats: visitors, pageviews, bounce rate, with period comparison |
get_timeseries | Time series trends for charting |
get_realtime | Active visitors right now |
get_top_pages | Pages ranked by views |
get_traffic_sources | Traffic source breakdown (referrer, UTM) |
get_top_locations | Geographic breakdown by country or city |
get_events | Custom event metrics |
get_revenue | Revenue overview: MRR, churn, subscriptions |
get_revenue_timeseries | Revenue over time |
get_top_customers | Top customers by revenue |
get_channel_roi | Channel ROI: revenue, ad spend, CAC, LTV |
All tools accept optional startDate and endDate parameters. Claude will set these automatically based on your question.
Example Questions
Once configured, just ask Claude in natural language:
Claude figures out which tool to call, sets the right parameters, and answers with your actual data.
API Reference