MCP analytics

See which agents call your MCP server, how often, how fast, how each call ended and what they were helping someone do, tool by tool, agent by agent and session by session, at Admin → Agents → Analytics, along with the tools agents asked for and didn't find. An admin's agent can ask for the same numbers, and with PostHog set up the calls go there too.

Updated · 8 min read

Every site ships with an MCP server for AI agents (see Agents and the API). MCP analytics tells you what those agents do with it: which agents call, which tools they use, which tools fail or run slowly, what each agent did in one sitting, what the people they help are trying to do, and what agents looked for and didn't find. It's built in, so there's nothing to sign up for, and the numbers sit in Admin → Agents → Analytics beside the rest of the admin.

MCP analytics

What's recorded

Each tool call is logged with:

  • the tool, and who called it: the signed-in person, or for a signed-out caller a key made from a hash of their network address (the address itself is never stored). A tool name that doesn't exist is kept only if it looks like a tool's name, and otherwise shows as "(invalid name)";
  • the agent: its name and version as it reports them (contact details taken out of the name), and the app it belongs to (below);
  • the MCP protocol revision it used;
  • how long it took and how it ended, with an error type and a short message when it failed, with secrets and contact details taken out (the same list as Keep arguments and responses);
  • the session it belongs to (below);
  • the names of the inputs it sent, such as experimentId, but not their values;
  • what the agent said the person was doing, when it says (below).

Calls that fail before a tool runs are logged too: a tool that doesn't exist (or is switched off) shows as Unknown tool, and one the caller may not use as Not allowed. They show what agents went looking for. A call that runs out of time is logged as Timed out, with how long it ran.

Each day, the server also counts how often each agent asked for the list of tools or started a connection.

Each call is kept for 30 days. Daily totals per tool and per agent are kept for 13 months, so the 90-day view and the trend survive the 30-day clean-up. The totals are counts: they don't say who called, so no one's id or key is kept past 30 days. When someone deletes their account, their calls stay in the counts but lose everything that tied them to that person, including any arguments kept in full.

Agents choose the names they send, so after a day's busiest 100 made-up tool names and 100 agent versions, the rest are added up as "(other)".

Which agent called

An agent's app is read from what it sends: the client name in the call or in its opening handshake, and failing that its user agent. It's matched against a list of known apps:

Claude Code, Claude Desktop, Claude.ai, Cursor, VS Code, Windsurf, ChatGPT, OpenAI, Codex, Gemini CLI, Goose, Zed, Cline, Roo Code, Continue, LM Studio and MCP Inspector.

Anything else shows as Other with the name it gave, like "Other (acme-agent)", and a call with no name and no user agent as Unknown. Nothing is guessed. Calls from the tools in a visitor's browser are Browser (WebMCP), and calls you run from Admin → Agents, or approve there, are Admin panel.

What agents say they're doing

Each tool offers agents an optional context input asking, in 15 to 25 words, what the person they're helping is trying to do, the same convention PostHog's MCP analytics uses, so agents already know it. The tool itself never sees it. What an agent writes there is kept with the call as its intent, at most 300 characters, with contact details and secrets taken out as in Keep arguments and responses. Nothing is guessed: a call without one has no intent.

To stop asking, turn off Ask agents what they're doing under the Overview. Tools stop offering context when agents next list them, and any sent anyway is dropped.

What agents couldn't find

Every server also has a request_capability tool, open to any caller. An agent that can't find a tool for the job can say what it was trying to do and what would have helped, and it gets back up to five of the tools it can use that come closest, so it may still finish. It can also rate the server from 1 to 5 and leave a note. One caller can ask 20 times an hour. Requests are kept 90 days, and requests worded alike are grouped when they arrive.

With PostHog sending on, the tool is listed as get_more_tools, the name PostHog's missing-capability view reads.

Sessions

A session is one agent's run of calls. When the agent sends an id for its conversation, each conversation is a session. Otherwise, calls from the same caller in the same app are one session for as long as they come less than 30 minutes apart.

The Analytics tab

