MCP Ext Apps
Sample implementation of MCP Apps Extension (SEP-1865) - interactive HTML/JS UIs through MCP tools.
mcp-app-ext.mov
Quick Start
How It Works
Host Client MCP Server
┌────────────────────┐ ┌──────────────┐
│ tools-sidebar │ ── call tool ─> │ Tools: │
│ app-container │ <── HTML UI ─── │ - dashboard │
│ [sandboxed iframe]│ │ - clock │
└────────────────────┘ └──────────────┘
localhost:8080 localhost:3001
- Host connects to MCP server, lists tools
- User clicks a tool, host calls it via MCP
- Tool returns
text/html+mcpresource withui://URI - Host renders in sandboxed iframe with CSP
- UI communicates via JSON-RPC 2.0 over
postMessage
SEP-1865 Compliance
ui://scheme for resource URIstext/html+mcpMIME type_meta.ui/resourceUriin tool responsesui/initializehandshake protocol- JSON-RPC 2.0 message format
- Sandboxed iframe with CSP headers
Scripts
npm start # Build + start server npm run server # MCP server (port 3001) npm run host # Host client (port 8080)
License
MIT