MCP Apps
MCP Apps (SEP-1865, extension id io.modelcontextprotocol/ui) is the official Model Context Protocol extension that lets an MCP server ship an interactive HTML view for a tool. The host renders the view in a sandboxed iframe and talks to it over JSON-RPC on postMessage. It is published in the modelcontextprotocol/ext-apps repository. This skill pins the Stable specification dated 2026-01-26 and produces a server, host or view (the app inside the iframe), or a review of one, that meets its MUST-level rules.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. The specification has no section numbers, so citations name its headings, for example (UI Resource Format, Content Requirements). When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: MCP server that offers UI, host (an MCP client that renders views; a web host or a desktop or native host), or view author. Many tasks touch all three.
- Base MCP revision: the core revision the server and host speak. It changes where the extension capability is negotiated (see
references/ui-resources.md). The base protocol itself is covered by themcpskill. - Network needs of the view: which origins it fetches from, loads scripts, styles, fonts or media from, embeds as frames, and whether it needs camera, microphone, geolocation or clipboard write.
- Target version: MCP Apps 2026-01-26 (current, the default; the version the ext-apps README marks Stable). MCP Apps pre-stable drafts are legacy: read them and upgrade from them, never author them. The MCP Apps draft is a preview (posture: name): know its message names and shapes, but do not send draft-only messages. See
references/versions.md. - Revision:
specification/2026-01-26/apps.mdxat ext-apps v2.0.3 (commit 82221c0), unless the user names another. - Sources: when refreshing this skill or when a rule looks out of date, list
specification/in ext-apps for a new dated folder, read the latest release notes and the commit history ofspecification/draft, then re-read every URL in Sources. Update the pins and bump the version.
Invariants
- The extension is negotiated. MCP Apps is optional and MUST be negotiated through the extensions capability under
io.modelcontextprotocol/ui; the host's settings MUST listmimeTypes, for example["text/html;profile=mcp-app"](Overview; Client<>Server Capability Negotiation, Client (Host) Capabilities). - UI resources are
ui://HTML. The URI MUST start withui://,mimeTypeMUST betext/html;profile=mcp-app, content MUST be intextor base64blob, and it MUST be a valid HTML5 document (UI Resource Format, Content Requirements). - Tools link by
_meta.ui.resourceUri. The referenced resource MUST exist on the server, and the host MUST fetch it withresources/read. The flat_meta["ui/resourceUri"]key is deprecated (Resource Discovery, Behavior and Deprecation notice). - Text still works. Tools MUST return a meaningful
contentarray even when UI is available, and servers SHOULD provide text-only fallback for every UI-enabled tool (Client<>Server Capability Negotiation, Graceful Degradation). - Visibility is enforced by the host. The host MUST NOT list a tool to the agent unless its
visibilityincludes"model", MUST reject a view'stools/callfor a tool whosevisibilitylacks"app", and app-only tools are never callable across servers (Resource Discovery, Visibility). - Views run sandboxed. All view content MUST be rendered in sandboxed iframes (Security Implications, Iframe Sandboxing). A web host MUST put a sandbox proxy with a different origin between itself and the view, and the proxy MUST have
allow-scriptsandallow-same-origin(Sandbox proxy, items 1 and 2). - CSP comes from declared domains only. The host MUST build the CSP from
_meta.ui.csp, MUST use the restrictive default when it is omitted, MUST NOT allow undeclared domains, and MUST block connections to them (UI Resource Format, Host Behavior; Security Implications, Content Security Policy Enforcement). - The view initializes first. The view MUST send
ui/initializewithappCapabilities; the host MUST NOT send any request or notification to the view before it receivesui/notifications/initialized(App Capabilities inui/initialize; Sandbox proxy, item 6). - Tool data is delivered in order. The host MUST send
ui/notifications/tool-inputwith the complete arguments after initialization, at most once and beforetool-result; MUST stoptool-input-partialoncetool-inputis sent; MUST sendtool-resultwhen execution completes while the view is displayed; and MUST sendtool-cancelledon cancellation for any reason (MCP Apps Specific Messages, Notifications (Host → View)). - Partial input is not trusted. The view MUST NOT rely on
tool-input-partialarguments for critical operations (Notifications (Host → View),ui/notifications/tool-input-partial). - Teardown is announced. The host MUST send
ui/resource-teardownbefore tearing down a view for any reason, and SHOULD wait for the response to prevent data loss (Notifications (Host → View),ui/resource-teardown). - Display modes are declared on both sides. The view MUST declare its modes in
appCapabilities.availableDisplayModes, MUST check the host'savailableDisplayModesbefore requesting a change, and MUST handle a different mode in the reply; the host MUST NOT switch to an undeclared mode and MUST return the resulting mode (Display Modes, Requirements). - Flexible containers follow the view. When
containerDimensionshas no fixedheightorwidth, the host MUST listen forui/notifications/size-changedand resize the iframe (Container Dimensions, Host Behavior). - The sandbox proxy relays, the host decides. The proxy MUST forward every message whose method does not start with
ui/notifications/sandbox-, and SHOULD NOT create requests itself; the host MAY forward non-ui/methods to the MCP server and MAY block them or ask the user (Sandbox proxy, items 6 to 8).
Workflow
- Pick the version. Target MCP Apps 2026-01-26. If the code uses
text/vnd.mcp.ui+html,text/html+mcp, the flatui/resourceUrikey orviewport, it was written against a pre-stable draft: plan an upgrade. ->references/versions.md✓ The target is recorded as MCP Apps 2026-01-26, not a pre-stable or draft text. - Negotiate the extension. Host: advertise
io.modelcontextprotocol/uiwithmimeTypes. Server: check it before offering UI, and advertise the extension where the base revision expects server capabilities. ->references/ui-resources.md✓ A host without the extension still gets usable text results from every tool. - Declare the UI resource (server). Serve a
ui://resource with the profile MIME type and an HTML5 document, and putcsp,permissions,domainandprefersBorderunder_meta.uion theresources/readcontent item. ->references/ui-resources.md✓resources/readon the URI returns one content item withmimeType: "text/html;profile=mcp-app"and every origin the view uses is declared. - Link tools to the resource (server). Set
_meta.ui.resourceUri, choosevisibility, and splitcontent(for the model),structuredContent(for the view) and_metain results. ->references/ui-resources.md✓ EveryresourceUriresolves, and app-only tools carryvisibility: ["app"]. - Render in a sandbox (host). Fetch the resource, build the CSP and Permission Policy, and render it in a sandboxed iframe; on the web, through a sandbox proxy on a separate origin.
->
references/security-and-sandbox.md✓ Afetchfrom the view to an undeclared origin is blocked, and the view cannot reach the host's DOM. - Run the bridge (host and view). Answer
ui/initializewithprotocolVersion,hostInfo,hostCapabilitiesandhostContext; wait forinitialized; send tool input, result or cancellation; proxytools/callandresources/read; handle teardown. ->references/host-bridge.md✓ A message trace showsui/initialize,ui/notifications/initialized,tool-input, thentool-resultortool-cancelled, and nothing sent to the view beforeinitialized. - Build the view. Declare
appCapabilities, applyhostContext(theme, styles, fonts, container dimensions, display mode), report size changes, and useui/message,ui/open-link,ui/update-model-contextandui/request-display-modeonly where the host advertises support. ->references/host-bridge.md✓ The view renders with its own fallback CSS variables when the host passes nostyles. - Review security. Walk the threat model: malicious HTML, sandbox escape, unauthorized tool calls, exfiltration, phishing, resource exhaustion; plus
postMessagesource checks and logging. ->references/security-and-sandbox.md✓ Each threat has a mitigation or a reason it does not apply. - Map to the SDK if it is used. Use
registerAppToolandregisterAppResourceon servers,Appin views andAppBridgein hosts, at ext-apps 2.x on the split MCP SDK 2.x packages. ->references/sdk.md✓ The installed packages match the role table, and no code depends on@modelcontextprotocol/sdk1.x next to ext-apps 2.x. - Upgrade (only when asked). Follow the upgrade section from the pre-stable drafts to MCP Apps 2026-01-26, or the SDK 1.x to 2.x checklist.
->
references/versions.md✓ The upgraded server, host or view passes the Verify list below and renders the same view.
Verify before done
- Every UI resource URI starts with
ui://, andresources/readreturnsmimeTypeexactlytext/html;profile=mcp-appwithtextorblob. - Every tool with
_meta.ui.resourceUripoints at an existing resource and returns meaningfulcontenttext. - The host hides tools without
"model"from the agent and rejects view calls to tools without"app"or on another server. - With no
_meta.ui.csp, the view runs under the restrictive default policy; with it, only the declared origins are allowed. - The web host serves the sandbox proxy from an origin different from the host's.
- No message reaches the view before
ui/notifications/initialized;tool-inputarrives once, beforetool-result. -
ui/resource-teardownis sent and awaited before the iframe is removed. -
ui/request-display-modereturns the mode actually set, and never an undeclared one. - Both ends check
event.source(or use a transport that does) before handling apostMessage. - Nothing that exists only in the MCP Apps draft (app tools,
sampling/createMessage,ui/download-file,ui/notifications/request-teardown) is required for the app to work.
Reference index
references/versions.md: the version lines, which to use, what changed from the pre-stable drafts to 2026-01-26 and from 2026-01-26 to the draft, the upgrade steps, and the draft. Load for steps 1 and 10.references/ui-resources.md: the UI resource format and_meta.uifields, tool linkage and visibility, capability negotiation on handshake and stateless MCP revisions, graceful degradation, and data passing. Load for steps 2 to 4.references/host-bridge.md: thepostMessagetransport,ui/initializeand its result, host context and capabilities, container dimensions, display modes, theming, everyui/message, and the lifecycle. Load for steps 6 and 7.references/security-and-sandbox.md: the threat model, the sandbox proxy, CSP construction and defaults, permissions, dedicated domains, message validation and auditing. Load for steps 5 and 8.references/sdk.md: the@modelcontextprotocol/ext-appspackages by role, the server helpers,App,AppBridge,PostMessageTransport, constants, and the 1.x to 2.x migration. Load for step 9.
Related skills
mcp, for the base protocol, transports, tools and resources these UI resources build on:npx skills add ScaleDockHQ/scaledock-skills --skill mcpmcp-authorization, for protecting the MCP server and its tools with OAuth:npx skills add ScaleDockHQ/scaledock-skills --skill mcp-authorizationag-ui, an alternative that streams agent runs and generative UI to a front end without MCP:npx skills add ScaleDockHQ/scaledock-skills --skill ag-uia2ui, an alternative where agents send declarative UI descriptions instead of HTML:npx skills add ScaleDockHQ/scaledock-skills --skill a2uiwebmcp, for web pages that register tools in the browser, which inspired the draft's app tools:npx skills add ScaleDockHQ/scaledock-skills --skill webmcp
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- MCP Apps specification 2026-01-26: Stable (2026-01-26), ext-apps v2.0.3 at commit 82221c0 (identical to
main), checked 2026-10-05. - MCP Apps specification draft: Draft,
mainat 82221c0 (last spec change c55a3a2, 2026-07-22); Draft posture: name, checked 2026-10-05. - ext-apps specification commit history: commit log from d0dbea3 (2025-11-21) to c55a3a2 (2026-07-22), checked 2026-10-05.
- MCP Apps pre-stable draft at v0.4.2: Draft, v0.4.2 (2026-01-26), checked 2026-10-05.
- MCP Apps draft at bd5a34b: Draft, commit bd5a34b (2025-11-21),
text/vnd.mcp.ui+html, checked 2026-10-05. - MCP Apps draft at c65006a: Draft, commit c65006a (2025-11-21),
text/html+mcp, checked 2026-10-05. - ext-apps README: Released, v2.0.3, checked 2026-10-05.
- ext-apps release v2.0.3: Released, v2.0.3 (2026-09-25), checked 2026-10-05.
- ext-apps release notes (0.2.2 and 0.3.0): Released, RELEASES.md at v2.0.3, checked 2026-10-05.
- Migrating from ext-apps 1.x to 2.x: Documentation, v2.0.3, checked 2026-10-05.
- CSP and CORS: Documentation, v2.0.3, checked 2026-10-05.
- ext-apps SDK source: spec.types.ts: Released, v2.0.3, checked 2026-10-05.
- ext-apps SDK source: constants.ts: Released, v2.0.3, checked 2026-10-05.
- ext-apps SDK source: server helpers: Released, v2.0.3, checked 2026-10-05.
- ext-apps SDK source: App, AppBridge and PostMessageTransport: Released, v2.0.3 (
app.ts,app-bridge.ts,message-transport.ts,styles.ts), checked 2026-10-05. - MCP Apps overview: Documentation page, checked 2026-10-05.
- MCP Extensions Overview: Documentation page (negotiation shown for MCP 2026-07-28), checked 2026-10-05.
- SEP-1865: MCP Apps: SEP, Final, Extensions Track, checked 2026-10-05.