claude-code - 💡(How to fix) Fix Feature: Preview tool should support rendering MCP Apps (ext-apps) [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48132Fetched 2026-04-15 06:32:15
View on GitHub
Comments
1
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2commented ×1cross-referenced ×1

The Claude Preview tool (preview_start / preview_screenshot) currently only supports localhost dev servers. It should also support rendering MCP Apps (text/html;profile=mcp-app resources) inline — the same way claude.ai web and Claude Desktop already do.

Root Cause

The Claude Preview tool (preview_start / preview_screenshot) currently only supports localhost dev servers. It should also support rendering MCP Apps (text/html;profile=mcp-app resources) inline — the same way claude.ai web and Claude Desktop already do.

Fix Action

Workaround

Currently we work around this by:

  1. Creating a standalone HTML page that fetches data from a static JSON file
  2. Serving it via python3 -m http.server through the Preview tool
  3. Manually piping MCP tool output into the JSON file

This loses all the benefits of MCP Apps (bidirectional data flow, live updates, tool calls from the app).

RAW_BUFFERClick to expand / collapse

Summary

The Claude Preview tool (preview_start / preview_screenshot) currently only supports localhost dev servers. It should also support rendering MCP Apps (text/html;profile=mcp-app resources) inline — the same way claude.ai web and Claude Desktop already do.

Context

MCP Apps are interactive HTML interfaces returned by MCP servers via structured_content + ui:// resources. They're already supported by Claude Desktop, claude.ai, VS Code Copilot, Cursor, ChatGPT, Goose, and others per the MCP client matrix.

When an MCP tool declares _meta.ui.resourceUri pointing to a ui:// resource, the host should:

  1. Fetch the HTML resource from the MCP server
  2. Render it in a sandboxed iframe
  3. Pass structured_content from tool results to the app via postMessage

Current behavior

  • Claude Code CLI receives structured_content from MCP tools but ignores it — only the TextContent fallback is shown
  • The Preview tool can render localhost dev servers but has no integration with MCP App resources
  • External links in previewed pages are blocked (expected), but there's no way to render MCP App HTML that communicates with its MCP server

Proposed behavior

When an MCP tool result includes structured_content and the tool has a ui.resourceUri, Claude Code should:

  1. Fetch the MCP App HTML resource via ReadMcpResourceTool
  2. Render it in the Preview panel (sandboxed iframe)
  3. Bridge structured_content to the app via the ext-apps postMessage protocol
  4. Support bidirectional tool calls (app → MCP server) through the existing MCP connection

This would give Claude Code feature parity with Claude Desktop for MCP Apps rendering.

Workaround

Currently we work around this by:

  1. Creating a standalone HTML page that fetches data from a static JSON file
  2. Serving it via python3 -m http.server through the Preview tool
  3. Manually piping MCP tool output into the JSON file

This loses all the benefits of MCP Apps (bidirectional data flow, live updates, tool calls from the app).

References

extent analysis

TL;DR

To support rendering MCP Apps inline, modify the Claude Preview tool to fetch and render MCP App HTML resources via a sandboxed iframe and establish a postMessage protocol for bidirectional communication.

Guidance

  • Integrate the ReadMcpResourceTool to fetch MCP App HTML resources when a tool result includes structured_content and a ui.resourceUri.
  • Render the fetched HTML in a sandboxed iframe within the Preview panel to ensure security.
  • Implement the ext-apps postMessage protocol to bridge structured_content from tool results to the MCP App and support bidirectional tool calls.
  • Review the MCP Apps client matrix and SDK documentation to ensure compatibility and adherence to the protocol standards.

Example

No explicit code example is provided due to the complexity and specificity of the integration required. However, the process involves using the ReadMcpResourceTool to fetch resources and setting up an iframe with appropriate sandboxing and postMessage handling.

Notes

The implementation details may vary based on the specific requirements of the Claude Preview tool and the MCP Apps protocol. Ensuring security through proper sandboxing and protocol adherence is crucial.

Recommendation

Apply a workaround by integrating the ReadMcpResourceTool and implementing the necessary postMessage protocol until a full fix is available, as this approach aligns with the proposed behavior and leverages existing tools and protocols.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature: Preview tool should support rendering MCP Apps (ext-apps) [1 comments, 1 participants]