Skip to content

AI assistants (MCP)

The Mitr MCP server lets Claude, Gemini, Cursor and other MCP clients read your own analytics, so you can ask questions about them in plain English instead of opening the dashboard. It reads what's already in your workspace: apps, reports, funnels, alerts and plan usage.

1. Create an API key

In the dashboard open Settings → API keys & AI assistants → Create key, name it (for example "Claude Code") and copy it. It is shown once.

  • Read-only by default. Tick "Can register apps" only if you want the assistant to use add_app.
  • Expiry: 1 year by default; you can pick 30 days, 90 days or never.
  • A key stops working if you leave, or are removed from, the workspace it was created in.

2. Connect your assistant

Hosted: nothing to install

Point any client that supports remote MCP servers at https://mcp.mitranalytics.dev/mcp and send your key in the Authorization header.

Claude Code:

claude mcp add --transport http mitr https://mcp.mitranalytics.dev/mcp --header "Authorization: Bearer mitr_live_..."

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "mitr": {
      "url": "https://mcp.mitranalytics.dev/mcp",
      "headers": { "Authorization": "Bearer mitr_live_..." }
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "mitr": {
      "type": "http",
      "url": "https://mcp.mitranalytics.dev/mcp",
      "headers": { "Authorization": "Bearer mitr_live_..." }
    }
  }
}

Gemini CLI (~/.gemini/settings.json):

{
  "mcpServers": {
    "mitr": {
      "httpUrl": "https://mcp.mitranalytics.dev/mcp",
      "headers": { "Authorization": "Bearer mitr_live_..." }
    }
  }
}

Never put the key in the URL: the endpoint refuses it, because URLs end up in logs.

Local: Claude Desktop and other clients that run a command

You need Node.js 18 or newer. Add this to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\), then restart Claude:

{
  "mcpServers": {
    "mitr": {
      "command": "npx",
      "args": ["-y", "@mitr-analytics/mcp"],
      "env": { "MITR_API_KEY": "mitr_live_..." }
    }
  }
}

One-click "Connect" from claude.ai and ChatGPT (sign in to Mitr instead of pasting a key) is coming next.

Tools

ToolWhat it does
list_appsEvery app in your workspace, with the siteId the other tools need.
get_app_reportA 7-day report for one app: visitors, pageviews, traffic, sources, countries, devices, web vitals, conversions, with the change against the previous 7 days.
get_recent_eventsThe latest raw events for one app, to check what is really being tracked.
list_funnelsYour saved conversion funnels.
get_funnel_resultsStep-by-step conversion and drop-off for one funnel over a date range.
get_alert_ruleYour traffic spike and drop alert settings, if set.
get_billing_usageYour plan, subscription status and event usage.
add_appRegister a new app. The only tool that changes anything; needs a key with "Can register apps". The app's secret key is not returned: copy it from the dashboard.

There is deliberately no tool to delete anything, edit alerts or webhooks, or manage your team.

Plans

During early access, until 20 January 2027, the MCP server works on every Mitr plan, including Free. After that it is part of the paid plans. Your keys stay valid, so upgrading turns access back on straight away.

Security and privacy

  • A key sees what you see, and is read-only unless you allowed it to register apps. Treat it like a password.
  • Revoke it any time under Settings → API keys. It stops working immediately; keys also expire on the date you chose.
  • Use one key per tool, so you can revoke one without breaking the others.
  • Visitor data is marked as untrusted. Page paths, referrers, UTM tags and event properties are written by your visitors, so anyone can put text there, including text aimed at an AI. They reach the assistant cleaned of hidden characters and labelled as data, never instructions.
  • No secrets in the conversation. add_app doesn't return the new app's SDK secret key.
  • Your AI provider sees the data you ask about. Reports and recent events are returned to the assistant, so they fall under that provider's terms. Mitr itself identifies visitors only by hashed identifiers.
  • The key is only ever sent over HTTPS.

Troubleshooting

Hosted: open mcp.mitranalytics.dev; it should show the server version. Local: run npx -y @mitr-analytics/mcp --version. If either works, the problem is in the client config.

You seeWhat to do
"Your Mitr API key was rejected"The key expired, was revoked or was copied wrongly, or you're no longer in its workspace. Create a new one in Settings → API keys.
"missing the 'apps:write' permission"The key is read-only. Create one with "Can register apps" ticked to use add_app.
"early-access period has ended for the Free plan"Upgrade the workspace; the same key works again.
401 from the hosted endpointThe Authorization: Bearer mitr_live_… header is missing or malformed in your client config.
"Mitr is rate-limiting this key"Too many requests in a short time. Wait a minute.
MITR_API_KEY is not set (local)The env block is missing or in the wrong place in the client config.
npx: command not found (local)Install Node.js 18+, then restart the assistant so it picks up the new PATH. Or use the hosted endpoint instead.

Source: github.com/shiv9thakur/mitr-mcp · Package: @mitr-analytics/mcp on npm · Questions: support@mitranalytics.dev. See also the walkthrough.

Have questions about integration or security? Drop us a line directly.