@posthog/mcp
1.6.1 · 21 Nov 2026MIT780.1k / weekRepositorynpmAtom feed
Upgrading @posthog/mcp From 0.4.1 to 1.6.1
72 releases in betweennotes for 55
- 1+
- change to make
- 0
- advisories fixed
- 23+
- new
- 41+
- fixes
Counted from 55 of 72 release notes. Advisories are counted from the advisory database, in full.
Before you upgrade
Tick each one off as you go- Breaking1.0.0
Release by release
- Fixed
PostHogMCPadds the configuredserverBuildtocaptureAi()andcaptureAiImmediate()events, as it already does forcapture()andcaptureImmediate(). WithserverBuildset, an event whose properties cannot be read is now dropped by the client, as withoutserverBuild, instead of throwing from any of the four methods. (2026-11-21)
- Fixed
- New
Support FastMCP with
instrumentFastMCP(fastmcp, posthog, options). FastMCP builds a server per session (per request when stateless) behind a private factory, so this hooks the module's session class and instruments each one before it connects. FastMCP's HTTP layer drops request headers, so the adapter puts them back onextra.requestInfo.headersforidentifyand other callbacks. (2026-11-18)
- New
- New
Support Vercel's
mcp-handler. Callinstrument(server, posthog)inside thecreateMcpHandlercallback, and wrap the exported route in the newwithMcpSessionHeaderto keep one$session_idand the client's name per conversation on the2025-11-25protocol. mcp-handler streams theinitializeresponse, so the session token is minted at the fetch layer instead of inside the server. (2026-11-18)
- New
- New
Classify client-caused failures as
$mcp_error_type: "validation". A tool call whose arguments failed the tool's input schema, a call to a disabled tool, a tool that rejected its arguments with JSON-RPC-32602, and a read of an unknown resource now carryvalidationinstead of the thrown error's type, so dashboards can tell an agent's mistake from a server bug. Output-schema failures and malformed tool results, which also use-32602, keep the thrown type. Every failure still sends its$exception, as before. (2026-11-18)
- New
- New
Add
eventOptionsto set posthog-node per-event options on MCP events, per call or from aninstrument()callback.beforeSendsees and can change them, and an explicitprocess_person_profilewins over the anonymous default. (2026-11-17) - Fixed
Genkit spans and
@posthog/mcpevents with no user distinct id set theprocess_person_profile: falseevent option on posthog-node 6.x.x, so a registered or contextprocess_person_profile: trueoption no longer creates a person for each trace or session. Genkit also counts an empty or whitespace-only distinct id as missing. (2026-11-17) - Fixed
Export the table of per-event options and the event properties posthog-node 5.x.x reads instead, so posthog-node,
@posthog/aiand@posthog/mcpshare one copy. (2026-11-17) - Fixed
Accepts posthog-node 6.x.x as a peer dependency. (2026-11-17)
- New
- Fixed
instrumentMutator(posthog)(server)now returns the server's own type instead ofunknown, so no type argument or cast is needed. ExplicitinstrumentMutator<McpServer>(posthog)calls and typedserverMutatorhooks keep working. (2026-11-16) - Fixed
getMoreToolsResult()andsendFeedbackResult()are now typed so they can be returned from an MCP SDK tool handler (v1 and v2CallToolResult) without a cast. (2026-11-16)
- Fixed
- Fixed
Fix stateless servers on
@modelcontextprotocol/server2.0 to 2.2 that reuse one transport for every client: the session token minted atinitializenow rides only that client'sinitializeresponse. Before, it stayed on the transport, so every later client'sinitializefailed with 400 "Server already initialized" and later responses handed the first client's token to other clients. Per-request and multi-pod stateless servers still get a stable session token.
- Fixed
- Fixed
mcp: Keep the thrown value on high-level
McpServertool calls, so$mcp_error_typeand$mcp_error_statusreflect what the tool threw. This covers MCP SDK v2, a thrown value that is not anError, and servers built per request that share tool functions. For a thrown non-Error,$mcp_error_messageand error grouping now describe the thrown value (for example'UpstreamError' captured as exception with message: 'bad') instead of[object Object].$mcp_error_typeis now redacted like the message, including anerrorTypepassed tocaptureToolCall. An error whose getters throw while it is captured is still recorded: a tool call falls back to the tool result, and other events recordUnknown errorinstead of being dropped. (2026-11-12)
- Fixed
23 internal lines (docs, tests, tooling) left out.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.