modelcontextprotocol / modelcontextprotocol/ext-apps

Claude Desktop strips structuredContent from ui/notifications/tool-result — views built per SDK examples render blank

Open
#696 2 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.9k
Forks
387
Avg merge
3h 21m
Merged PRs (30d)
6

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-apps 1.7.4, @modelcontextprotocol/sdk 1.29.0
  • Local stdio server, pre-bundled with esbuild; view bundled with vite-plugin-singlefile
  • Tool registered via registerAppTool with _meta.ui.resourceUri, an inputSchema and an outputSchema; resource registered via registerAppResource with RESOURCE_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

  1. 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 attached

    So the sandbox runs the view, ui/initialize succeeds, the tool-result notification arrives — with structuredContent missing.

  2. The identical built view under an emulated host (iframe + postMessage, responding to ui/initialize and then sending ui/notifications/tool-result with the full CallToolResult) renders correctly and reports its size. The app side follows the protocol; the host delivery differs.

  3. Desktop's MCP server log shows the healthy half: tools/call returning normally and resources/read fetching the view HTML. The stripping happens between the host receiving the result and forwarding it to the view.

  4. 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 via ui/notifications/tool-input, which suggests tool-input is forwarded intact while tool-result is stripped of structuredContent.

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

  • #380 (clarifying content vs structuredContent vs _meta visibility)
  • #646 (basic-host not forwarding tool-result _meta)

🤖 Generated with Claude Code

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using Claude Desktop 1.18286.2 with the supplied server result and an app view that reads structuredContent in ontoolresult. Trace delivery of ui/notifications/tool-result after tools/call and resources/read; done means structuredContent reaches the view as specified without requiring duplication in content.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.