Install MCP Analytics
Contents
MCP Analytics captures how agents use your MCP server. Add the SDK for your server's language, and every tool call becomes a $mcp_tool_call event in PostHog.
Install with the wizard
The wizard detects your server, installs the SDK, and adds the instrumentation. It supports TypeScript and Python servers, and LLM coding agents such as Cursor:
Install by hand
Choose your server's language:
Each page has a Markdown version for coding agents. Add .md to the URL, such as /docs/mcp-analytics/installation/python.md.
What each SDK captures
Every SDK sends the core events, $mcp_tool_call for each tool call and $exception for each failed call, so your insights and dashboards work across languages. The SDKs differ in which other events and features they implement:
| Feature | TypeScript | Python | Go | Ruby |
|---|---|---|---|---|
Tool calls and failures ($mcp_tool_call, $exception) | Yes | Yes | Yes | Yes |
| Tool listings, handshakes, and resource reads | Yes | Yes | No | Yes |
Unknown-tool calls ($mcp_unknown_tool) | No | No | Yes | No |
input_required rounds ($mcp_input_required) | No | No | Yes | No |
Agent intent (context argument) | Yes | Yes | Yes | Yes |
| Intent fallback callback | Yes | Yes | No | Yes |
| Model capture | Yes | Yes | Yes | Yes |
| Conversation IDs | Yes | Yes | Yes | Yes |
| Identifying users | Yes | Yes | Yes | Yes |
Missing capabilities (get_more_tools) | Yes | Yes | No | Yes |
| Stateless session token | Yes | Yes | No | Yes |
| Custom dispatchers | Yes | Yes | Yes | Yes |
| Wizard | Yes | Yes | No | No |
| Support | Beta | Beta | Beta | Experimental |
The Go SDK sends no $identify event.
All SDKs remove credentials and binary content from captured payloads. See Privacy.