Repository navigation
posthog-v7.75.9
Patch changes
-
8cd8eb5 MCP analytics now sends one
$mcp_initializefor eachinitializerequest that a client sends.Before, the SDK sent the event on the first request of each session, once per process. A stateless fleet sent one event for each pod that a session reached. A conversation-anchored session sent another event. A client that connected and sent no other request sent no event.
On MCP SDK 2.x, the event comes from
Server.middlewareon every transport. Requests on the 2026-07-28 spec, which has noinitialize, no longer send one. On MCP SDK 1.x over HTTP, the event comes fromPostHogMcpStatelessSessionMiddleware. The apps thatinstrument()autowires get this with no change. If you mount the middleware by hand, pass the server asserver=. MCP SDK 1.x over stdio keeps the first request as the trigger.The event now also has the handshake request as
$mcp_parameters. On MCP SDK 2.x, it also has the server reply as$mcp_response. — Thanks @gesh! -
48889b6 The Claude Agent SDK integration now takes the cumulative input and cache token counts from the final
message_deltausage, which grow past themessage_startvalues when server tools such as web search run, and sets$ai_web_search_countfromserver_tool_use.web_search_requests. Streamed generations used to under-report input tokens and cache writes and never recorded the web search count. — Thanks @pcbeingused333!