Conversation IDs
A PostHog $session_id normally follows the MCP protocol session. The handshake-free 2026-07-28 revision has no protocol session, so each request gets a new session unless you add another correlation signal.
$mcp_conversation_id groups those calls by conversation. The SDK also derives $session_id from an accepted conversation handle, so PostHog session queries group the same calls.
Enabling
Conversation IDs are on by default in every SDK, with no configuration.
The SDK does three things:
- Injects an optional
conversation_idargument into compatible tool schemas, with a description telling the agent to reuse the value the server returns. - Creates a handle when needed and returns it on eligible tool responses as a
{"conversation_id":"…"}text block. - Captures the handle as
$mcp_conversation_id. When the agent echoes a valid handle, the SDK derives a stable$session_idfrom it. Until then, existing protocol sessions remain in use.
Event properties
A new request or connection made by the same agent reusing the same conversation_id shares both $mcp_conversation_id and $session_id. You can group by the conversation property in HogQL:
Caveats
The SDK cannot add conversation_id to schemas that use oneOf, allOf, anyOf, or $ref. It also skips a tool that already declares conversation_id. The SDK logs a warning and returns no handle for these tools. Use identify to group their calls by user. In TypeScript, Python, and Ruby, a tool without an input schema gets one that holds only conversation_id.
The handle appears as a {"conversation_id":"…"} text block in tool results. Clients that only read structured output may never echo it.
The SDK only reuses UUIDv7 values that match the shape of handles it can create. It replaces other values with a new handle. A client can still reuse a valid-looking handle across users, so don't use $mcp_conversation_id as a security boundary.
When to skip this
If your MCP server runs over a long-lived 2025-11-25 connection that already matches your conversation boundaries, you can disable conversation IDs. Turn conversation IDs off in your SDK's configuration to omit the injected argument and response block. See your language's installation page for the option name.
Keep it enabled when:
- The same logical conversation crosses connections (HTTP/SSE clients that reconnect).
- Your server handles the
2026-07-28revision and you want more than one request in each PostHog session.





