From 949e3caabea84058e17bc446760b904fde2ae655 Mon Sep 17 00:00:00 2001 From: Kristian Papadakis <98982554+kristian-presso@users.noreply.github.com> Date: Fri, 16 Oct 2026 15:56:58 +0100 Subject: [PATCH] fix(spec): use ui/initialize and appInfo in transport handshake example 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 #634 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DyfRBGJuWRersRLswfqPwd --- specification/2026-01-26/apps.mdx | 8 +++++--- specification/draft/apps.mdx | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/specification/2026-01-26/apps.mdx b/specification/2026-01-26/apps.mdx index 43fef209d..6a43000a3 100644 --- a/specification/2026-01-26/apps.mdx +++ b/specification/2026-01-26/apps.mdx @@ -458,11 +458,13 @@ function onNotification(method: string, handler: (params: any) => void) { } -const initializeResult = await sendRequest("initialize", { - capabilities: {}, - clientInfo: {name: "My UI", version: "1.0.0"}, +// The View <-> Host handshake is `ui/initialize` (not MCP's `initialize`) +const initializeResult = await sendRequest("ui/initialize", { + appCapabilities: {availableDisplayModes: ["inline"]}, + appInfo: {name: "My UI", version: "1.0.0"}, protocolVersion: "2026-01-26", }); +sendNotification("ui/notifications/initialized", {}); ``` Hosts act as MCP servers (that can proxy the actual MCP server), receiving and handling requests from UI iframes. diff --git a/specification/draft/apps.mdx b/specification/draft/apps.mdx index f2523f25e..948c4516b 100644 --- a/specification/draft/apps.mdx +++ b/specification/draft/apps.mdx @@ -477,11 +477,13 @@ function onNotification(method: string, handler: (params: any) => void) { } -const initializeResult = await sendRequest("initialize", { - capabilities: {}, - clientInfo: {name: "My UI", version: "1.0.0"}, +// The View <-> Host handshake is `ui/initialize` (not MCP's `initialize`) +const initializeResult = await sendRequest("ui/initialize", { + appCapabilities: {availableDisplayModes: ["inline"]}, + appInfo: {name: "My UI", version: "1.0.0"}, protocolVersion: "2025-06-18", }); +sendNotification("ui/notifications/initialized", {}); ``` Hosts act as MCP servers (that can proxy the actual MCP server), receiving and handling requests from UI iframes.