You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp): support conversations in custom dispatchers (#982)
* feat(mcp): support conversations in custom dispatchers
Port posthog-js#5074 to PostHogMCP. Custom dispatchers now correlate
calls through an agent-carried conversation_id and a derived session id,
like instrument() already does.
- enable_conversation_id constructor option, on by default
- prepare_tool_list() injects conversation_id and _mcp_instructions
- prepare_tool_call() accepts a carried session_id and returns the
resolved session_id and conversation_id
- new prepare_tool_result() delivers a minted handle without mutating
the original result
- capture methods accept conversation_id
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(mcp): preserve conversation result isolation
Generated-By: PostHog Desktop
Task-Id: 6fa508f7-af04-48ef-b7ea-31732d3ca42e
* fix(mcp): keep custom results dependency-free
Generated-By: PostHog Desktop
Task-Id: 6fa508f7-af04-48ef-b7ea-31732d3ca42e
* fix(mcp): preserve dispatcher conversation ownership
Generated-By: PostHog Desktop
Task-Id: 6fa508f7-af04-48ef-b7ea-31732d3ca42e
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add conversation and session correlation to custom `PostHogMCP` dispatchers, matching `@posthog/mcp`. `prepare_tool_list()` adds an optional `conversation_id` field to each compatible tool input schema and a compatible `_mcp_instructions` output field. `prepare_tool_call()` accepts a carried `session_id`. The new `prepare_tool_result()` delivers a minted handle without changing the original result. Tool and report capture methods accept `conversation_id`. Existing dispatchers must call `prepare_tool_result()` to deliver new handles. Set `PostHogMCP(enable_conversation_id=False)` to keep the previous behavior.
0 commit comments