Skip to content
Get 600 trial creditsGet 600 credits

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.

Share

Share on X (Twitter) (opens in a new tab)Share on LinkedIn (opens in a new tab)Share by email

Summarize with AI

Summarize in ChatGPT (opens in a new tab)Summarize in Claude (opens in a new tab)Summarize in Perplexity (opens in a new tab)

Get a short summary from ChatGPT, Claude or Perplexity.

Add as a preferred source

Add Aibuku as a preferred source on Google (opens in a new tab)

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.

The problem: agents that click

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.

Who writes it, and how far along it is

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:

  • Origin trial. “In Chrome 149, you can sign up for the WebMCP origin trial.” Chrome’s origin trial post, June 2026. An origin trial is a time-limited program that turns an experimental feature on for sites that register for it.
  • Fast-moving shape. Chrome keeps a list of API changes per release. Between Chrome 147 and Chrome 160, methods were removed, renamed and made async. Expect more.
  • Trial window. Chrome Status lists the trial from Chrome 149, extended to Chrome 162.
  • Other browsers and agents. The group’s implementation status page says an origin trial “is live in Edge 150”, that “WebMCP is supported in ChatGPT Desktop”, and that Brave’s Leo AI chat supports it from Brave 1.102.2, expected on 5 January 2027. Chrome Status shows “No signal” from Firefox and Safari.

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.

Source: the WebMCP explainer, Chrome’s origin trial post, Shopify’s changelog and the WebMCP draft.

The imperative API: tools in JavaScript

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.

Annotations: hints about side effects

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.

Output schema

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 }) { /* ... */ }
});

Removing tools, and cancelling a call

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().

Telling agents to wait: waitForToolsUntil

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.

The declarative API: tools from HTML forms

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.

How a browser agent finds and calls tools

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.

Source: the WebMCP explainer and the draft’s section 5.2.

The draft separates two kinds of agent:

  • A browser agent is built into the browser or added through it, for example by an extension. It “does not run JavaScript on the page”. It gets an observation: a snapshot that holds the tool list per frame, each tagged with its origin and a “tools ready” flag. Often screenshots too. Section 5.2 of the draft describes this, and says the draft “does not prescribe the format in which tools are exposed to the browser agent”. A browser can hand them to its model as MCP tools, or as its own function-calling format.
  • An in-page agent, like a chat widget, uses JavaScript: 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.

Older guides still show navigator.modelContext

Many older tutorials use navigator.modelContext. That code no longer runs. Chrome’s update notes list the moves:

  • Chrome 147 removed provideContext() and clearContext().
  • Chrome 148 removed unregisterTool() in favour of an AbortSignal, and dropped the toolparamtitle attribute.
  • Chrome 150 deprecated 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...
}

WebMCP and a backend MCP server

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 centerWebMCPThe expert in the store
What it offersTools, resources and promptsTools only
Where tools liveOn your serverIn your web page: JavaScript functions or HTML forms
When they existWhenever the server is upOnly while the page is open
Whose loginIts own credentialsThe user’s current browser session
Who callsAny MCP client: ChatGPT, Claude, an IDEAn agent with access to the open page
UINone, or shown inside the agentYour own site, updated as the agent works
Source: Chrome’s comparison page.

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.

When you want both: Shopify

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.

Source: Shopify’s WebMCP tools and Shopify’s agent docs.

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.

How to test it

  1. Turn on the flag. For local work, open chrome://flags/#enable-webmcp-testing, set it to Enabled and relaunch. Chrome’s overview has the steps.
  2. Register for the origin trial to turn it on for real visitors, from Chrome 149 to the trial’s end (Chrome 162 at the time of writing). You get a token tied to your origin. Put it on every page that uses the API, as a meta tag or an HTTP header. Chrome’s origin trial guide has both forms:
