Key details

  1. PostHog changelog dates the WebMCP analytics addition October 23, 2026.
  2. Enable through `capture_webmcp: true` in `posthog-js`.
  3. Records `$mcp_tool_call` and optionally `$exception` on failed calls.
  4. Links instrumented calls to existing browser user/session context.
  5. `context` and `llm_model` schema fields are injected and stripped before tool handlers run.
  6. No browser tool arguments or tool results are captured by this integration.
  7. WebMCP tools registered before PostHog initialisation are not instrumented.
  8. Agent model and intent metadata should be treated as unverified self-reporting.

What builders should take away

  1. Instrument only the WebMCP tools you intentionally expose, and initialise PostHog before tool registration.
  2. Use tool-call and error events to measure which structured agent actions are used, not to count every agent or crawler visiting the site.
  3. Avoid treating an agent's claimed model or intent as authenticated identity, security evidence or billable usage.
  4. Audit consent and redaction settings before collecting agent-written context.
  5. Compare tool-use events with conversion and session metrics to test whether agent-friendly flows actually help users.

What changed

On October 23, 2026, PostHog added WebMCP tool-call analytics to its JavaScript browser SDK. A site that registers tools using WebMCP can enable `capture_webmcp: true` in `posthog.init()` and have calls recorded as `$mcp_tool_call` events. The instrumentation associates calls with the site's current user/session and can capture an agent-supplied `context` explanation and `llm_model` field. The SDK injects these fields into compatible tool schemas and removes them before invoking the site's handler. Tool arguments and tool results are not captured on this browser path.

Why it matters

Conventional website analytics observes clicks, pageviews and conversions but misses structured actions initiated by an AI agent inside a browser. This addition gives sites exposing WebMCP tools a way to inspect which tools are used, whether calls fail and what goal an agent says it is pursuing. That can guide product design, agent compatibility and debugging. It does not reveal every AI agent visiting a site: crawlers, ordinary HTTP requests, uninstrumented browser actions and tools registered before initialisation are outside this measurement.

Opt in before tools are registered

PostHog documents `posthog.init('<token>', { api_host: 'https://us.i.posthog.com', capture_webmcp: true })`. Initialise the SDK before the page registers WebMCP tools. Tools registered earlier are not retroactively instrumented, so rollout order matters.

A shared analytics event for browser agents

The SDK emits `$mcp_tool_call` and can associate it with the same user, session and replay context as conventional website activity. Failed calls may also generate `$exception` when exception autocapture is enabled. This connects browser-agent tool use to existing product analytics without requiring a separate server-side MCP endpoint.

Intent and model metadata are not verified identities

By default the SDK can inject a `context` parameter asking an agent to explain why it called the tool and an `llm_model` parameter. These are agent-provided or client-derived hints, not proof of which provider or model made the call. Both fields can be disabled independently; changing those settings requires registering the tools again.

Privacy protections have specific boundaries

PostHog says the browser integration does not capture tool arguments or results, and redacts credentials and common personal data from context and error messages. Site consent, opt-out and `before_send` hooks still apply. These safeguards do not replace an operator's own data minimisation and privacy assessment.

WebMCP remains an emerging browser interface

The underlying WebMCP standard is still experimental in browsers. The feature is useful to websites intentionally exposing browser tools, not a universal agent-traffic detector. PostHog's public September issue explains why earlier MCP server instrumentation could not see tool calls executed directly in a web page.

What to watch next

  • Stable browser adoption and changes to WebMCP's API surface.
  • Evidence that WebMCP analytics improves debugging, conversion or agent-tool design.
  • Changes to PostHog's redaction and metadata-capture defaults.
  • Other analytics platforms adopting compatible browser-agent event schemas.

Still unclear

  • No independent deployment benchmark establishes measurement accuracy across browsers and agents.
  • The feature observes instrumented WebMCP tools, not general AI crawler or browser traffic.
  • Agent-supplied intent/model values may be absent, inaccurate or adversarial.
  • Underlying WebMCP browser support is still experimental.

Sources

Direct reading behind this dossier.

3 sources

Discussion

Discussion is reader-contributed. Comments are not part of the BTN dossier or its editorial evidence.

0 visible comments

Join the discussion

Keep comments useful and relevant. Reader contributions may be moderated and are not BTN editorial evidence.

Sign in to comment