Skip to content
PluginStats

@posthog/mcp weekly downloads statistics

By posthog (5 listings) · npm · MCP servers

PostHog SDK for Model Context Protocol (MCP) servers — tracks tool usage, intent, and identity

View on npm Fresh · Oct 18, 2026

@posthog/mcp has 246,911 recorded weekly downloads on npm, an increase of 20.2% over the past 30 days, ranking #370 of 2,322 tracked listings.

Weekly downloads
246,911
Official API · Oct 18, 2026
7-day growth
-32.6%
-119.5K weekly downloads
30-day growth
+20.2%
+41.4K weekly downloads
90-day growth
+1150%
+227.2K weekly downloads
Rank
#370
Among tracked npm listings

About @posthog/mcp

PostHog MCP package

Please see the main PostHog docs.

SDK usage examples and code snippets live in the official documentation so they stay up to date.

Documentation

Stateless & multi-pod servers

On stateless deployments the SDK mints the Mcp-Session-Id response header at initialize as a token carrying the session id and client name/version. Clients replay the header on every request, so any pod keeps $session_id and $mcp_client_name/$mcp_client_version stable with no server-side store.

The SDK publishes no standalone $identify event. The identify callback runs on every request, on any pod, and stamps distinct_id and $set onto each event it sends.

Streamable HTTP: set enableJsonResponse: true

The token is minted onto the Mcp-Session-Id response header from inside the initialize handler, so it only reaches the client when the transport builds the response after the handler runs — i.e. JSON mode. In SSE (streaming) mode StreamableHTTPServerTransport flushes the response headers before the handler runs, so the minted header never lands and behavior silently falls back to a session-per-request. This is a property of the transport, so it applies to every Streamable-HTTP host — set enableJsonResponse: true (and use a fresh transport per request):

// @modelcontextprotocol/sdk
new StreamableHTTPServerTransport({ sessionIdGenerator: undefined, enableJsonResponse: true })

// Cloudflare agents / createMcpHandler (SSE is the default)
createMcpHandler(server, { enableJsonResponse: true })

// @rekog/mcp-nest
McpModule.forRoot({ streamableHttp: { enableJsonResponse: true } })
If you must stream (SSE)

Set the header yourself at the HTTP layer with the exported encodeSessionId (read clientInfo from the initialize body) — the SDK decodes it either way:

import { MCP_SESSION_HEADER, encodeSessionId, newSessionId } from '@posthog/mcp'

// after parsing the POST body, before flushing headers:
if (body?.method === 'initialize' && !req.headers[MCP_SESSION_HEADER]) {
  res.setHeader(
    MCP_SESSION_HEADER,
    encodeSessionId({
      sessionId: newSessionId(),
      clientName: body.params?.clientInfo?.name,
      clientVersion: body.params?.clientInfo?.version,
    })
  )
}

Details: docs/ARCHITECTURE.md §4.

MCP TypeScript SDK v2

instrument() works on both SDK majors — @modelcontextprotocol/sdk v1 and @modelcontextprotocol/{core,server,client} v2 — and on both the high-level McpServer and the low-level Server. Shapes are detected at runtime, so neither major is a dependency here.

Sessions and client identity on a v2 server

Protocol revision is a property of each request, not of the server: a v2 server serves both 2025-11-25 and 2026-07-28 traffic, and the SDK is instrumented once for both.

  • On 2026-07-28 there is no initialize and no session header — the revision removed protocol-level sessions, and this SDK will not mint one. Session correlation therefore comes from enableConversationId, which is on by default. Without it every request is its own $session_id. The get_more_tools and send_feedback virtual tools also use this handle, including calls handled by a fresh server instance.

  • On 2025-11-25, the session id and the client's name and version are exchanged once at initialize. If your server builds a fresh McpServer per HTTP request — which createMcpHandler does by default — the instance serving a later tools/call never saw that handshake. The SDK bridges it by minting the Mcp-Session-Id token described above, which the client replays on every request.

    That token only reaches the client if the transport builds response headers after the handler runs. @rekog/mcp-nest with enableJsonResponse: true does; createMcpHandler's legacy leg does not, and there is no setting we can reach from inside the server. On that leg, expect $mcp_client_name and $mcp_client_version to be absent for 2025-11-25 traffic — the protocol version still arrives, because clients send it on the MCP-Protocol-Version header of every request.

Reading request headers in a callback

If your identify, intentFallback, eventProperties or beforeSend reads HTTP headers, it has to change. The two majors put the request in different places and in different shapes: v1 attaches a plain object at extra.requestInfo.headers, v2 attaches the WHATWG Request at extra.http.req, whose headers only answers to .get(). A v1-shaped read returns undefined on v2 — an identify() written that way returns null and every event goes anonymous.

The SDK hands your callback whatever the MCP SDK handed it, unchanged; it does not fake a v1 shape on v2, because a partially synthesised requestInfo is a more convincing lie than an absent one. Read headers through the exported helper instead, which handles both majors, lowercases keys, and duck-types Headers so it also works on edge runtimes:

import { getRequestHeaders } from '@posthog/mcp'

identify: async (request, extra) => {
  const auth = getRequestHeaders(extra)?.['authorization'] // v1 and v2
  // ...
}
What $mcp_intent records, and how to turn it off

context defaults to on: the SDK adds a context parameter to every tool it advertises, asks the agent to say why it is calling, and records the answer as $mcp_intent. It is stripped before your tool runs wherever the SDK can confirm the parameter is its own.…

Description from the npm listing.

  • posthog
  • mcp
  • model-context-protocol
  • analytics
  • llm

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@posthog/mcp weekly downloads on npm, last 90 days: 246,911 weekly downloads as of Oct 18, 2026, +1150% over 90 days.@posthog/mcpWeekly downloads on npm · Last 90 days246,911downloads / week+1150% over 90 days0100K200K300K400KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
@posthog/mcp weekly downloads on npm, last 90 days: 246,911 weekly downloads as of Oct 18, 2026, +1150% over 90 days.

7/30/90-day growth

@posthog/mcp weekly downloads growth on npm: -32.6% over 7 days, +20.2% over 30 days, +1150% over 90 days.@posthog/mcpWeekly downloads growth on npm246,911downloads / week now7-day growth-119,496 weekly downloads-32.6%30-day growth+41,445 weekly downloads+20.2%90-day growth+227,163 weekly downloads+1150%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@posthog/mcp weekly downloads growth on npm: -32.6% over 7 days, +20.2% over 30 days, +1150% over 90 days.

Ranking history

@posthog/mcp npm ranking history: currently #370 (by weekly downloads).@posthog/mcpnpm ranking · by weekly downloads · Last 90 days#370current rank#100#150#200#250#300#350#400Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 17, 2026 – Oct 20, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
@posthog/mcp npm ranking history: currently #370 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 19, #10 (overall #370)
All npm: every listing in weekly downloads order

Listing placement

MCP servers277 listings · 14 pages · page 2, #7 (overall #27)
MCP servers: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (544)
Recent weekly downloads observations for @posthog/mcp
Date (UTC)Weekly downloadsChange vs. previous
246,911+67.8K
179,129-41.8K
220,892+917
219,975-82.6K
302,580-74.1K
376,6530
376,653+10.2K
366,407+7K
359,417+12.7K
346,751+20.3K
326,479+22K
304,487+14.5K
290,016-56.5K
346,552—

Similar npm MCP servers plugins

All 20 @posthog/mcp alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@posthog/mcp. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.