@posthog/mcp
1.6.1 · 21 Nov 2026MIT780.1k / weekRepositorynpmAtom feed
101 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.7.0
23 Nov 2026Group tool calls into sessions by the client's own conversation id in
_meta: ChatGPT'sopenai/session, Codex'ssessionId, and VS Code'svscode.conversationId, each read only from the client itsUser-Agentor client name identifies. The client's id wins over a conversation handle and a transport session. ChatGPT gets noconversation_idargument and no handle, so its tool schemas and results stay unchanged. Every event frominstrument()now records which source grouped it as$mcp_session_source.PostHogMCP.prepareToolListandprepareToolCalltake the request'sheaders(andclientInfo), andcaptureToolCalltakesrequestMeta.
(2026-11-23)
1.6.1
21 Nov 2026PostHogMCPadds 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)
1.6.0
18 Nov 2026Support 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)
1.5.0
18 Nov 2026Support 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)
1.4.0
18 Nov 2026Classify 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)
1.3.0
17 Nov 2026Add
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)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)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)
Minor Changes
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)
Patch Changes
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)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)Accepts posthog-node 6.x.x as a peer dependency.
(2026-11-17)
1.2.3
16 Nov 2026instrumentMutator(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)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)
1.2.2
13 Nov 2026Fix 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.The token is no longer left on
transport.sessionIdafter the response. Host code that read it there should read theMcp-Session-Idheader the client replays instead. (2026-11-13)
1.2.1
12 Nov 2026mcp: 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)
Patch Changes
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)
1.2.0
12 Nov 2026A failed tool call now sets
$mcp_error_statusto the HTTP status behind it, read from the thrown error or itscausechain (status_code,statusCodeorstatus, on the error or itsresponse, as a fetchResponse, axios and got carry it). Failures from an upstream API now group by status in MCP Analytics instead of landing in "unknown".
(2026-11-12)Ignore non-string
name/versionvalues returned by theclientInfooption instead of recording them as the MCP client.
(2026-11-12)
1.1.1
11 Nov 2026mcp: Keep
additionalProperties: falseon tool schemas when injectingcontext,llm_modelandconversation_id. The injected keys are declared properties, so the schema stays valid and keeps the strictness the host advertised.
(2026-11-11)
1.1.0
10 Nov 2026Add
sessionIdandclientInfooptions so stateless per-request servers can supply the session id and client name for each request
(2026-11-10)
Minor Changes
Add
sessionIdandclientInfooptions so stateless per-request servers can supply the session id and client name for each request
(2026-11-10)
1.0.1
9 Nov 2026Fix intent and payload capture bugs: a long digit run no longer drops
$mcp_intentwith a stack overflow (card redaction is otherwise unchanged), captured tool arguments are limited before they are sanitized and credential-named arguments are not walked, and$mcp_feedback_<name>object extras redact identifiers in keys and numbers. A parsed__proto__argument is still dropped, as before.
(2026-11-09)
Patch Changes
Fix intent and payload capture bugs: a long digit run no longer drops
$mcp_intentwith a stack overflow (card redaction is otherwise unchanged), captured tool arguments are limited before they are sanitized and credential-named arguments are not walked, and$mcp_feedback_<name>object extras redact identifiers in keys and numbers. A parsed__proto__argument is still dropped, as before.
(2026-11-09)
1.0.0
6 Nov 2026- 0.26.x
0.26.0
6 Nov 2026Aligned with the MCP analytics spec: a call to a tool the server never registered now emits
$mcp_unknown_toolinstead of a failed$mcp_tool_call,llm_modelis advertised as optional, theget_more_toolsandsend_feedbackannotations now declare that they record data, and the injectedcontextargument has a shorter description. A server whose own dispatcher bypasses the MCP SDK's tool registry (such as@rekog/mcp-nest) keeps recording calls to unknown names as failed tool calls, since the SDK cannot tell whether such a tool exists. On a low-level server,resolveOriginalToolreturningundefinednow marks a failing call as an unknown tool, so return a tool for every name your server serves. Strings cut to a property limit (such as 256 characters for names and 2,048 for intent and error text) now stop exactly at the limit,...included, instead of 3 characters past it.PostHogMCPcapture methods called without asessionIdnow send a fresh$session_idper call, and anonymous calls use it as their distinct id instead of the shared"anonymous". This changes your published tool definitions; if your server is listed in the ChatGPT or Claude directories, those platforms may re-review the updated tools.
(2026-11-06)
- 0.25.x
0.25.2
6 Nov 2026Parse Node stack frames for functions named
asyncwithout a leading parenthesis in the filename.
(2026-11-06)
Patch Changes
Parse Node stack frames for functions named
asyncwithout a leading parenthesis in the filename.
(2026-11-06)
0.25.1
6 Nov 2026Reworded the descriptions of the injected
conversation_idandllm_modelarguments and theget_more_toolsandsend_feedbackvirtual tools so they describe the field instead of instructing the model. This changes your published tool definitions; if your server is listed in the ChatGPT or Claude directories, those platforms may re-review the updated tools.
(2026-11-05)
0.25.0
28 Oct 2026Add a
sendToolsListEventoption. It is on by default. Set it tofalseto stop sending$mcp_tools_list.
(2026-10-28)
- 0.24.x
0.24.0
28 Oct 2026Add a
sendInitializeEventoption. It is on by default. Set it tofalseto stop sending$mcp_initialize.
(2026-10-28)
- 0.23.x
0.23.0
19 Oct 2026Stop sending standalone
$identifyevents, so insights, funnels, or cohorts built on MCP$identifystop receiving new data. Theidentifycallback still setsdistinct_id,$setand$groupson every event.
(2026-10-19)
- 0.22.x
0.22.3
9 Oct 2026Set
$mcp_interfacetomcpon events from MCP servers.
(2026-10-09)
0.22.2
7 Oct 2026Sanitize each tool response once instead of twice, and replace image, audio and binary blocks before the scan, so tool calls with large results cost less CPU. Redact PostHog tokens that URL field decoding exposes.
(2026-10-07)
Patch Changes
Sanitize each tool response once instead of twice, and replace image, audio and binary blocks before the scan, so tool calls with large results cost less CPU. Redact PostHog tokens that URL field decoding exposes.
(2026-10-07)
0.22.1
6 Oct 2026Capture WebMCP tool intent and model metadata by default.
(2026-10-06)
Patch Changes
Capture WebMCP tool intent and model metadata by default.
(2026-10-06)
0.22.0
5 Oct 2026Strip SDK-owned analytics arguments on fresh low-level server instances through
resolveOriginalTool.
(2026-10-05)
- 0.21.x
0.21.4
2 Oct 2026Make oversized events cheaper to truncate. The depth reduction now starts at the first depth that removes anything, so shallow payloads such as rows of data no longer normalize and measure the whole event again for each depth that changes nothing.
(2026-10-02)
0.21.3
2 Oct 2026Sanitize only the part of a long string that the captured event can keep, so a tool call returning megabytes of HTML or text no longer blocks the event loop while it is scanned. A 10 MB HTML response now costs about 5 ms to capture instead of 2.7 s. The captured event does not change.
(2026-10-02)
0.21.2
30 Sep 2026Stop copying the full tool list into
$mcp_responseon$mcp_tools_listevents, so instrumented servers answertools/listfaster.
(2026-09-30)
Patch Changes
Stop copying the full tool list into
$mcp_responseon$mcp_tools_listevents, so instrumented servers answertools/listfaster.
(2026-09-30)
0.21.1
30 Sep 2026Add the configured server build to custom events captured through
PostHogMCP.
(2026-09-30)
0.21.0
28 Sep 2026Add optional MCP server build metadata
(2026-09-28)
- 0.20.x
0.20.0
28 Sep 2026Record declared input aliases in automatic MCP instrumentation.
(2026-09-28)
- 0.19.x
0.19.0
28 Sep 2026Record which declared parameter aliases a tool call relied on as
$mcp_input_aliases_used, from a server-ownedinputAliasesmap.
(2026-09-28)Record safe tool input field names for automatic and custom MCP servers. Unknown names are
[redacted]by default;shouldRecordInputKeyreplaces that rule.
(2026-09-28)
- 0.18.x
0.18.1
25 Sep 2026Keep MCP conversation sessions consistent across user messages.
(2026-09-25)
0.18.0
23 Sep 2026Add conversation and session correlation helpers for custom MCP dispatchers.
(2026-09-23)
- 0.17.x
0.17.0
17 Sep 2026Enable model capture and conversation correlation by default. Advertised tool schemas gain an
llm_modelargument (never enforced at dispatch) and eligible tool results gain a conversation handle;instrument(server, posthog, { captureModel: false, enableConversationId: false })restores the previous shape. Fresh low-level instances now read both arguments under the ADR-0011 rule instead of staying silent.
(2026-09-17)
- 0.16.x
0.16.4
17 Sep 2026Use conversation IDs for
get_more_toolsandsend_feedbackcalls handled by fresh server instances.
(2026-09-17)
0.16.3
16 Sep 2026Inject the get_more_tools tool only on the first tools/list page, so a paginated catalogue's concatenated listing carries it once instead of once per page. A real first-page tool with the same name still wins (warning logged); a real tool on a later page is shadowed, with a warning when a client fetches that page — rename the SDK's tool with the
missingCapabilityToolNameoption if your catalogue uses the name.
(2026-09-16)
0.16.2
15 Sep 2026Inject the send_feedback tool only on the first tools/list page (the request with no cursor), so a paginated catalogue's concatenated listing carries it once instead of once per page. A real first-page tool with the same name still wins: the SDK warns, skips injection, and forwards its calls. A real tool that only appears on a later page is not detected — the SDK logs a warning when a client fetches that page; rename the SDK's tool with
collectFeedback: { toolName }if your catalogue uses the name.
(2026-09-15)
0.16.1
14 Sep 2026Harden feedback validation, error handling, and tool-name collision routing.
(2026-09-14)
0.16.0
11 Sep 2026Add the
send_feedbackvirtual tool (newcollectFeedbackoption): an honest, general agent-feedback channel with missing capabilities as the priority category. Every call emits a new$mcp_feedbackevent with$mcp_feedback_typeand the other$mcp_feedback_*properties. Hosts can rename the tool, replace its description, declareextraProperties(captured as$mcp_feedback_<key>), and route reports to a real backend viaonFeedback(instrument()path) orprepareToolCall().feedbackReport+captureFeedback()+sendFeedbackResult()(custom-dispatcher path).reportMissing/get_more_tools/$mcp_missing_capabilityare unchanged; new integrations should enable onlycollectFeedback.
(2026-09-11)
- 0.15.x
0.15.0
10 Sep 2026Capture resource discovery and reads from instrumented MCP servers. URL credential redaction (userinfo, credential-named query and fragment parameters) now applies to every captured string, including existing
$mcp_tool_callparameters, responses, and error messages, so URLs already flowing through tool-call data will show%5Bredacted%5Dvalues after upgrading.
(2026-09-10)
- 0.14.x
0.14.1
9 Sep 2026error-tracking: Collapse repeated frame cycles in parsed stack traces to reduce grouping differences caused by recursion depth, while preserving distinct throw locations
(2026-09-09)
Patch Changes
error-tracking: Collapse repeated frame cycles in parsed stack traces to reduce grouping differences caused by recursion depth, while preserving distinct throw locations
(2026-09-09)
0.14.0
8 Sep 2026Capture model identity from recognized client metadata before falling back to the injected
llm_modelargument.
(2026-09-08)
- 0.13.x
0.13.1
7 Sep 2026Reduce personal data in
$mcp_intent, which is agent-narrated free text and could previously carry personal data a model read aloud.context: falseandbeforeSendremain the ways to drop the field entirely. (2026-09-07)
Patch Changes
Reduce personal data in
$mcp_intent, which is agent-narrated free text and could previously carry personal data a model read aloud.Automatically redact structured personal identifiers — email addresses, phone numbers, IPv4/IPv6 addresses, Luhn-valid card numbers, and US SSNs — from
$mcp_intentbefore it is captured. Redaction is always on, scoped to the intent only (structured toolargumentsand results are untouched, since the same shapes are often legitimate data there), and best-effort for those well-defined shapes rather than free-form names or addresses. Identifiers grouped with Unicode spaces, dots, or slashes (as produced by copy-paste) and SSNs with space/dot separators are recognized. The email pattern uses bounded quantifiers so a pathological intent cannot cause quadratic-time backtracking.Strengthen the default injected
contextprompt so agents are less likely to write personal data in the first place: the privacy rule is now explicit and lists the identifiers to avoid, and it tells the agent to refer to people and accounts by role ('a user', 'the customer') rather than by identity.
context: falseandbeforeSendremain the ways to drop the field entirely. (2026-09-07)
0.13.0
3 Sep 2026Add self-reported model capture to the
PostHogMCPcustom-dispatcher path. The preparation helpers preserve application-owned fields and work across stateless server replicas when given the original tool descriptor. Tool calls and missing-capability reports can record the model properties.
(2026-09-03)
Minor Changes
Add self-reported model capture to the
PostHogMCPcustom-dispatcher path. The preparation helpers preserve application-owned fields and work across stateless server replicas when given the original tool descriptor. Tool calls and missing-capability reports can record the model properties.
(2026-09-03)
- 0.12.x
0.12.0
27 Aug 2026Add opt-in
captureModeloption: injects a requiredllm_modelparameter into every tool — including theget_more_toolsvirtual tool — so the calling agent self-reports the model it runs as, captured as$mcp_llm_modelwith$mcp_llm_model_source = "self_reported". Stripping the argument before the handler runs and capturing the property both require confirmed SDK ownership of the parameter: a customer-declaredllm_modelis never stolen or captured, and a low-levelServerthat builds a fresh instance per request records nothing (see the README). An honest"unknown"from the agent is dropped rather than recorded.
(2026-08-27)
Minor Changes
Add opt-in
captureModeloption: injects a requiredllm_modelparameter into every tool — including theget_more_toolsvirtual tool — so the calling agent self-reports the model it runs as, captured as$mcp_llm_modelwith$mcp_llm_model_source = "self_reported". Stripping the argument before the handler runs and capturing the property both require confirmed SDK ownership of the parameter: a customer-declaredllm_modelis never stolen or captured, and a low-levelServerthat builds a fresh instance per request records nothing (see the README). An honest"unknown"from the agent is dropped rather than recorded.
(2026-08-27)
- 0.11.x
0.11.7
18 Aug 2026Reading the note…
0.11.6
13 Aug 2026Reading the note…
0.11.5
13 Aug 2026Reading the note…
0.11.4
10 Aug 2026Reading the note…
0.11.3
10 Aug 2026Reading the note…
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.