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:

  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. 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/mcp

Claude.ai

  1. Go to Settings → Connectors and click Add custom connector.
  2. Paste the connector URL above and click Add.
  3. Click Connect — you'll be sent to Himetrica to sign in and Authorize access.
  4. Done. Ask Claude about your analytics in any chat.

ChatGPT

  1. Open Settings → Connectors (custom MCP connectors require enabling Developer mode under Settings → Connectors → Advanced).
  2. Click Create / Add, give it a name (e.g. Himetrica), and paste the same connector URL.
  3. Sign in to Himetrica and Authorize when prompted.
  4. Enable the connector in the composer (+ menu) and ask away.

OAuth, not API keys

Web connectors authenticate with OAuth 2.1 (PKCE + dynamic client registration) — the first connect opens a Himetrica sign-in and consent screen. Approve once and your assistant stays connected; you can revoke access anytime from Project Settings. Requires the Starter plan or above.

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"

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:

toml
[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

Don't confuse Codex CLI with Claude Code — the config format is different (TOML vs JSON) and the URL must include the https:// scheme.

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"
      }
    }
  }
}

Several Projects

On the consent screen of Claude.ai, ChatGPT and other OAuth clients you can pick more than one project (or select all). The assistant then reaches all of them through one connection: every tool takes a projectId (the project's name, domain or id), andlist_projects lists them.

Name the project in your question ("how did the store do this week?") and the assistant picks it. If you don't, it asks which one instead of guessing, and every answer says which project it came from. Ask for a comparison and it queries each project in turn.

A secret key belongs to one project, so Claude Desktop, Claude Code, Codex and Cursor configs with a key reach that project only. Add one server per project (e.g.himetrica-store, himetrica-app), or connect over OAuth where the client supports it. Connections made before multi-project consent keep their single project; reconnect to pick more.

Available Tools

The MCP server exposes these tools that Claude can call:

ToolDescription
list_projectsProjects this connection can query (name, domain, organization)
get_project_summaryWeekly or monthly summary vs the previous period, with ranked highlights of what changed. A good first call
get_analyticsOverview stats: visitors, pageviews, bounce rate, with period comparison
get_timeseriesVisitors and pageviews over time (hour, day, week or month)
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
list_eventsIndividual events with their properties (the payload)
get_event_visitorsVisitors who fired an event, ranked by count
search_visitorsFind visitors by name, email, country, device, UTM, visited page or metadata
get_visitorOne visitor's profile, by email, your app's userId or visitor id
get_visitor_eventsEvents fired by one visitor
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
get_icpIdeal customer profile and the lookalike visitors not yet paying
list_funnelsSaved funnels with their steps and dashboard links
get_funnelOne funnel's conversion and drop-off per step over a date range
create_funnelCreates a funnel in your project (writes)
update_funnelEdits a saved funnel (writes)

Tools that read a period accept optional startDate and endDate parameters (default: the last 7 days). Claude will set these automatically based on your question.

Funnel tools write to your project

Every tool reads your data except create_funnel and update_funnel, which save funnels to your dashboard's Funnels page. They are marked as write actions, so your AI client asks you to confirm before running them. Funnels can't be deleted through MCP.

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"
>"Create a funnel from /pricing to the signup event"
>"Where do people drop off in my checkout funnel?"
>"Compare signups this month across my projects"

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