Documentation
¶
Overview ¶
Package ui serves the interactive task board that hosts render inside the conversation.
It implements the MCP Apps extension (spec 2026-01-26): the server advertises the ui extension capability, exposes an HTML document under the ui:// scheme, and points a tool at that document through _meta.ui.resourceUri. The host then renders the HTML in a sandboxed iframe and proxies the view's own tool calls back to this server — which is what lets the board keep refreshing after the tool call that opened it has already returned.
Hosts that do not implement the extension ignore all of this and fall back to the tool's text result, so registering it costs nothing on those clients.
Index ¶
Constants ¶
const ExtensionName = "io.modelcontextprotocol/ui"
ExtensionName is the capability key hosts look for to decide whether this server can render views.
const MIMEType = "text/html;profile=mcp-app"
MIMEType is the only content type the spec permits for a UI resource; other values are reserved for future extensions.
const ResourceURI = "ui://cli-agent-mcp/task-board.html"
ResourceURI addresses the board. It is both the resource's own URI and the value tools carry in _meta.ui.resourceUri.
Variables ¶
var BoardHTML string
BoardHTML is the whole view — markup, styles and script in a single file. It has to be self-contained: the host renders it under a deny-by-default CSP that blocks external origins, and this server declares no csp allowances.
Functions ¶
func Capability ¶
Capability is the settings object advertised under ExtensionName during initialize.
func ResourceMeta ¶
ResourceMeta carries the board's own rendering preferences.
Types ¶
This section is empty.