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

For a Go, Ruby, or Rust server, follow that language's page below. For a language without an SDK, ask your coding agent to follow /docs/mcp-analytics/installation/other-languages.md.

Install by hand

Choose your server's language. For tools that a web page registers, choose WebMCP:

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 server 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:

FeatureTypeScriptPythonGoRubyRust
Tool calls and failures ($mcp_tool_call, $exception)YesYesYesYesYes
Tool listings and handshakesYesYesNoYesYes
Resource readsYesYesNoYesNo
Unknown-tool calls ($mcp_unknown_tool)NoNoYesNoYes
input_required rounds ($mcp_input_required)NoNoYesNoYes
Agent intent (context argument)YesYesYesYesYes
Intent fallback callbackYesYesYesYesYes
Model captureYesYesYesYesYes
Conversation IDsYesYesYesYesYes
Identifying usersYesYesYesYesYes
Missing capabilities (get_more_tools)YesYesYesYesYes
Stateless session tokenYesYesNoYesNo
Custom dispatchersYesYesYesYesYes
WizardYesYesNoNoNo
SupportBetaBetaBetaExperimentalExperimental

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

Still have questions?

Was this page useful?