Spec 2026-01-26: misleading "View initialize" example uses `initialize` + `clientInfo` instead of `ui/initialize` + `appInfo`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 88/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- javascript, typescript
调研方向
编辑 specification/2026-01-26/apps.mdx 中 Transport Layer 部分的大约第 455–465 行,并将其与 ui/initialize 部分中的 App Capabilities 以及 specification/draft/apps.mdx 进行比较。更新示例,使其使用 ui/initialize、appInfo 和 appCapabilities,并添加协议层说明;当示例与文档所述的 Apps handshake 一致时即完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The specification/2026-01-26/apps.mdx contains a code example (around lines 455–465, in the "Transport Layer" section) that is framed as the View→Host handshake but uses the
regular MCP initialize method and clientInfo field. The rest of the same spec — and the current draft — define the Apps-dialect handshake as ui/initialize with appInfo /
appCapabilities. The misleading example leads implementers to send a schema-invalid request that compliant hosts (Claude web and Desktop) reject; the iframe container stays at
visibility: hidden and the user only sees the [This tool call rendered an interactive widget…] placeholder.
To Reproduce
Steps to reproduce the behavior:
- Register an MCP Apps tool with _meta.ui.resourceUri and its UI resource with mimeType: "text/html;profile=mcp-app".
- In the UI HTML, implement the handshake exactly as the 2026-01-26 example shows:
window.parent.postMessage({
jsonrpc: "2.0", id: 1, method: "initialize",
params: {
protocolVersion: "2026-01-26",
capabilities: {},
clientInfo: { name: "My UI", version: "1.0.0" }
}
}, "*"); - Add the server as a custom connector in Claude (web or Desktop).
- Call the tool. No iframe appears.
- Try again using the names from the draft spec / the rest of 2026-01-26 (ui/initialize, appInfo, appCapabilities). Handshake succeeds, iframe becomes visible.
Expected behavior
The example in 2026-01-26 should match the method and field names used elsewhere in the same document (and in the current draft):
window.parent.postMessage({
jsonrpc: "2.0", id: 1, method: "ui/initialize",
params: {
protocolVersion: "2026-01-26",
appInfo: { name: "My UI", version: "1.0.0" },
appCapabilities: { availableDisplayModes: ["inline"] }
}
}, "*");
Also worth a one-line note clarifying that regular MCP initialize + clientInfo describes a different protocol layer (server ↔ client), distinct from the Apps-dialect View ↔ Host
handshake.
Logs
Request sent (following the misleading example — note the method and clientInfo):
{
"jsonrpc": "2.0", "id": 1, "method": "ui/initialize",
"params": {
"protocolVersion": "2026-01-26",
"clientInfo": { "name": "ANDY Hello Test", "version": "1.0.0" },
"appCapabilities": { "availableDisplayModes": ["inline"] }
}
}
Host response (Claude web):
{
"jsonrpc": "2.0", "id": 1,
"error": {
"code": -32603,
"message": "[{"expected":"object","code":"invalid_type","path":["params","appInfo"],"message":"Invalid input"}]"
}
}
After renaming clientInfo → appInfo, the host returns a normal McpUiInitializeResult and, after ui/notifications/initialized + ui/notifications/size-changed, the iframe becomes
visible.
Additional context
- Offending location: specification/2026-01-26/apps.mdx, "Transport Layer" section, the const initializeResult = await sendRequest("initialize", { ... clientInfo ... }) block.
- Correct shape is already documented elsewhere in the same spec ("App Capabilities in ui/initialize" section, the mermaid lifecycle diagram) and in specification/draft/apps.mdx
(section "App (Guest UI) Capabilities", line ~2233). - Side observation that made this hard to diagnose: @modelcontextprotocol/ext-apps imported via https://esm.sh/@modelcontextprotocol/ext-apps throws TypeError: t.custom is not a
function in App.connect() (looks like a zod version mismatch in the CDN bundle). That error fires before ui/initialize is sent, masking the real spec/host mismatch. Only a
hand-rolled ~40-line postMessage handshake surfaces the Zod error above from Claude. - Verified against Claude.ai and Claude Desktop custom connector over Streamable HTTP on 2026-04-22.
- Related downstream symptom reports: anthropics/claude-ai-mcp#61, #165 (different root causes, same visible symptom).
- 主要语言
- TypeScript
- 星标
- 2.9k
- 派生
- 401
- 平均合并
- 5 小时 37 分钟
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/ext-apps 的其他 Issue
-
PostMessageTransport: make debug logging opt-in (or accept a logger)可能已有人在做 @gabrieledellamalva 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
modelcontextprotocol/ext-apps#786 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
modelcontextprotocol/ext-apps#767 ·
维护者通常 1 天内回复
-
Documentation for MCP Apps does not match 2026-07-28 specification可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/ext-apps#742 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
modelcontextprotocol/ext-apps#711 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
modelcontextprotocol/ext-apps#706 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/ext-apps 的全部 Issue
相似的 Issue
-
ai-driven-qa bug claude Minor
难度 2/5 1-3 小时 新手友好度 70/100
linagora/twake-contacts-frontend#241 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
ui(ListToolbar): search takes the full row on a phone instead of sharing it with the result count未关闭
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
priority:high
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
ahmedkhaleel2004/gitdiagram#228 ·