From 62ecfa7c83ae46003b3549754c7e5ee360141c6e Mon Sep 17 00:00:00 2001 From: shreesh Date: Fri, 23 Oct 2026 00:44:14 +0530 Subject: [PATCH] docs(spec): align examples with the normative text (ui/initialize, teardown, CSP default) - Transport snippet: send "ui/initialize" with appInfo and appCapabilities, as the text ("MUST include its capabilities in the appCapabilities field") and McpUiInitializeRequest in src/spec.types.ts specify, instead of "initialize" with capabilities and clientInfo. - ui/resource-teardown: describe it as a request (it has an id and a response), not a notification. - CSP construction example: fall back to connect-src 'none' when no CSP is declared, matching the "Restrictive Default" section, as the example already does for frame-src. Co-Authored-By: Claude Sonnet 5.5 --- specification/draft/apps.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/draft/apps.mdx b/specification/draft/apps.mdx index f2523f25e..2caefd65b 100644 --- a/specification/draft/apps.mdx +++ b/specification/draft/apps.mdx @@ -477,9 +477,9 @@ function onNotification(method: string, handler: (params: any) => void) { } -const initializeResult = await sendRequest("initialize", { - capabilities: {}, - clientInfo: {name: "My UI", version: "1.0.0"}, +const initializeResult = await sendRequest("ui/initialize", { + appInfo: {name: "My UI", version: "1.0.0"}, + appCapabilities: {}, protocolVersion: "2025-06-18", }); ``` @@ -1392,7 +1392,7 @@ Host MUST send this notification when tool execution completes (if the View is d Host MUST send this notification if the tool execution was cancelled, for any reason (which can optionally be specified), including user action, sampling error, classifier intervention, etc. -`ui/resource-teardown` - Host notifies View before teardown +`ui/resource-teardown` - Host requests graceful teardown of the View (a request: the View replies with a result) ```typescript { @@ -2543,7 +2543,7 @@ const cspValue = ` default-src 'none'; script-src 'self' 'unsafe-inline' ${csp?.resourceDomains?.join(' ') || ''}; style-src 'self' 'unsafe-inline' ${csp?.resourceDomains?.join(' ') || ''}; - connect-src 'self' ${csp?.connectDomains?.join(' ') || ''}; + connect-src ${csp?.connectDomains?.join(' ') || "'none'"}; img-src 'self' data: ${csp?.resourceDomains?.join(' ') || ''}; font-src 'self' ${csp?.resourceDomains?.join(' ') || ''}; media-src 'self' data: ${csp?.resourceDomains?.join(' ') || ''};