What is WebMCP? Tools for AI agents, inside your web page
WebMCP is a draft web standard that lets a page declare tools for a browser’s AI agent. Agents call them instead of clicking through the page. Chrome has it in an origin trial.
MCP Apps is the official MCP extension for interactive screens inside an AI chat. A tool points to a ui:// HTML resource, and the host runs it in a sandboxed iframe.
Summarize with AI
Get a short summary from ChatGPT, Claude or Perplexity.
Add as a preferred source
Pick Aibuku on Google to see more of our posts in Top Stories.
MCP Apps is an official extension to the Model Context Protocol that lets an MCP server show its own interactive screen inside an AI chat. A tool points to an HTML page on the server. The chat app loads that page in a locked-down iframe, and the two talk through JSON-RPC messages sent with postMessage. Claude, ChatGPT and several other clients render the same app from the same code. The extension went live on 26 January 2026, and its ID is io.modelcontextprotocol/ui.
This post walks through how it works, message by message, with snippets taken from the specification. If MCP itself is new to you, start with What is MCP?
MCP gives an assistant tools and data, but a tool’s answer is text or JSON. For a calendar, a map or a long table, that is a poor fit. Two projects tried to fix this first, in different ways.
window.openai object in the page.A server that wanted to work in both had to support both. So on 21 November 2025 the MCP team proposed one standard, SEP-1865. (A SEP is an MCP change proposal.) “The SEP was authored by MCP Core Maintainers at OpenAI and Anthropic, together with the MCP-UI creators and lead maintainers of the MCP UI Community Working Group.”
Two months later, the MCP blog announced that “MCP Apps are now live as an official MCP extension”. It was the first one. Claude had it on web and desktop that day, Goose too, VS Code in its Insiders build, and ChatGPT “starting this week”. The spec version is dated 2026-01-26 and marked stable.
Since then, MCP itself has moved on. Version 2026-07-28 made the protocol stateless. Anthropic describes MCP Apps as now shipping “under a versioned extensions framework”. Anthropic, July 2026.
The ext-apps SDK serves three roles: app developers building views, host developers embedding them, and MCP server authors. In practice that gives three parts:
Think of the host as a landlord. The view is a tenant. It gets a room, but no key to the rest of the house, and it must ask the landlord for anything outside its room.
An extension is optional, so both sides must agree to use it. The host says it can show apps by naming the extension in its capabilities. The 2026-01-26 spec shows it in the initialize request:
{
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {
"extensions": {
"io.modelcontextprotocol/ui": {
"mimeTypes": ["text/html;profile=mcp-app"]
}
}
},
"clientInfo": { "name": "claude-desktop", "version": "1.0.0" }
}
}
MCP 2026-07-28 removed the initialize handshake. Client capabilities now travel with every request, in _meta under io.modelcontextprotocol/clientCapabilities, and that object has an extensions field. MCP changelog. The extension entry itself is the same.
The spec says servers “SHOULD check client capabilities before registering UI-enabled tools”. If the host does not support apps, the tool should still work and return text. In the spec’s words, “Tools MUST return meaningful content array even when UI is available”. UI is an extra layer on top, not a replacement.
ui:// resourceA UI is an MCP resource with a ui:// address. A tool links to it in its _meta.ui.resourceUri field. This is the example from the spec:
{
"name": "get_weather",
"description": "Get current weather for a location",
"inputSchema": {
"type": "object",
"properties": {
"location": { "type": "string" }
}
},
"_meta": {
"ui": {
"resourceUri": "ui://weather-server/dashboard-template",
"visibility": ["model", "app"]
}
}
}
The host fetches the page with a normal resources/read. The reply carries the HTML and the page’s security settings:
{
"contents": [{
"uri": "ui://weather-server/dashboard-template",
"mimeType": "text/html;profile=mcp-app",
"text": "<!DOCTYPE html><html>...</html>",
"_meta": {
"ui": {
"csp": {
"connectDomains": ["https://api.openweathermap.org"],
"resourceDomains": ["https://cdn.jsdelivr.net"]
},
"prefersBorder": true
}
}
}]
}
The rules are short. The address must start with ui://. The MIME type must be text/html;profile=mcp-app. The content is a full HTML5 document, as text or as base64 in blob. Other content types, such as a plain external URL, are left for later versions.
Why declare the page up front instead of sending HTML in each tool result? MCP-UI did the latter. The spec chose otherwise so that hosts can fetch and cache the page before the tool runs, and review it before showing it. The page is the template, and the tool result is the data. ChatGPT’s docs draw the practical lesson: “Treat the resource URI as a cache key.” If you change the HTML in a breaking way, publish it under a new URI. ChatGPT UI guide.
“MCP Apps run in a sandboxed iframe controlled by the host.” MCP Apps overview. The overview adds that apps “can’t access the parent page, steal cookies, or escape their container.”
For hosts that are web pages, the 2026-01-26 spec adds a second layer, a sandbox proxy. It is an outer iframe on a different origin from the host. It loads the app’s HTML into an inner iframe and passes messages through. The outer frame must have the sandbox flags allow-scripts and allow-same-origin. The host hands over the HTML only after the proxy says it is ready:
// Sandbox proxy → Host
{ jsonrpc: "2.0", method: "ui/notifications/sandbox-proxy-ready", params: {} }
// Host → Sandbox proxy
{
jsonrpc: "2.0",
method: "ui/notifications/sandbox-resource-ready",
params: {
html: string, // HTML content to load
sandbox?: string, // Optional override for inner iframe `sandbox` attribute
csp?: { // CSP configuration from resource metadata
connectDomains?: string[],
resourceDomains?: string[],
frameDomains?: string[],
baseUriDomains?: string[],
},
permissions?: { // Sandbox permissions from resource metadata
camera?: {},
microphone?: {},
geolocation?: {},
clipboardWrite?: {},
}
}
}
On a web host, your page runs two iframes deep, behind another origin
The proxy loads your HTML with a CSP built from its metadata, and passes messages through. The host hands over the HTML only after the proxy says it is ready.
The proxy then loads the page with a Content Security Policy built from the page’s metadata. A Content Security Policy, or CSP, is a browser rule list that says where a page may load files from and connect to. If the server declares nothing, the host must use this strict default:
default-src 'none';
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
img-src 'self' data:;
media-src 'self' data:;
connect-src 'none';
So by default, the page can run its own inline code but cannot call any outside server. The host “MAY further restrict but MUST NOT allow undeclared domains”.
By now the host has called a tool such as get_weather, seen the ui:// page its _meta.ui.resourceUri names, read that page as text/html;profile=mcp-app with its CSP in _meta.ui, and rendered it in the sandbox. The rest is the bridge.
Once loaded, the view talks to the host in JSON-RPC 2.0, the same message format MCP uses, carried by the browser’s postMessage. The spec says the iframe acts like an MCP client, and the host acts like a server that can pass calls on to the real MCP server. You can use the @modelcontextprotocol/ext-apps SDK, but it is optional. The spec shows the same bridge in a few dozen lines of plain JavaScript, with no SDK at all.
The view never reaches the server; every message goes through the host
Each arrow is one JSON-RPC message, and the dashed one an answer. The host passes a view’s tools/call on only if the tool’s visibility includes "app".
The view starts with ui/initialize, declaring what it can do. The host answers with its own capabilities and a hostContext object: theme, CSS variables, display mode, the space available, locale, time zone, platform and more. This is the host reply from the spec, shortened:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2026-01-26",
"hostCapabilities": { /* ... */ },
"hostInfo": { "name": "claude-desktop", "version": "1.0.0" },
"hostContext": {
"theme": "dark",
"styles": {
"variables": {
"--color-background-primary": "light-dark(#ffffff, #171717)",
"--font-sans": "Anthropic Sans, sans-serif"
// …
}
},
"displayMode": "inline",
"containerDimensions": { "width": 400, "maxHeight": 600 }
}
}
}
The view then sends ui/notifications/initialized. The host must not send the view anything before that. When something changes, such as the user switching to dark mode, the host sends ui/notifications/host-context-changed with only the changed fields.
The CSS variables are how one app looks native in different chats. The spec fixes a list of names for colours, fonts, border radius and shadows. It leaves out spacing on purpose, because “layouts break when spacing varies from original design”.
Next the host sends the data. First the arguments the model used:
{
"jsonrpc": "2.0",
"method": "ui/notifications/tool-input",
"params": { "arguments": { "location": "San Francisco" } }
}
The host may also send ui/notifications/tool-input-partial while the model is still writing the arguments, so the view can show a loading state. Then, when the tool finishes, the result:
{
"jsonrpc": "2.0",
"method": "ui/notifications/tool-result",
"params": {
"content": [{ "type": "text", "text": "Current weather: Sunny, 72°F" }],
"structuredContent": { "temperature": 72, "conditions": "sunny", "humidity": 45 },
"_meta": { "timestamp": "2025-11-10T15:30:00Z", "source": "weather-api" }
}
}
This split matters, but read it as advice, not a rule. Under “Best Practices”, the spec describes content as the text for the model and text-only hosts, and structuredContent as data for the screen, “not added to model context”. Hosts may differ. ChatGPT’s guide says plainly: “The model receives structuredContent from the data tool.” ChatGPT UI guide. So keep structuredContent small, and keep anything the model must not see out of it. If the call is cancelled, the host sends ui/notifications/tool-cancelled instead.
A button in the view can call a tool on the same server, with a normal tools/call. The host passes it on and returns the answer. With the SDK, from the launch post:
const response = await app.callServerTool({
name: "fetch_details",
arguments: { id: "123" },
});
The tool’s visibility field decides who may call it. The default is ["model", "app"]. A tool marked ["app"] is for the screen only, such as a refresh button or a next page:
{
"name": "refresh_dashboard",
"description": "Refresh dashboard data",
"inputSchema": { "type": "object" },
"_meta": {
"ui": {
"resourceUri": "ui://weather-server/dashboard-template",
"visibility": ["app"]
}
}
}
The host “MUST NOT include” such tools in the model’s tool list. It must reject calls from an app to a tool without "app" in its visibility. And an app can only reach tools on its own server: “Cross-server tool calls are always blocked for app-only tools.”
| Message | Direction | What it does |
|---|---|---|
ui/notifications/size-changed | view → host | Reports the page’s new width and height, so the host can resize the iframe |
ui/open-link | view → host | Asks the host to open a URL in the browser. The host may refuse |
ui/message | view → host | Adds a message to the chat, as if the user typed it. The host may ask the user first |
ui/update-model-context | view → host | Tells the model what the user did on screen, for later turns. Each update replaces the last |
ui/request-display-mode | view → host | Asks for inline, fullscreen or pip. The host decides and replies with the mode it set |
resources/read | view → host → server | Reads another resource from the server |
notifications/message | view → host | Sends a log line |
ui/resource-teardown | host → view | Warns the view before it is removed, so it can save its work |
Size needs a note. The host’s containerDimensions says, per axis, whether the size is fixed (height, width) or flexible up to a limit (maxHeight, maxWidth). With a flexible size, the host must listen for size-changed. The SDK sends it for you with a ResizeObserver.
The page’s _meta.ui block is where the server asks for more than the strict default. Each list maps to one CSP rule:
connectDomains: where the page may send fetch, XHR and WebSocket requests (connect-src).resourceDomains: where it may load scripts, styles, images, fonts and media.frameDomains: which sites it may embed in its own iframes. Empty means none.baseUriDomains: allowed values for the page’s base URL. Empty means its own origin only.Browser features come separately, under permissions: camera, microphone, geolocation and clipboardWrite. The host “MAY” grant them, through the iframe’s allow attribute, and the spec tells apps not to assume they got them. Two more fields shape the look and the origin. prefersBorder asks for a border and background, or none. domain asks for a fixed origin for the page, useful for OAuth callbacks or API key allowlists. Its format is up to each host, for example a subdomain of claudemcpcontent.com or oaiusercontent.com.
window.openaiChatGPT now follows the shared standard. “ChatGPT implements the open MCP Apps standard for UI returned by an MCP server.” ChatGPT UI guide. The old Apps SDK names still work as aliases:
| Goal | MCP Apps standard | ChatGPT compatibility alias |
|---|---|---|
| Link a tool to a UI resource | _meta.ui.resourceUri | _meta["openai/outputTemplate"] |
| Receive tool input | ui/initialize + ui/notifications/tool-input | window.openai.toolInput |
| Receive tool results | ui/notifications/tool-result | window.openai.toolOutput |
| Call a tool from the UI | tools/call | window.openai.callTool |
| Send a follow-up message | ui/message | window.openai.sendFollowUpMessage |
OpenAI’s advice: “New UI should use the shared fields and bridge methods”, and use window.openai “only for capabilities that the shared specification does not cover”. Those extras include Instant Checkout (requestCheckout), file upload and download, host modals, and saved widget state (widgetState, setWidgetState). The guide asks you to test for each feature before using it, not to check which host you are in.
The MCP migration guide covers the rest. The old MIME type text/html+skybridge becomes text/html;profile=mcp-app. openai/widgetCSP becomes _meta.ui.csp, with field names moving from snake_case to camelCase. openai/widgetAccessible and openai/visibility merge into the single visibility array. Some OpenAI features, such as the “invoking” and “invoked” status texts, have no standard version yet.
An app is code from someone else’s server, running inside your chat. The spec lists the threats plainly: a malicious server sending harmful HTML, a view trying to escape the sandbox, unauthorised tool calls, data theft, and phishing. Its answers come in layers:
Hosts add their own limits. OpenAI says ChatGPT’s widgets run “inside an isolated iframe with a strict Content Security Policy”, and cannot use browser features such as window.alert or navigator.clipboard. OpenAI security guide. Claude asks the user to confirm before an app opens a link, unless the destination is on a list the developer gave at submission. Claude submission guide.
The spec also names what a sandbox cannot fix. A view can still show misleading content, so hosts should make clear where the app’s area starts and ends. A view can also waste CPU and memory. And none of this protects your server from bad input. OpenAI’s rule for builders: “Assume prompt injection and malicious inputs will reach your server.” A prompt injection is text that tries to trick the model into misusing a tool. Check every argument on the server, whether the model or the app sent it.
The stable spec is the 2026-01-26 version. A draft in the same repository shows where it is heading. It drops the hard rule for a double iframe and allows a single sandboxed iframe, as long as the host serves it with the right CSP headers. It adds ui/download-file and a way for a view to ask to be closed. Tools that the app itself offers, so the host can ask the screen about its state, are already in the stable spec as appCapabilities.tools. Treat the draft’s additions as proposals until a new version is published.
Anyone can add an MCP server to Claude or ChatGPT by its URL. Being found in the assistants’ own stores is a separate step.
ChatGPT. In July 2026, OpenAI wrote: “We’re also replacing the App Directory with the Plugin Directory. Existing app connections are unaffected.” A plugin can hold an MCP server, skills or both. The submission guide has you upload the plugin as a ZIP, connect a remote server on a public HTTPS address, pass a domain check, and fix the issues from an automated scan before review. If the plugin uses iframes, you explain each one and who controls its domain. “Once approved, you choose when to publish.” After that, OpenAI picks up changes to your server automatically, but a change to the plugin’s details or skills needs a new ZIP.
Claude. Apps go into the same connectors directory as other MCP servers, submitted through Anthropic’s developer portal as remote servers. “Anyone on a paid Claude plan can submit through the portal.” Claude submission guide. Every tool needs a title and a readOnlyHint or destructiveHint annotation, and authenticated services must use OAuth 2.0. An app also needs 3 to 5 PNG screenshots of its screen, at least 1,000 pixels wide, with the prompt that produced each one given separately. In July 2026 the directory listed over 950 MCP servers.
ChatGPT and Claude each take an app through their own submission steps
In both, an app starts from a remote MCP server. What each asks for around it differs.
| ChatGPTPlugin Directory | ClaudeConnectors directory | |
|---|---|---|
| What you submit | A plugin ZIP holding an MCP server, skills or both | A remote MCP server, through Anthropic’s developer portal |
| The server | A remote server on a public HTTPS address, with a domain check | A remote server; OAuth 2.0 for authenticated services |
| What is checked | The issues an automated scan finds, fixed before review | A title and a readOnlyHint or destructiveHint on every tool |
| The screen | Explain each iframe and who controls its domain | 3 to 5 PNG screenshots, at least 1,000 pixels wide, each with its prompt |
Most MCP servers do not need a screen. If the answer is a fact, a price or a yes or no, plain tools are simpler and work in every client. The model reads them and replies in its own words.
The overview lists the cases where a screen helps: exploring complex data, forms with many options, rich media such as PDFs or maps, live monitoring, and multi-step work like approvals. The common thread is that the user needs to look, compare or click many times. Doing each of those as a new prompt is slow. As the overview puts it, “If your use case doesn’t benefit from these properties, a regular web app might be simpler.”
Weigh the costs too:
structuredContent out of the model’s context, but ChatGPT passes it to the model. Design for both: concise structured data, and nothing in it you would not show the model.content, so it has to make sense on its own.If you already run an MCP server, start with good tools and good text results. Add a ui:// resource only for the one or two tasks where a person truly needs a screen. Mark the helper tools that only the screen uses as ["app"]. Declare the fewest domains you can. Version the resource URI when the HTML changes. Then test in more than one host, because one app now runs in Claude, ChatGPT, VS Code and others without code for each.
Our own Aibuku directory app works this way. It is an MCP server at https://mcp.aibuku.com/directory/mcp that you can add to Claude or ChatGPT by that address. When one business fits a request best, that business’s own app opens right in the chat, where a person sees what it offers and when it is free. The Aibuku app.
For the rest of this series: What is WebMCP? covers tools offered by a web page in the browser, and Skills vs MCP covers written instructions that sit beside MCP.
WebMCP is a draft web standard that lets a page declare tools for a browser’s AI agent. Agents call them instead of clicking through the page. Chrome has it in an origin trial.
MCP gives an agent access to systems. A skill teaches it how to do a task. Skills over MCP lets a server ship both, as MCP resources.
MCP is an open standard that connects AI apps to outside tools and data over JSON-RPC. Its 2026-07-28 version made it stateless. Here is how it works, end to end.
A customer asks AI: Who does the best bike repair in Amsterdam Oost?
An AI answer: The best bike repair in Amsterdam Oost is your business here.
Use them within 7 days. Card required. Your paid plan starts after that unless you cancel.