part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
MCP Apps lets a tool return an interactive HTML interface (charts, forms, viewers) that the host renders inside the conversation, in an isolated iframe. For a governance platform it introduces a new surface: third-party web code running on the user's client.
_meta.ui.resourceUri in its definition, pointing to a ui:// resource. The host may preload it before calling the tool.resources/read; it contains HTML (usually with bundled JS and CSS). It may load external resources only from the origins allowed in _meta.ui.csp; it may request permissions (microphone, camera…).postMessage. Some messages are the core ones (tools/call), others similar (ui/initialize) and most are new with the ui/ prefix. The app can request tool calls, send messages, update the model's context and receive data from the host; the host controls what it can do (e.g. which tools it may invoke, whether it may open links).sequenceDiagram
participant U as User
participant H as Host
participant A as App (iframe)
participant S as Server
H->>S: tools/call
S-->>H: result
H-->>A: result pushed to the app
U->>A: interacts
A->>H: tools/call (postMessage)
H->>S: tools/call (forwarded, with policy)
S-->>H: data
H-->>A: data
Client: extensions["io.modelcontextprotocol/ui"] = { "mimeTypes": ["text/html;profile=mcp-app"] }. Server: advertises io.modelcontextprotocol/ui in discover. Mandatory fallback: the tool must return useful textual content for clients without the extension.
Isolation via sandboxed iframe + postMessage as the only channel + host control over capabilities. The host can restrict invocable tools and disable capabilities such as sendOpenLink. Client support: Claude, Claude Desktop, VS Code Copilot, Microsoft 365 Copilot, Goose, Postman, MCPJam, Archestra, among others (see the matrix).
The @modelcontextprotocol/ext-apps SDK (optional App class; the postMessage protocol can be implemented by hand), App Bridge for hosts, @mcp-ui/client (React). The Inspector CLI has --app-info to find out whether a tool ships a UI, its ui://, CSP and permissions without invoking it, and --advertise-apps to advertise the extension.
csp; deny sensitive permissions; log every tools/call originating from an app with the origin marker.ui:// resources (hash of the HTML) to detect changes.1. How does a tool reference its MCP App interface?
The host fetches the ui:// resource with resources/read and renders it.
2. Over which channel do app and host communicate?
The sandboxed iframe only talks via postMessage.
3. What must a tool with a UI return to a client that does not support the extension?
Graceful degradation documented by the extension.