McpAppFrame: a copy-paste SEP-1865 host renderer for MCP Apps

mr_someonee · reddit · 2026-09-02

MCP Apps is now official and the big hosts render them, but building your own host (inspector, agent console, internal chat tool) means implementing the hard parts of the spec yourself: sandboxed iframe, CSP from resource metadata, the ui/initialize handshake, proxying tools/call back to your client, size-changed resizing, and teardown.

The author shipped all of that as a shadcn-style copy-paste component: npx mcp-elements add mcp-app-frame drops the source into your repo. It's runtime-free—you pass callTool/readResource from whatever MCP client you already use (@modelcontextprotocol/sdk, mcp-use); a plain-TypeScript state machine lives in a core package for wiring without React. It also ships the screens every host rebuilds: a tool-call card with a real 6-state machine, OAuth consent dialog, scope inspector, JSON-Schema→form, resource browser, and server status badge. React, Angular, and Vue, MIT licensed, plus a live demo doing the real JSON-RPC handshake inside the frame.

Original post →

More from coding & agent

coding & agent channel →