Feature: Preview tool should support rendering MCP Apps (ext-apps)

Resolved 💬 2 comments Opened Apr 14, 2026 by afakbas Closed May 26, 2026

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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