Repository navigation
fix(spec): use ui/initialize and appInfo in transport handshake example - #810
Open
kristian-presso wants to merge 1 commit into
Open
kristian-presso wants to merge 1 commit into
kristian-presso wants to merge 1 commit into
Conversation
The "Transport Layer" example showing how to talk to the host without an SDK sent MCP's `initialize` with `capabilities`/`clientInfo`. The View <-> Host handshake is `ui/initialize` with `appInfo`/`appCapabilities` (McpUiInitializeRequest), so hosts that validate the request reject the example as written. Fix the example in both the 2026-01-26 and draft specs and follow it with `ui/notifications/initialized`, which the host waits for before sending anything to the View. Fixes modelcontextprotocol#634 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DyfRBGJuWRersRLswfqPwd
This branch has not been deployed
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.
Fixes the SDK-free handshake example in the "Transport Layer" section of the 2026-01-26 and draft specs, which sends MCP's
initializeinstead ofui/initialize.Motivation and Context
The example under "Note that you don't need an SDK to 'talk MCP' with the host" ended with:
That is the shape of MCP's client-to-server
initialize, not the View-to-Host handshake. The rest of the spec, andMcpUiInitializeRequestinsrc/spec.types.ts, define the handshake asui/initializewithappInfo,appCapabilitiesandprotocolVersion. Hosts that validate the request reject the example as written (#634 shows theparams.appInfovalidation error from a production host), so the View never becomes visible.The draft spec (
specification/draft/apps.mdx) had the same block.Changes, in both files:
initializebecomesui/initializeclientInfobecomesappInfo;capabilities: {}becomesappCapabilities: {availableDisplayModes: ["inline"]}(the spec says Views MUST declare their display modes)initializeui/notifications/initializedafterwards, because the Host MUST NOT send anything to the View until it gets that notification, so code copied from the example would otherwise never receive tool inputThe
protocolVersionvalues are unchanged. The MCPinitializeexample under "Client (Host) Capabilities" is correct, since it is the host-to-server handshake, so this PR leaves it alone.How Has This Been Tested?
McpUiInitializeRequestwithtsc --noEmitand parsed it with the generatedMcpUiInitializeRequestSchema. The new example passes and the old one fails.McpUiInitializedNotification.npm test: 438 pass, 2 skip, 0 fail.npm run prettier: clean.npm exec typedoc -- --treatValidationWarningsAsErrors --emit none: clean.The
.mdxspec files are not in the repo's Prettier glob. Running Prettier on them directly reports pre-existing style issues onmain, so I left them alone to keep this diff small.Breaking Changes
None. This only changes docs.
Types of changes
Checklist
Additional context
Fixes #634
AI assistance disclosure: prepared with Claude Code, which I use as my coding agent. It found the affected examples, checked the corrected request against
spec.types.tsand the generated Zod schema, made the edit and drafted this description. Happy to answer questions on any of it.🤖 Generated with Claude Code