Open Admin → Agents and choose Analytics. Pick the last 24 hours, 7 days, 30 days or 90 days, and narrow it to one agent's app with Harness. Every number is compared with the same length of time just before, counted the same way, so steady traffic reads as no change. For 30 and 90 days the comparison uses whole days and leaves today out, since it isn't over. The address keeps the view, the range, the filter and whatever you have open, so a link opens the same thing.

  • Overview: calls, error rate, how slow the slowest calls are (p95), sessions and callers, a chart of calls and errors, the busiest tools and the apps that call most.
  • Tools: every tool with its calls, error rate, typical (p50) and slow (p95) time, the app that calls it most, its last error and a daily trend. Sort by calls, error rate, p95 or name. Open one to see its errors by type, its slowest calls, the apps that call it, the inputs agents send and the sessions that called it.
  • Clients: each app and version, with its calls, error rate, p95, how often it asked for the list of tools (counted by day, so over 24 hours it's since midnight UTC the day before), the tool that fails most for it and when it was last seen. Click one to filter everything to it.
  • Sessions: the 50 sessions with the latest calls, each with when its last call was, its app, caller, what it was doing, calls, errors, tools and length. Open one for its calls in order, each with how long it took, how it ended and what the agent said it was doing when that changed.
  • Intents: what agents said they were doing, with alike wordings grouped (no AI reads them: two wordings that share at least half their words go together). Each group shows how many sessions and calls, other ways it was put, the tools used for it, and sessions to open. A tool's details list its top intents too.
  • Missing: what agents asked for with request_capability, and tool names they called that don't exist, most asked first, with examples of what they were doing and the tools they were pointed to. Mark each one Planned, Built (choose the tool it became) or Won't do; read-only viewers see the marks but can't change them, and each change is in the audit log. Below them are agents' ratings and notes.

The 90-day range reads the daily totals, so its percentiles are within about a tenth, callers are shown as the average a day, sessions are counted day by day, and a tool's details and the sessions reach back 30 days.

Admins and read-only viewers can open the tab. Only admins can change its settings, and each change is in the audit log. Until an agent has called, the tab shows the MCP endpoint and how to connect one.

Keep arguments and responses

By default only the names of a call's inputs are kept. Turn on Keep arguments and responses under the Overview to keep each call's inputs and what the tool returned, up to 2 KB each. A tool's details then show its recent calls in full. Calls to admin tools are never kept in full. Turning it off stops keeping new ones; what was kept goes with its call after 30 days. If PostHog sending is on, the copies sent there are kept for as long as your PostHog project keeps events. A change reaches every server within 10 seconds.

Before anything is kept, these are taken out:

  • values under names with a word like password, pass, secret, token, key, cookie, session, account, IBAN, PIN, CVV or SSN (licenseKey, x-auth-token), or code, unless it's a zip, country, language, currency, status or other plain code (smsCode and sortCode go; zipCode, sortBy and keyword stay);
  • numbers that read as card numbers (not times), numbers too long to check, and numbers under a phone name;
  • bearer and Basic credentials, API keys and tokens, AWS key ids, JWTs, webhook URLs, and secrets in a link's query;
  • long hex, base64 and random-looking ids;
  • email addresses, card numbers, IP addresses, and phone numbers written as 9 to 15 digits with spaces, dots, dashes, brackets or a slash (+44 20 7946 0958, 06.12.34.56.78, 030/12345678), but not dotted numbers after a / or v, which read as versions (Chrome/131.0.6778.85). A number spelled out in words, under 9 digits, or over 15 digits with no break stays.

Names, postal addresses and other free text are kept as sent, so think about what your tools take before you turn this on.

Ask your agent

Admins' agents get a read-only tool, get_mcp_usage, with the same numbers as the tab: totals against the period before, each tool, each app and version, the top ten intents, and the top ten missing tools with their marks and agents' ratings. Text an agent chose (a made-up tool name, an app's name or version, an error message) is marked as theirs, so your agent reads it as data rather than instructions. Give it a range (24h, 7d, 30d or 90d) and, if you like, a harness. Ask, for example, "which of my MCP tools fail most this week, and from which agent?"

Send to PostHog

If you use PostHog, the same calls can go to PostHog's MCP analytics as well, in its own format, so its MCP dashboards fill too. Once POSTHOG_PROJECT_KEY is set on the server, they're sent unless you turn off Send MCP events to PostHog under the Overview. Without the key, or with the switch off, no MCP data leaves your server.

  • Tool calls are sent as $mcp_tool_call (calls to a tool that doesn't exist as $mcp_unknown_tool), with PostHog's $mcp_* properties, including $mcp_intent when the agent said what it was doing.
  • What agents ask for is sent as $mcp_missing_capability, and their ratings and notes as $mcp_feedback.
  • Tool lists and handshakes are sent as counts, not one event each: every few seconds, a $mcp_tools_list or $mcp_initialize per app and version with a count of how many there were. Sum count in PostHog to see them. These events aren't about any person.
  • Each tool call is about the signed-in person's id, or the hashed key of a signed-out caller, never an email address. Location lookup is off, and contact details in an agent's user agent, name and version are taken out.
  • Your own log is written first. Sending happens afterwards and in the background, so PostHog being slow or down never fails or slows an agent's call. Turning sending off also drops events still waiting to go.

To change or drop events before they leave, give analytics.beforeSend in your app file; see Hooks: What goes to PostHog.

Something unclear or missing? Ask us and we'll answer, then fix the page.

Was this page helpful?

Built with Overlays