Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(mcp): document mcp analytics properties in taxonomy (#65225)

Lucas Faria6186078ef021
diff --git a/frontend/src/lib/components/EventPropertyTabs/EventPropertyTabs.tsx b/frontend/src/lib/components/EventPropertyTabs/EventPropertyTabs.tsx
index a45dbdb8f6a7..674f8e951a12 100644
--- a/frontend/src/lib/components/EventPropertyTabs/EventPropertyTabs.tsx
+++ b/frontend/src/lib/components/EventPropertyTabs/EventPropertyTabs.tsx
@@ -61,7 +61,8 @@ export const EventPropertyTabs = ({
const isErrorEvent = event.event === '$exception'
const isSurveyResponseEvent = event.event === 'survey sent'
const isMcpEvent =
- typeof event.event === 'string' && (event.event.startsWith('mcp_') || event.event.startsWith('mcp '))
+ typeof event.event === 'string' &&
+ (event.event.startsWith('mcp_') || event.event.startsWith('$mcp_') || event.event.startsWith('mcp '))
const { filterProperties } = useValues(eventPropertyFilteringLogic)
diff --git a/frontend/src/taxonomy/core-filter-definitions-by-group.json b/frontend/src/taxonomy/core-filter-definitions-by-group.json
index 2ba34e603bd4..f378b4bfbc9e 100644
--- a/frontend/src/taxonomy/core-filter-definitions-by-group.json
+++ b/frontend/src/taxonomy/core-filter-definitions-by-group.json
@@ -2147,6 +2147,14 @@
"description": "Whether the MCP tool call failed. True if the tool returned an error result or threw an exception.",
"label": "MCP is error"
},
+ "$mcp_listed_tool_names": {
+ "description": "Array of every tool name advertised to the agent on a tools/list request, in multi-tool mode. Stored as a JSON array \u2014 filter with `contains` against a single tool name (e.g. 'execute-sql'). Lets you compute zombie tools (advertised but never called) by diffing against $mcp_tool_name from mcp_tool_call events. In single-exec mode the catalog rides on $mcp_exec_inner_tool_names instead. Only present on mcp_tools_list.",
+ "examples": [
+ "execute-sql",
+ "feature-flag-get-all"
+ ],
+ "label": "MCP listed tool names"
+ },
"$mcp_mode": {
"description": "Which tool-registration mode the MCP server ran in for this request. 'cli' is single-exec mode (the v2 wrapper that exposes one dispatcher tool taking a `call <tool> ...` command); 'tools' exposes every tool individually.",
"examples": [
@@ -2229,6 +2237,16 @@
],
"label": "MCP source"
},
+ "$mcp_tool_category": {
+ "description": "The product category the invoked tool belongs to \u2014 the grouping dimension the MCP analytics dashboard buckets tool calls by. Stamped server-side from the tool catalog (PostHog's server) or declared per tool (external servers). Omitted when the tool has no catalogued category (e.g. the `exec` dispatcher), which the dashboard buckets as 'Uncategorized'. Present on mcp_tool_call.",
+ "examples": [
+ "Error tracking",
+ "Logs",
+ "Feature flags",
+ "Session replays"
+ ],
+ "label": "MCP tool category"
+ },
"$mcp_tool_description": {
"description": "The MCP tool's description as advertised to the agent at the time of the call. Useful when triaging errors to see what the agent thought the tool would do \u2014 descriptions change over time, so the value captured here is the version the agent actually saw. Only present on mcp_tool_call and the paired $exception event.",
"examples": [
@@ -3471,14 +3489,65 @@
"description": "Older unprefixed variant of $mcp_protocol_version. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_protocol_version for new dashboards.",
"label": "MCP protocol version (unprefixed)"
},
+ "mcp_runtime": {
+ "description": "Server runtime that handled the MCP request. 'hono' means it was served by the Hono-based MCP server.",
+ "examples": [
+ "hono"
+ ],
+ "label": "MCP runtime"
+ },
+ "mcp_session_client_name": {
+ "description": "MCP client name captured at session initialize and carried across every request in that session. Session-scoped counterpart of $mcp_client_name.",
+ "examples": [
+ "claude-code",
+ "codex-mcp-client"
+ ],
+ "label": "MCP session client name"
+ },
+ "mcp_session_client_version": {
+ "description": "MCP client version captured at session initialize and carried across every request in that session.",
+ "label": "MCP session client version"
+ },
+ "mcp_session_consumer": {
+ "description": "Upstream surface that initiated the MCP session, captured at session initialize. Session-scoped counterpart of $mcp_consumer.",
+ "examples": [
+ "posthog-code",
+ "slack"
+ ],
+ "label": "MCP session consumer"
+ },
"mcp_session_id": {
"description": "Older unprefixed variant of $mcp_session_id. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_session_id for new dashboards.",
"label": "MCP session ID (unprefixed)"
},
+ "mcp_session_protocol_version": {
+ "description": "MCP protocol version negotiated at session initialize and carried across every request in that session.",
+ "examples": [
+ "2025-11-25",
+ "2025-06-18"
+ ],
+ "label": "MCP session protocol version"
+ },
+ "mcp_session_vendor_client": {
+ "description": "Vendor client captured at session initialize and carried across every request in that session.",
+ "examples": [
+ "ClaudeCode",
+ "ClaudeAI"
+ ],
+ "label": "MCP session vendor client"
+ },
"mcp_transport": {
"description": "Older unprefixed variant of $mcp_transport. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_transport for new dashboards.",
"label": "MCP transport (unprefixed)"
},
+ "mcp_vendor_client": {
+ "description": "Vendor/client identity derived from the request context for the MCP call (e.g. the coding agent or app behind the request).",
+ "examples": [
+ "ClaudeCode",
+ "ClaudeAI"
+ ],
+ "label": "MCP vendor client"
+ },
"mcp_version": {
"description": "Older unprefixed variant of $mcp_version. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_version for new dashboards.",
"label": "MCP server version (unprefixed, internal)",
@@ -6503,6 +6572,14 @@
"description": "Whether the MCP tool call failed. True if the tool returned an error result or threw an exception.",
"label": "MCP is error"
},
+ "$mcp_listed_tool_names": {
+ "description": "Array of every tool name advertised to the agent on a tools/list request, in multi-tool mode. Stored as a JSON array \u2014 filter with `contains` against a single tool name (e.g. 'execute-sql'). Lets you compute zombie tools (advertised but never called) by diffing against $mcp_tool_name from mcp_tool_call events. In single-exec mode the catalog rides on $mcp_exec_inner_tool_names instead. Only present on mcp_tools_list.",
+ "examples": [
+ "execute-sql",
+ "feature-flag-get-all"
+ ],
+ "label": "MCP listed tool names"
+ },
"$mcp_mode": {
"description": "Which tool-registration mode the MCP server ran in for this request. 'cli' is single-exec mode (the v2 wrapper that exposes one dispatcher tool taking a `call <tool> ...` command); 'tools' exposes every tool individually.",
"examples": [
@@ -6585,6 +6662,16 @@
],
"label": "MCP source"
},
+ "$mcp_tool_category": {
+ "description": "The product category the invoked tool belongs to \u2014 the grouping dimension the MCP analytics dashboard buckets tool calls by. Stamped server-side from the tool catalog (PostHog's server) or declared per tool (external servers). Omitted when the tool has no catalogued category (e.g. the `exec` dispatcher), which the dashboard buckets as 'Uncategorized'. Present on mcp_tool_call.",
+ "examples": [
+ "Error tracking",
+ "Logs",
+ "Feature flags",
+ "Session replays"
+ ],
+ "label": "MCP tool category"
+ },
"$mcp_tool_description": {
"description": "The MCP tool's description as advertised to the agent at the time of the call. Useful when triaging errors to see what the agent thought the tool would do \u2014 descriptions change over time, so the value captured here is the version the agent actually saw. Only present on mcp_tool_call and the paired $exception event.",
"examples": [
@@ -7822,14 +7909,65 @@
"description": "Older unprefixed variant of $mcp_protocol_version. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_protocol_version for new dashboards.",
"label": "MCP protocol version (unprefixed)"
},
+ "mcp_runtime": {
+ "description": "Server runtime that handled the MCP request. 'hono' means it was served by the Hono-based MCP server.",
+ "examples": [
+ "hono"
+ ],
+ "label": "MCP runtime"
+ },
+ "mcp_session_client_name": {
+ "description": "MCP client name captured at session initialize and carried across every request in that session. Session-scoped counterpart of $mcp_client_name.",
+ "examples": [
+ "claude-code",
+ "codex-mcp-client"
+ ],
+ "label": "MCP session client name"
+ },
+ "mcp_session_client_version": {
+ "description": "MCP client version captured at session initialize and carried across every request in that session.",
+ "label": "MCP session client version"
+ },
+ "mcp_session_consumer": {
+ "description": "Upstream surface that initiated the MCP session, captured at session initialize. Session-scoped counterpart of $mcp_consumer.",
+ "examples": [
+ "posthog-code",
+ "slack"
+ ],
+ "label": "MCP session consumer"
+ },
"mcp_session_id": {
"description": "Older unprefixed variant of $mcp_session_id. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_session_id for new dashboards.",
"label": "MCP session ID (unprefixed)"
},
+ "mcp_session_protocol_version": {
+ "description": "MCP protocol version negotiated at session initialize and carried across every request in that session.",
+ "examples": [
+ "2025-11-25",
+ "2025-06-18"
+ ],
+ "label": "MCP session protocol version"
+ },
+ "mcp_session_vendor_client": {
+ "description": "Vendor client captured at session initialize and carried across every request in that session.",
+ "examples": [
+ "ClaudeCode",
+ "ClaudeAI"
+ ],
+ "label": "MCP session vendor client"
+ },
"mcp_transport": {
"description": "Older unprefixed variant of $mcp_transport. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_transport for new dashboards.",
"label": "MCP transport (unprefixed)"
},
+ "mcp_vendor_client": {
+ "description": "Vendor/client identity derived from the request context for the MCP call (e.g. the coding agent or app behind the request).",
+ "examples": [
+ "ClaudeCode",
+ "ClaudeAI"
+ ],
+ "label": "MCP vendor client"
+ },
"mcp_version": {
"description": "Older unprefixed variant of $mcp_version. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_version for new dashboards.",
"label": "MCP server version (unprefixed, internal)",
diff --git a/posthog/taxonomy/taxonomy.py b/posthog/taxonomy/taxonomy.py
index 00a2fb5152df..39f991e6e384 100644
--- a/posthog/taxonomy/taxonomy.py
+++ b/posthog/taxonomy/taxonomy.py
@@ -2612,6 +2612,11 @@ CORE_FILTER_DEFINITIONS_BY_GROUP: dict[str, dict[str, CoreFilterDefinition]] = {
"description": "The name of the MCP tool that was invoked. Only present on mcp_tool_call.",
"examples": ["execute-sql", "feature-flag-get-all"],
},
+ "$mcp_tool_category": {
+ "label": "MCP tool category",
+ "description": "The product category the invoked tool belongs to — the grouping dimension the MCP analytics dashboard buckets tool calls by. Stamped server-side from the tool catalog (PostHog's server) or declared per tool (external servers). Omitted when the tool has no catalogued category (e.g. the `exec` dispatcher), which the dashboard buckets as 'Uncategorized'. Present on mcp_tool_call.",
+ "examples": ["Error tracking", "Logs", "Feature flags", "Session replays"],
+ },
"$mcp_tool_description": {
"label": "MCP tool description",
"description": "The MCP tool's description as advertised to the agent at the time of the call. Useful when triaging errors to see what the agent thought the tool would do — descriptions change over time, so the value captured here is the version the agent actually saw. Only present on mcp_tool_call and the paired $exception event.",
@@ -2702,6 +2707,11 @@ CORE_FILTER_DEFINITIONS_BY_GROUP: dict[str, dict[str, CoreFilterDefinition]] = {
"List feature flags in the project.",
],
},
+ "$mcp_listed_tool_names": {
+ "label": "MCP listed tool names",
+ "description": "Array of every tool name advertised to the agent on a tools/list request, in multi-tool mode. Stored as a JSON array — filter with `contains` against a single tool name (e.g. 'execute-sql'). Lets you compute zombie tools (advertised but never called) by diffing against $mcp_tool_name from mcp_tool_call events. In single-exec mode the catalog rides on $mcp_exec_inner_tool_names instead. Only present on mcp_tools_list.",
+ "examples": ["execute-sql", "feature-flag-get-all"],
+ },
"$mcp_exec_inner_tool_names": {
"label": "MCP exec inner tool catalog",
"description": "Array of every inner tool name available to the agent at the time of a tools/list request. Stored as a JSON array — filter with `contains` against a single tool name (e.g. 'execute-sql'). Only stamped on mcp_tools_list events when running in single-exec mode (in multi-tool mode the SDK's $mcp_listed_tool_names already carries the catalog). Lets you compute zombie tools by diffing against $mcp_exec_tool_call_name from mcp_tool_call events.",
@@ -2825,6 +2835,40 @@ CORE_FILTER_DEFINITIONS_BY_GROUP: dict[str, dict[str, CoreFilterDefinition]] = {
"label": "Is error (unprefixed)",
"description": "Older unprefixed variant of $mcp_is_error. Emitted on events from the pre-@posthog/mcp code paths; prefer $mcp_is_error for new dashboards.",
},
+ "mcp_runtime": {
+ "label": "MCP runtime",
+ "description": "Server runtime that handled the MCP request. 'hono' means it was served by the Hono-based MCP server.",
+ "examples": ["hono"],
+ },
+ "mcp_vendor_client": {
+ "label": "MCP vendor client",
+ "description": "Vendor/client identity derived from the request context for the MCP call (e.g. the coding agent or app behind the request).",
+ "examples": ["ClaudeCode", "ClaudeAI"],
+ },
+ "mcp_session_client_name": {
+ "label": "MCP session client name",
+ "description": "MCP client name captured at session initialize and carried across every request in that session. Session-scoped counterpart of $mcp_client_name.",
+ "examples": ["claude-code", "codex-mcp-client"],
+ },
+ "mcp_session_client_version": {
+ "label": "MCP session client version",
+ "description": "MCP client version captured at session initialize and carried across every request in that session.",
+ },
+ "mcp_session_protocol_version": {
+ "label": "MCP session protocol version",
+ "description": "MCP protocol version negotiated at session initialize and carried across every request in that session.",
+ "examples": ["2025-11-25", "2025-06-18"],
+ },
+ "mcp_session_consumer": {
+ "label": "MCP session consumer",
+ "description": "Upstream surface that initiated the MCP session, captured at session initialize. Session-scoped counterpart of $mcp_consumer.",
+ "examples": ["posthog-code", "slack"],
+ },
+ "mcp_session_vendor_client": {
+ "label": "MCP session vendor client",
+ "description": "Vendor client captured at session initialize and carried across every request in that session.",
+ "examples": ["ClaudeCode", "ClaudeAI"],
+ },
"$csp_document_url": {
"label": "Document URL",
"description": "The URL of the document where the violation occurred.",