Skip to content

docs(mcp-analytics): specify the initialize event option - #141

Merged
gesh merged 3 commits into
mainfrom
georgis/mcp-initialize-capture-option
Oct 28, 2026
Merged

gesh merged 3 commits into
mainfrom
georgis/mcp-initialize-capture-option

Conversation

@gesh

@gesh gesh commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Problem

Follow-up, stacked on this PR: #142 adds the same option for $mcp_tools_list.

Changes

  • The Configuration table gets an initialize event row, on by default. The name says "event", not "capture", because SDKs with a manual client already have a method such as PostHogMCP.captureInitialize(). The SDK options are sendInitializeEvent and send_initialize_event.
  • The Optional events requirement now says that 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.
  • The same requirement says that the SDK SHALL NOT send an $exception for a failed initialize, with the option on or off. Both SDKs work this way today.
  • A new @mcp_initialize_capable tag and two scenarios: one event per legacy initialize by default, and none with the option off while the session holds.
  • The change follows the propose, apply and archive workflow. It lives under openspec/changes/archive/2026-10-23-mcp-initialize-capture-option/.

Testing

  • openspec validate --specs --strict --no-interactive with CI's pinned 1.4.1 passes all 67 specs.
  • Not run: the new scenarios. PostHog/posthog-sdk-test-harness has no MCP step bindings yet. tasks.md lists that as a follow-up.

🤖 Agent context

  • Autonomy: human-driven, agent-assisted.
  • Tool and model: Claude Code, claude-opus-5-5.

🤖 Generated with Claude Code

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>

@lucasheriques lucasheriques left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, approving. One optional wording note inline.

Comment thread openspec/specs/mcp-analytics/spec.md Outdated
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 68ffabf: the SDK SHALL NOT send an $exception for a failed initialize, with the option on or off. Both SDKs work this way today. In 38b2727 I also renamed the option to "initialize event", to match sendInitializeEvent in posthog-js#5401.

gesh and others added 2 commits October 28, 2026 11:52
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>
@gesh gesh changed the title docs(mcp-analytics): specify the initialize capture option docs(mcp-analytics): specify the initialize event option Oct 28, 2026
@gesh
gesh merged commit e30059a into main Oct 28, 2026
10 checks passed
@gesh
gesh deleted the georgis/mcp-initialize-capture-option branch October 28, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants