Skip to content

Generative UI

Text is a poor interface for many tasks: picking a time, filling a form, comparing options, exploring a chart. Moka supports the two open standards that let agents show real UI in the chat.

MCP Apps

Server-authored HTML apps. An MCP server ships a ui:// resource; Moka renders it in a sandboxed iframe and connects it to the conversation over JSON-RPC. Rich, custom, fully interactive.

MCP Apps →

A2UI

Declarative, native UI. The agent sends JSON describing components (cards, forms, buttons…) and Moka renders them with its own design system. Safe by construction, works with any model.

A2UI →

MCP AppsA2UI
Authored byThe MCP server developer (HTML/JS)The model or the server (JSON)
RenderingSandboxed iframeNative components in Moka’s design system
FlexibilityAnything a web page can doStandard component catalog
Security modelIsolated origin + CSP; app can only talk via postMessageNo code runs — data only
Best forDashboards, maps, editors, rich visualisationsForms, confirmations, choices, cards, generated on the fly
Talks back viatools/call, ui/message, …Button actions → [ui action] message to the agent

Start Moka with the built-in demo server and ask:

  • “Roll 3 dice” → roll_dice returns an MCP App: an interactive dice roller whose Roll again button calls the tool itself, and Tell the assistant posts a message into the chat.
  • “Book a table at Toit for 4” → book_table returns A2UI from an MCP server: a booking form with date/time, party size and notes.
  • “Show me a signup form” → the model itself generates A2UI with the built-in render_ui tool.

An MCP App rendered in Moka

Servers built with the earlier MCP-UI convention — tool results that embed a resource with a ui:// URI and text/html or text/uri-list content — also render, and their tool, prompt, link, intent and notify messages are supported.