Skip to content

feat: MCP Apps (ext-apps) UI rendering support#2706

Closed
wesleysanjose wants to merge 1 commit intoarchestra-ai:mainfrom
wesleysanjose:feat/mcp-apps-ui
Closed

feat: MCP Apps (ext-apps) UI rendering support#2706
wesleysanjose wants to merge 1 commit intoarchestra-ai:mainfrom
wesleysanjose:feat/mcp-apps-ui

Conversation

@wesleysanjose
Copy link
Copy Markdown

Summary

  • Preserve _meta from MCP CallToolResult through the entire backend pipeline (mcp-clientCommonToolResultmcp-gateway.utilschat-mcp-client)
  • Add readResource() to McpClient for fetching ui:// resources via the MCP SDK resources/read method
  • Render MCP App UI in sandboxed iframes in chat tool output using the srcdoc attribute
  • Support postMessage-based iframe resize per the ext-apps spec

How it works

  1. When an MCP tool returns _meta.ui.resourceUri, the backend immediately reads the HTML resource from the same MCP server connection
  2. The HTML is wrapped alongside _mcpMeta in the tool result JSON that flows to the frontend
  3. The frontend ToolOutput component detects the _appHtml field and renders it in a sandboxed iframe
  4. The iframe only has allow-scripts — no access to parent page, cookies, or navigation

Files changed

File Change
common-llm-format.ts Add _meta field to CommonToolResult
mcp-client.ts Preserve _meta in createSuccessResult, add readResource() method
mcp-gateway.utils.ts Forward _meta in MCP Gateway tool call responses
chat-mcp-client.ts Wrap _mcpMeta + _appHtml in tool output, read ui:// resources
tool.tsx Extract MCP metadata, render McpAppFrame with srcdoc
mcp-client.test.ts Add 5 new tests for _meta preservation and readResource
platform-chat.md Document MCP Apps UI feature

Test plan

  • All 2402 backend tests pass (36 mcp-client, 18 mcp-gateway)
  • TypeScript type-check passes (backend + frontend)
  • Biome lint passes
  • Manual test with an MCP server that returns _meta.ui.resourceUri

Closes #1301

🤖 Generated with Claude Code

Implement end-to-end MCP Apps support following the ext-apps spec:

Backend:
- Preserve _meta from MCP tool call results through the entire pipeline
  (mcp-client → CommonToolResult → mcp-gateway.utils → chat-mcp-client)
- Add readResource() method to McpClient for fetching ui:// resources
- When _meta.ui.resourceUri is detected, automatically read the HTML
  resource and embed it in the tool result for frontend rendering

Frontend:
- Extract _mcpMeta and _appHtml from wrapped tool output in ToolOutput
- Render MCP App HTML in sandboxed iframe via srcdoc attribute
- Support postMessage-based iframe resize (100-800px range)

Tests:
- Add _meta preservation tests (with and without _meta)
- Add readResource tests (success, empty contents, tool not found)
- All 2402 backend tests pass

Closes archestra-ai#1301

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown
Contributor

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@London-Cat
Copy link
Copy Markdown
Collaborator

London-Cat commented Feb 10, 2026

📊 Reputation Summary

User Rep Pull Requests Activity Assigned Core Reactions
joeyorlando ⚡ 2162 87✅ 4🔄 9❌ 100 issues, 50 comments 6
wesleysanjose ⚡ 3 0✅ 1🔄 0❌ 0 issues, 1 comments 0
CLAassistant ⚡ 0 0✅ 0🔄 0❌ 0 issues, 50 comments 0

How is the score calculated? Read about it in the Reputation Bot repository 🤖

@joeyorlando
Copy link
Copy Markdown
Contributor

hi there @wesleysanjose 👋 do you have a demo video showing how this works with two MCP servers which return "MCP-UI compatible responses"?

@Emins25 Emins25 mentioned this pull request Feb 12, 2026
@iskhakov iskhakov closed this Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support MCP Apps

5 participants