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:

Learn more

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:

FeatureTypeScriptPythonGoRuby
Tool calls and failures ($mcp_tool_call, $exception)YesYesYesYes
Tool listings, handshakes, and resource readsYesYesNoYes
Unknown-tool calls ($mcp_unknown_tool)NoNoYesNo
input_required rounds ($mcp_input_required)NoNoYesNo
Agent intent (context argument)YesYesYesYes
Intent fallback callbackYesYesNoYes
Model captureYesYesYesYes
Conversation IDsYesYesYesYes
Identifying usersYesYesYesYes
Missing capabilities (get_more_tools)YesYesNoYes
Stateless session tokenYesYesNoYes
Custom dispatchersYesYesYesYes
WizardYesYesNoNo
SupportBetaBetaBetaExperimental

The Go SDK sends no $identify event.

All SDKs remove credentials and binary content from captured payloads. See Privacy.

Still have questions?

Was this page useful?