Repository navigation
Claude Desktop strips structuredContent from ui/notifications/tool-result — views built per SDK examples render blank #696
Description
Summary
Claude Desktop (macOS 1.18286.2, checked 2026-07-07) delivers the ui/notifications/tool-result notification to the app view without the structuredContent field, even when the server's CallToolResult includes it. Every SDK example and pattern reads the view's data from result.structuredContent in ontoolresult, so an app built exactly per the docs mounts, completes the handshake, receives the result, renders nothing, reports ~zero height via auto-resize and is collapsed to an invisible widget. There is no error anywhere: server logs look healthy and the chat just shows no widget.
Environment
- Claude Desktop 1.18286.2, macOS (Darwin 25.5)
@modelcontextprotocol/ext-apps1.7.4,@modelcontextprotocol/sdk1.29.0- Local stdio server, pre-bundled with esbuild; view bundled with vite-plugin-singlefile
- Tool registered via
registerAppToolwith_meta.ui.resourceUri, aninputSchemaand anoutputSchema; resource registered viaregisterAppResourcewithRESOURCE_MIME_TYPE
What the server returns
return {
content: [{ type: "text", text: "…spec as fenced json…" }],
structuredContent: { spec },
_meta: { "weave/spec": spec },
};tools/list advertises the matching outputSchema (declaring it made no difference, tested both ways).
Evidence
-
Instrumented the view to print its lifecycle into the widget. In Claude Desktop it shows the handshake completing and then:
tool result received but no structuredContent.spec attachedSo the sandbox runs the view,
ui/initializesucceeds, the tool-result notification arrives — withstructuredContentmissing. -
The identical built view under an emulated host (iframe + postMessage, responding to
ui/initializeand then sendingui/notifications/tool-resultwith the fullCallToolResult) renders correctly and reports its size. The app side follows the protocol; the host delivery differs. -
Desktop's MCP server log shows the healthy half:
tools/callreturning normally andresources/readfetching the view HTML. The stripping happens between the host receiving the result and forwarding it to the view. -
A second app on the same machine (single-tool Mermaid viewer built from the SDK examples, verified working end-to-end in Claude Desktop in May 2026) now shows the same symptom for its
structuredContent-dependent path. Its editor still fills viaui/notifications/tool-input, which suggests tool-input is forwarded intact while tool-result is stripped ofstructuredContent.
Expected
Per the spec's data-delivery section, results forwarded to the view include content and optionally structuredContent, with structuredContent/_meta being the channels that do not enter model context. The view should receive structuredContent when the server provided it.
Workaround
Duplicate the payload into the content text (e.g. a fenced JSON block) and parse it in the view when structuredContent is absent. Ugly, but it renders on current Desktop while staying compatible with spec-following hosts.
Possibly related
- Properly clarify content model visibility - content vs structuredContent vs _meta #380 (clarifying content vs structuredContent vs
_metavisibility) - basic-host does not forward toolResult _meta to the ui. #646 (basic-host not forwarding tool-result
_meta)
🤖 Generated with Claude Code
Activity
hydrosquall commentedon Jul 29, 2026
Hi @Shepherd-Creative , can you share which MCP server you used for your first test
Local stdio server, pre-bundled with esbuild; view bundled with vite-plugin-singlefile? Was it one of the example apps inside the ext-apps repository?jirispilka commentedon Jul 30, 2026
Not OP, but to @hydrosquall's question — it's not specific to their setup. We hit the exact same thing with our production server (mcp.apify.com, source; ext-apps 1.7.2, SDK 1.29.0). Claude Desktop (Linux + macOS) delivers
ui/notifications/tool-resultto the view with onlycontent/isError—structuredContentis already gone on the wire, whileui/notifications/tool-inputarrives intact. Same server works fine on claude.ai and MCP Jam.Useful find: the host's
tools/callproxy is NOT affected — calling the same tool from inside the view returns the full result includingstructuredContent. So instead of duplicating the payload intocontent(model context tax), the view can capture the args fromtool-inputand re-call its tool viaapp.callServerTool()whenstructuredContentis missing — idempotent tools only. Shipped here if you want to look at it: apify/apify-mcp-server#1187. All our widgets render in Claude Desktop again.fix: Recover widget structuredContent stripped by Claude Desktop (#1187)
v2.7.0: transient-network retry (#8), viewer fallback for stripped st…
fix: Recover widget structuredContent stripped by Claude Desktop (#1187)
refactor(mcp): widgets use the official MCP Apps SDK `App` instead of…