MCP Apps: how interactive UI inside ChatGPT and Claude works
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.
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.
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.
WebMCP is a proposed browser API that lets a web page hand AI agents a list of tools. Each tool is a JavaScript function, or an HTML form, with a name, a plain-language description and a JSON Schema for its inputs. An agent in the browser reads that list and calls a tool directly, instead of guessing which button to click. The API lives at document.modelContext. It is a draft of a W3C Community Group, and Chrome runs it as an origin trial from Chrome 149.
This post covers what the draft defines, how Chrome implements it today, where it differs from a normal MCP server, and how to try it on your own site. For the protocol it borrows its words from, read What is MCP? first.
A browser agent is an AI assistant that acts on web pages for the user. Without help, it works the way a new user does. It looks at screenshots, the DOM and the accessibility tree, then fakes clicks and typing. The WebMCP explainer describes exactly this: agents observe the page “through a combination of screenshots, and DOM and accessibility tree snapshots” and then interact “by simulating human user input”.
That is slow and fragile. Every step is a guess. A date picker built for a thumb, a cart drawer that slides in late, or a redesign that moves a button can each break the run.
WebMCP turns the guess into a function call. The site says “here is search_flights, it takes an origin, a destination and a date”. The agent fills in the arguments, and the site’s own code does the work. Chrome’s overview puts it this way: instead of the agent reviewing a button or field to understand its purpose, “the website declares the element's purpose”.
Two things stay the same. The page is still there, and the user still sees it. The explainer says WebMCP does not conflict with normal browser automation: when the tools do not cover a task, the agent can still fall back to clicking.
It began as an explainer, first published on 13 August 2025 by authors at Microsoft and Google. The draft is published by the Web Machine Learning Community Group at the W3C. Its editors work at Microsoft and Google. The draft is clear about its status: “It is not a W3C Standard nor is it on the W3C Standards Track.” The WebMCP draft was last published on 29 November 2026 and has its own test suite on wpt.fyi.
Chrome is the main implementation so far:
Real sites already use it. Shopify’s developer changelog from August 2026 says its WebMCP tools are “live today on every Liquid storefront”, with nothing for the merchant to install.
A year from the first explainer to live on every Liquid storefront
Spaced in order, not to scale. It is still a Community Group draft, not a W3C Standard.
The imperative API is the core of the draft. A page calls document.modelContext.registerTool() with a tool object. Here is the shape the draft defines, from its IDL, shortened:
dictionary ModelContextTool {
required DOMString name;
USVString title;
required DOMString description;
object inputSchema;
object outputSchema;
required ToolExecuteCallback execute;
ToolAnnotations annotations;
};
Only name, description and execute are required. The name must be 1 to 128 characters of ASCII letters, digits, _, - and .. Here is a real tool from Chrome’s imperative API guide, from its pizza-maker demo:
await document.modelContext.registerTool({
name: 'toggle_layer',
description: 'Control pizza layers (sauce, cheese). Use "add", "remove", or "toggle".',
inputSchema: {
type: 'object',
properties: {
layer: { type: 'string', enum: ['sauce-layer', 'cheese-layer'] },
action: { type: 'string', enum: ['add', 'remove', 'toggle'] },
},
required: ['layer'],
},
execute: async ({ layer, action }) => {
await toggleLayer(layer, action);
return `Performed ${action || 'toggle'} on layer: ${layer}`;
},
});
registerTool() returns a Promise. That changed in Chrome 151, because tools can now be shared across frames, so registration is async. The execute function gets the arguments as a plain object, plus a second argument with an AbortSignal. It can return a string or any value that turns into JSON.
A tool can carry annotations. The draft defines four booleans, all false by default. Chrome’s guide explains them:
readOnlyHint: the tool only reads. It changes nothing.consequentialHint: the tool does something significant, real-world or non-reversible, like booking a flight or moving money. The agent or browser can ask the user to confirm first.untrustedContentHint: the output holds data the site does not vouch for, like reviews or forum posts. The agent should treat it with care.debugging: the tool is for developer tools and tests, so end-user agents can skip it. Added in Chrome 156.await document.modelContext.registerTool({
name: 'book_flight',
description: 'Book a flight for the user with confirmed flight details.',
inputSchema: {
type: 'object',
properties: {
flightId: { type: 'string', description: 'ID of the flight to book' },
passengers: { type: 'number', description: 'Number of tickets to purchase' },
},
required: ['flightId', 'passengers'],
},
annotations: {
readOnlyHint: false,
consequentialHint: true,
untrustedContentHint: false,
debugging: false,
},
execute: async ({ flightId, passengers }) => {
// Add your flight booking transaction logic here.
return `Booked ${passengers} passenger(s) on flight ${flightId}.`;
},
});
These are hints, not locks. The page cannot force a confirmation. It can only tell the agent that one is wise.
From Chrome 159, a tool can declare outputSchema, a JSON Schema for what execute returns. Chrome’s advice is to use it on read and search tools that return several fields or IDs for the next call, and to skip it on simple actions to save tokens. The draft does not yet say what happens when a result breaks the schema. For now, Chrome’s update notes say the agent harness should check it and send the model a clear error.
await document.modelContext.registerTool({
name: "getWeather",
description: "Returns the current weather for a city.",
inputSchema: {
type: "object",
properties: { city: { type: "string" } },
required: ["city"]
},
outputSchema: {
type: "object",
properties: {
temperature: { type: "number" },
conditions: { type: "string" }
},
required: ["temperature", "conditions"]
},
async execute({ city }) { /* ... */ }
});
There is no unregisterTool(). You pass an AbortSignal when you register, and abort it to remove the tool. The group chose this so that only the code that added a tool can remove it, the same way event listeners work.
const controller = new AbortController();
await document.modelContext.registerTool(addTodoTool, { signal: controller.signal });
// Unregister the tool later...
controller.abort();
Since Chrome 153, removing a tool does not cancel a call that is already running. A running call can still be cancelled by the user or the agent. Your execute function receives that signal and should pass it on, for example to fetch().
Many pages register tools late, after loading config or switching routes in a single-page app. An agent that reads the list too early sees nothing. From Chrome 160, document.modelContext.waitForToolsUntil() takes a Promise. Agents wait until it settles before reading the tools. Chrome’s guide caps the wait at 10 seconds, so a stuck Promise cannot block agents forever.
const toolsRegistered = (async () => {
const response = await fetch('/api/tools-config');
const config = await response.json();
await Promise.allSettled(config.tools.map(tool =>
document.modelContext.registerTool({
name: tool.name,
description: tool.description,
execute: async (input) => {
// Add your tool execution logic here.
},
})
));
})();
document.modelContext.waitForToolsUntil?.(toolsRegistered);
Note the ?.. Before Chrome 160 the method does not exist, and a bare call throws. Chrome’s own update notes guard it the same way.
One detail is still open. The browser needs a cutoff for pages that never call it: either the end of <head> parsing, or DOMContentLoaded. The group is collecting feedback in issue #328.
Most sites already have the right tool: a form. The declarative API turns a <form> into a WebMCP tool with a few attributes. Chrome implements it. Note that it is not yet in the draft itself: the explainer files it under “Future Exploration: Declarative API”, and the ideas live in a separate declarative explainer.
The attributes, from Chrome’s declarative API guide:
toolname and tooldescription on the <form>. Remove either one and the tool is gone.toolparamdescription on a field. Without it, Chrome uses the field’s <label> text, then its aria-description.toolautosubmit on the <form>, to let the agent submit. Without it, the agent fills the form and the user clicks Submit.<form toolname="supportRequestTool"
tooldescription="Submit a request for support."
action="/submit">
<label for="firstName">First Name</label>
<input type=text name=firstName>
<label for="lastName">Last Name</label>
<input type=text name=lastName>
<select name="select" required
toolparamdescription="Determines what team this request is routed to.">
<option value="Customer happiness team">Return my purchase.</option>
<option value="Distribution team">Check where my package is.</option>
<option value="Website support team">Get help on the website.</option>
</select>
<button type=submit>Submit</button>
</form>
Chrome turns that form into this tool. Each field’s name becomes a property, required carries over, and each <option> becomes a choice:
[
{
"name": "supportRequestTool",
"description": "Submit a request for support.",
"inputSchema": {
"type": "object",
"properties": {
"firstName": { "type": "string" },
"lastName": { "type": "string" },
"select": {
"type": "string",
"anyOf": [
{ "type": "string", "const": "Customer happiness team", "title": "Return my purchase." }
// …
],
"enum": ["Customer happiness team", "Distribution team", "Website support team"],
"description": "Determines what team this request is routed to."
}
},
"required": ["select"]
}
}
]
To send a result back to the agent without a page load, use the submit event. SubmitEvent gains agentInvoked, which is true when an agent submitted, and respondWith(), which takes a Promise for the answer. You must call preventDefault() first:
<form toolautosubmit toolname="search_tool"
tooldescription="Search the web" action="/search">
<input type=text name=query>
</form>
<script>
document.querySelector("form").addEventListener("submit", (e) => {
e.preventDefault();
if (!myFormIsValid()) {
if (e.agentInvoked) { e.respondWith(myFormValidationErrorPromise) };
return;
}
if (e.agentInvoked) { e.respondWith(Promise.resolve("Search is done!")); }
});
</script>
There is UI help too. The toolactivated and toolcancel events fire on document.modelContext. The CSS pseudo-classes :tool-form-active and :tool-submit-active let you highlight a form the agent has filled, so the user sees what is waiting for them. What an agent gets back when a form navigates to a new page is still open, in issue #135.
The explainer gives the lifecycle in five steps: the page registers tools with document.modelContext.registerTool(), the agent asks the browser for the current list, the agent calls a tool, such as toggle_layer from the example above, with arguments that match inputSchema, the browser runs execute in the page, and the result goes back to the agent.
The page registers its tools, and the agent calls one instead of clicking
The browser sits in the middle. It hands the agent the tool list, then runs execute in the page.
The draft separates two kinds of agent:
getTools() to list tools, executeTool() to run one, and the toolchange event to hear when the list changes.const tools = await document.modelContext.getTools();
const found = tools.find(t => t.name === "add-todo");
if (found) {
const result = await document.modelContext.executeTool(
found,
{ text: "Buy groceries" }
);
// …
}
Frames need care. By default, a tool is visible only to its own origin. Sharing it with a cross-origin iframe takes three opt-ins, per the draft’s same-origin section: the parent delegates the tools permission with allow="tools", the tool lists the caller in exposedTo, and the caller asks for that origin in fromOrigins.
Many older tutorials use navigator.modelContext. That code no longer runs. Chrome’s update notes list the moves:
provideContext() and clearContext().unregisterTool() in favour of an AbortSignal, and dropped the toolparamtitle attribute.navigator.modelContext, and Chrome 152 removed it. Use document.modelContext.The group moved it because tools belong to one document, not to the whole browser. If you must support old builds during the trial, Chrome suggests this check:
const modelContext = document.modelContext || navigator.modelContext;
if (modelContext) {
// Register tools...
}
The name invites confusion. Chrome’s comparison page is direct: “WebMCP is not an extension or a replacement of MCP.” It calls WebMCP “MCP-inspired” APIs. It has tools only, with no resources or prompts, and tools are JavaScript functions in the page, not a server you connect to. The explainer says the same from the other side: “WebMCP is designed to complement, not replace, existing backend-focused protocols like MCP.”
Chrome’s analogy works well. MCP is a call center, open from anywhere at any time. WebMCP is an expert in the store, there only while the customer is on your page.
WebMCP tools live in the open page and run with the user’s session
An MCP server is open from anywhere, at any time. WebMCP is there only while the user is on your page.
| Backend MCP serverThe call center | WebMCPThe expert in the store | |
|---|---|---|
| What it offers | Tools, resources and prompts | Tools only |
| Where tools live | On your server | In your web page: JavaScript functions or HTML forms |
| When they exist | Whenever the server is up | Only while the page is open |
| Whose login | Its own credentials | The user’s current browser session |
| Who calls | Any MCP client: ChatGPT, Claude, an IDE | An agent with access to the open page |
| UI | None, or shown inside the agent | Your own site, updated as the agent works |
The login row matters most. A WebMCP tool runs with the user’s cookies and session, in the same tab. The user watches the cart change. You do not need to rebuild login and state on a separate server. In Chrome’s words, “the agent is a guest on your platform.” The price: “Importantly, WebMCP tools are ephemeral.” They vanish when the tab closes.
Shopify runs both, for different agents. Its WebMCP tools serve agents that shoppers bring into their own browser tab: search_catalog, get_product, get_cart, update_cart, proceed_to_checkout and more. Cart tools call the same storefront actions that apps use to update the cart, so an agent’s cart changes behave like the shopper’s own. If the theme has set it up, the cart drawer opens too. Checkout registers its own tools, so the list changes when the shopper moves into checkout.
For agents that never open the store, Shopify offers hosted MCP servers. Its agent docs point to Shop MCP for search, carts and checkout, and to Storefront Catalog, an MCP server for one merchant’s products. The WebMCP page draws the line itself: if you are building your own agent that connects to Shopify’s MCP servers, use the agent docs instead.
Shopify runs both: WebMCP tools in the store, MCP servers for agents elsewhere
The same store, two ways in. Which one an agent uses depends on whether it opens the page.
That is the general pattern. The MCP server is the always-on service layer, reachable from any assistant. WebMCP is the last step, for when the user is on your site and wants help there. Our post on MCP Apps covers a third option: your UI shown inside the assistant.
chrome://flags/#enable-webmcp-testing, set it to Enabled and relaunch. Chrome’s overview has the steps.<meta http-equiv="origin-trial" content="TOKEN_GOES_HERE">
Origin-Trial: TOKEN_GOES_HERE
@w3c/webmcp-polyfill and webmcp-types for TypeScript, listed in the explainer. The polyfill lets you register and test tools, but connecting to a browser agent still needs native support.The API is only on secure contexts, so serve over HTTPS or localhost. React, Angular and Vue have experimental helpers that tie tool registration to a component’s lifecycle.
WebMCP puts natural language from your site into a model’s context. That makes it a prompt injection surface: text that tries to give the model orders. Chrome’s security guide is frank that no model layer makes this safe, and that repeatable injection attacks have worked against agents built on state-of-the-art models.
The draft’s security section names the main risks:
untrustedContentHint.finalizeCart that actually buys. The agent cannot check what a tool does before it runs it. Hence consequentialHint.The draft is honest about the limits of hints: “a malicious site can omit or misrepresent those hints.” Defense mainly sits in the agent, not in the page. For a site owner the duties are concrete:
execute, as you would any request. The draft warns that an agent path may skip checks the UI path has.toolautosubmit off forms that pay or delete. Shopify’s complete_checkout tool places the order “after the buyer confirms it”.Permissions-Policy: tools=() on pages that should have no tools. The draft says this stops injected scripts and compromised dependencies from registering any.toolparamdescription where labels are vague.create-event and start-event-creation are different tools.readOnlyHint, consequentialHint and untrustedContentHint honestly.execute, and return clear errors the agent can act on.waitForToolsUntil?.() when that takes time; it exists from Chrome 160.document.modelContext, and feature-detect it. Fall back to navigator.modelContext only for builds older than Chrome 152, as shown above.WebMCP is early, but it is concrete. The shape is settling, Chrome has a live trial, and a platform the size of Shopify runs it on every Liquid storefront. If your site has flows that agents fumble, a few well-described tools are a small, low-risk addition. Browsers without WebMCP simply ignore them.
It does not replace a backend MCP server. One serves the user who is on your site. The other serves the assistant that will never open it. Aibuku’s directory app, for example, is a backend MCP server at https://mcp.aibuku.com/directory/mcp, which you can add by address in Claude or ChatGPT. For how agents learn when to use such tools, see Skills vs MCP.
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.
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.