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 runs locally on your machine — it's a small process that Claude spawns when needed. It calls the Read API under the hood. You don't need to host or deploy anything.

Setup

You need two things:

  1. Your secret key from Project Settings (hm_sk_...)
  2. A Starter plan or above

No install needed — the MCP server runs remotely on Himetrica's servers. Just add the URL and your secret key.

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

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:

bash
claude mcp add himetrica https://app.himetrica.com/api/v1/mcp \
  --transport http --header "X-API-Key: hm_sk_your_secret_key"

Cursor

Go to Cursor Settings > MCP and add a new server, or edit .cursor/mcp.json in your project:

json
{
  "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:

ToolDescription
get_analyticsOverview stats: visitors, pageviews, bounce rate, with period comparison
get_timeseriesTime series trends for charting
get_realtimeActive visitors right now
get_top_pagesPages ranked by views
get_traffic_sourcesTraffic source breakdown (referrer, UTM)
get_top_locationsGeographic breakdown by country or city
get_eventsCustom event metrics
get_revenueRevenue overview: MRR, churn, subscriptions
get_revenue_timeseriesRevenue over time
get_top_customersTop customers by revenue
get_channel_roiChannel 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:

>"How many visitors did I get this week?"
>"What's my MRR?"
>"Which pages are most popular?"
>"Where are my visitors coming from?"
>"Which marketing channel has the best ROI?"
>"How is my traffic trending compared to last month?"
>"What are my top custom events?"
>"Who are my highest-value customers?"
>"Is anyone on the site right now?"
>"Show me my revenue trend for the last 90 days"

Claude figures out which tool to call, sets the right parameters, and answers with your actual data.

API Reference

The MCP server uses the Read API under the hood. See the full API reference for all available endpoints and parameters.
Himetrica - Analytics That Actually Matter