Menu

1 / 2

Build apps inside Claude: MCP Apps in Angular with ngx-mcp-apps

DEV Community: angular·Umbo·4 days ago
#oiaazrWn
#devtoangular#devto#dev#host#server
Long article (1208 words) — no AI summary yet.
Reading 0:00
15s threshold

An MCP App is a small web page that a chat host shows inside the conversation when the model calls a tool: a chart, a form, a list to tick, instead of a wall of text. The page runs in a sandboxed iframe and talks to the host with JSON-RPC over postMessage .

I wanted to write those pages in Angular, the way I write any other Angular application. Two things were in the way:

The protocol. The handshake, the tool input and result, theme and display mode changes, teardown: all of it arrives as messages that you have to listen for, check and turn into state.

The build. A host loads the app from one HTML resource. ng build gives you an index.html plus scripts, styles, fonts and lazy chunks.

So I made ngx-mcp-apps : a library that speaks the protocol and exposes it as signals, and a builder that turns ng build into a single HTML file. It is an unofficial community project, MIT licensed.

How the pieces talk

1. model ──► host "call show_chart" 2. host ──► MCP server tools/call, resources/read (ui://…) 3.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.