<meta http-equiv="origin-trial" content="TOKEN_GOES_HERE">
Origin-Trial: TOKEN_GOES_HERE
  1. Act like an agent. Chrome offers two extensions: the Model Context Tool Inspector, and an example agent that lists and runs tools from natural-language prompts with a model of your choice. DevTools shows how Chrome parsed your schemas.
  2. Build without Chrome if needed. The group publishes @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.

Security and privacy

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:

  • Tool poisoning. A malicious site hides orders in a tool description. Its example tells the agent to email the user’s browsing history to an attacker.
  • Output injection. A tool returns text with orders in it. This happens even on honest sites, through reviews and forum posts. Mark such tools with untrustedContentHint.
  • Misrepresented intent. A tool called finalizeCart that actually buys. The agent cannot check what a tool does before it runs it. Hence consequentialHint.
  • Over-asking. A search tool that asks for age, height or pregnancy, with a friendly reason for each. A helpful agent may fill these in from what it knows about the user. Ask only for what the task needs.
  • Cross-origin leaks. The same-origin rules and the three opt-ins above guard the frame tree.

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:

  • Validate every argument in execute, as you would any request. The draft warns that an agent path may skip checks the UI path has.
  • Keep the human in the loop for anything with a cost. Leave toolautosubmit off forms that pay or delete. Shopify’s complete_checkout tool places the order “after the buyer confirms it”.
  • Never take secrets as tool arguments. Shopify’s docs say its “WebMCP tools don't accept authentication tokens as tool arguments”. The session decides what a tool may do.
  • Send Permissions-Policy: tools=() on pages that should have no tools. The draft says this stops injected scripts and compromised dependencies from registering any.
  • Keep it short. Chrome suggests about 500 characters per tool description, 150 per parameter description, 30 per name and 1.5K per tool output.

Limits

  • An agent must be on your page. Chrome lists this as a limit: “Clients and browsers must visit a site directly to know if it has callable tools.” There is no central list and no way to call a closed tab. Using service workers to find tools in the background is only an idea in the explainer.
  • Built for a human in the loop. Chrome says it is “primarily designed for local browser workflows with a human in the loop”. It may run headless, but fully autonomous agents with no browser UI are a non-goal in the explainer.
  • Trials, not a standard. Chrome and Edge run origin trials, and some agents such as ChatGPT Desktop support it. Firefox and Safari have given no signal. Every other agent still sees your normal page.
  • Complex apps need work. Chrome warns that a complex site may need refactoring so state can be driven from code, not only from clicks.
  • Too many tools hurt. Every tool costs tokens in the agent’s context. The explainer advises one job per tool, and registering tools per page state instead of all at once.

A checklist for your site

  1. Pick the few tasks agents get wrong on your site today: search, filtering, booking, a long form.
  2. For each plain form, try the declarative attributes first. Add toolparamdescription where labels are vague.
  3. For tasks that live in JavaScript, register an imperative tool that calls the same code your UI calls. Keep the visible page in sync.
  4. Name tools with precise verbs. create-event and start-event-creation are different tools.
  5. Accept raw input: let your code convert dates, units and time zones, not the model.
  6. Set readOnlyHint, consequentialHint and untrustedContentHint honestly.
  7. Validate in execute, and return clear errors the agent can act on.
  8. Register and remove tools as the page changes. Call waitForToolsUntil?.() when that takes time; it exists from Chrome 160.
  9. Use document.modelContext, and feature-detect it. Fall back to navigator.modelContext only for builds older than Chrome 152, as shown above.
  10. Test with the flag and the inspector extension, then register for the origin trial.
  11. Keep your backend MCP server, or plan one, for agents that never open your site.

What this means in practice

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.

Keep reading

  1. AI apps and agents

    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.

  2. AI apps and agents

    Skills vs MCP: Agent Skills, Skills over MCP, and when to use which

    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.

  3. AI apps and agents

    What is MCP? The Model Context Protocol, from wire format to security

    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.

Your business could be the name AI says.

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.