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 can read reports, funnels, campaigns, QR scans and webhooks over any date range, answer specific questions about your events, help you install Mitr and check that events arrive, and, if you allow it, create funnels, QR campaigns and webhooks. It has 26 tools and 5 ready-made prompts.
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 only the permissions you want the assistant to use: "Can register apps", "Can manage funnels", "Can manage QR campaigns", "Can manage webhooks", and "Can delete" for deletes.
- 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_..." }
}
}
} Or connect with one click (claude.ai and other web assistants)
Assistants that support "custom connectors" can sign in to Mitr instead of using a key. Add
https://mcp.mitranalytics.dev/mcp as a connector and choose Connect. You sign in to Mitr
and see what the assistant is asking for.
- Reading is always on. The assistant can read your apps, reports, funnels, alerts and plan usage.
- Every change is its own switch, off by default: register apps, create and change funnels, create and change QR campaigns, create and change webhooks, and delete funnels and webhooks. Delete only works together with the funnel or webhook switch.
- Disconnect any time under Settings → API keys & AI assistants. The list shows what each connection can do.
A connection only holds the permissions you switched on. To add one later, disconnect the assistant and connect again.
Tools
Overview and setup
| Tool | What it does |
|---|---|
get_workspace_overview | One summary of the whole workspace: every app's traffic, plus its webhooks, QR campaigns, funnels and anything that needs attention. A good first call. |
list_apps | Every app in your workspace, with the siteId the other tools need. |
get_install_snippet | The install command and code for one app on web, pixel (email or no-JS), Flutter, React Native or Node. It tells you where to find the app's secret key but never shows the key. |
verify_installation | Whether one app is receiving events: first and last event, the last 24 hours by event type and device, the last diagnostic ping from a mobile SDK, and likely causes in plain words when nothing arrives. |
get_billing_usage | Your plan, subscription status and event usage. |
Reports and questions
| Tool | What it does |
|---|---|
get_app_report | The full report for one app: visitors, pageviews, traffic per day, sources and UTM campaigns, entry pages, countries, devices, browsers, languages, web vitals, conversions and AI crawler visits. The last 7 days by default, or any range up to 366 days with from and to, compared with the period before or the same dates a year earlier. |
describe_events | Which event types an app sends, busiest first, with counts, visitors, how many carry UTM tags and their most common custom properties. The assistant calls this before asking detailed questions. |
query_events | Answers one specific question: visitors, events or pageviews, for one event type if you like, broken down by a dimension (source, country, device, a custom property and more) or as a daily, weekly or monthly series, with filters, a date range and a comparison. Groups of fewer than 3 visitors by city or custom property are hidden. |
get_campaign_report | Visitors, pageviews and conversions per UTM campaign, source or medium over 7 to 90 days, against the previous period. Name a conversion event such as signup to count it. |
get_recent_events | The latest raw events for one app, to check what is really being tracked. |
list_funnels, get_funnel_results | Your saved funnels, and step-by-step conversion and drop-off for one of them over a date range. |
list_qr_campaigns, get_qr_campaign | Your QR campaigns with scan totals and your plan's QR limits, and one campaign's codes with scans per placement. |
get_webhook_health | Delivered, pending and failed deliveries per webhook endpoint, and the latest error. Payloads are not returned. |
get_alert_rule | Your traffic spike and drop alert settings, if set. |
Changes (each needs its own permission)
| Tool | What it does |
|---|---|
add_app | Register a new app. Needs apps:write. The app's secret key is not returned: copy it from the dashboard. |
create_funnel, update_funnel | Create a funnel from ordered page-path or event steps, or replace an existing funnel's name and steps. Needs funnels:write. |
delete_funnel | Delete a funnel and its results history. Needs funnels:write and delete. |
create_qr_campaign, update_qr_campaign | Create a campaign that sends scanners to an https destination, or rename it, change the destination, or set its status to active, paused or archived. Archiving keeps the history and can be reversed. Needs qr:write. |
add_qr_code | Add a printable code to a campaign, labelled by placement, such as "Poster, main hall". Needs qr:write. |
create_webhook, update_webhook | Create an https webhook endpoint, change its URL or event types, or pause it with isActive. The signing secret is never shown in the conversation; copy it from the dashboard. Needs webhooks:write. |
delete_webhook | Delete a webhook endpoint and its delivery log. Needs webhooks:write and delete. |
Every write is its own permission on the key, so a key can read and
create funnels without being able to delete anything. Deletes need the
delete permission as well. Alerts and team management are
not available to the assistant.
Prompts
Clients that show MCP prompts (in Claude, type /) list five
ready-made ones. Each tells the assistant which tools to use and never to
invent a number.
| Prompt | What you get |
|---|---|
weekly_review | A short review of the last 7 days: traffic, conversions, funnels, campaigns and anything broken, with three suggested actions. |
explain_change | Where a rise or drop came from: the last 7 days against the 7 before, broken down by source, campaign, page, country and device. |
funnel_audit | A funnel's biggest drop-off step and concrete fixes. |
campaign_wrapup | Results for a marketing or QR campaign, by source or placement, against the previous period. |
setup_tracking | A walk-through for adding Mitr to a website or app and checking that events arrive. |
For marketers and agencies
Tag your links with utm_source, utm_medium and
utm_campaign, then ask the assistant which channel is
working. get_campaign_report groups visitors by campaign,
source, medium or source and medium, compares each with the previous
period, and counts the conversion event you name. Attribution is
first-touch: a visitor's landing-page tags stay on their later events, so
a signup is credited to the campaign that brought them. The result also
reports how much of your traffic carried no tags, so you know how much of
the picture the campaigns cover.
Prompts that work:
- "Which campaign brought the most signups in the last 30 days, and how does that compare with the 30 days before?"
- "Compare LinkedIn and Instagram traffic by medium and tell me where the untagged traffic is hiding."
- "Create a QR campaign for the March flyer, add a code for each of the three venues, and give me the links."
- "Across every app in my workspace, which one has the biggest traffic change this week?"
- "How did November compare with November last year, by country?"
- "Which QR placement brought the most scans this month?"
Using Brevo for email? Its official MCP server can sit next to Mitr's:
tag your email links with the same utm_campaign you use in
Brevo, and the assistant can follow a campaign from send to signup. See
Brevo MCP plus Mitr MCP.
Agencies can connect one workspace per client and ask the same questions of each. Paid spend lives in your ad platforms: connect their own assistants alongside Mitr and ask for cost per signup across both.
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 can only change things for the permissions you ticked when you created it. 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_appdoesn'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 see | What 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" (or funnels:write, qr:write, webhooks:write, delete) | The key does not have that permission. Create a key with the permission ticked to use the tool. |
| "early-access period has ended for the Free plan" | Upgrade the workspace; the same key works again. |
| 401 from the hosted endpoint | The 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.