Repository navigation
docs(mcp-analytics): specify the initialize event option - #141
Merged
Merged
Conversation
Add an initialize capture option, on by default, to the Configuration table. The Optional events requirement now says that with the option off, the SDK sends no $mcp_initialize and changes nothing else. Two scenarios under a new @mcp_initialize_capable tag cover the default and the option off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
gesh
marked this pull request as ready for review
October 23, 2026 14:08
lucasheriques
approved these changes
Oct 26, 2026
lucasheriques
left a comment
Contributor
There was a problem hiding this comment.
LGTM, approving. One optional wording note inline.
Comment on lines
+617
to
+620
| - `$mcp_initialize` for a legacy `initialize`, unless the host turns the initialize capture option | ||
| off (see "Configuration"). With the option off, the SDK SHALL NOT send `$mcp_initialize`, and SHALL | ||
| change nothing else: the session token, `$session_id`, and the client and server identity of later | ||
| events stay the same. |
Contributor
There was a problem hiding this comment.
optional: #142 spells out that the $exception of a failed listing goes too. Might be worth one clause here saying the same for a failed initialize (or that none is sent either way), so a new SDK doesn't have to guess.
Member
Author
SDKs with a manual client already have a method that captures $mcp_initialize by hand, such as PostHogMCP.captureInitialize(). The option is now "initialize event", so that a new SDK does not give the option and the method the same name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new SDK had to guess whether a failed initialize sends an $exception. The spec now says that it does not, with the initialize event option on or off. This is what posthog-js and posthog-python do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Draft
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
$mcp_initializecan outnumber$mcp_tool_call.Follow-up, stacked on this PR: #142 adds the same option for
$mcp_tools_list.Changes
PostHogMCP.captureInitialize(). The SDK options aresendInitializeEventandsend_initialize_event.$mcp_initializeand SHALL change nothing else. The session token,$session_id, and the client and server identity of later events stay the same.$exceptionfor a failedinitialize, with the option on or off. Both SDKs work this way today.@mcp_initialize_capabletag and two scenarios: one event per legacyinitializeby default, and none with the option off while the session holds.openspec/changes/archive/2026-10-23-mcp-initialize-capture-option/.Testing
openspec validate --specs --strict --no-interactivewith CI's pinned 1.4.1 passes all 67 specs.tasks.mdlists that as a follow-up.🤖 Agent context
claude-opus-5-5.🤖 Generated with Claude Code