AI summary

WebMCP is a proposed web standard that lets a page offer each action as a tool an AI agent can call, so the agent doesn't have to guess which button to click.

  • WebMCP is a proposed web standard. A page uses JavaScript or HTML form attributes to register a tool an AI agent can call.
  • It doesn't replace MCP. MCP connects an agent to your services, while a WebMCP tool exists only while the page is open.
  • Flags such as "this action matters or is hard to undo" (consequentialHint) are only hints, so permissions still have to be enforced in your own code.
  • As of November 2026 it's a draft, with a Chrome origin trial that starts at version 149.

An AI agent using a website mostly looks and guesses. It reads the DOM or a screenshot, decides which button is probably the right one, clicks it, then looks again to see what happened. WebMCP is a proposed web standard that lets the page skip that part and tell the agent which actions exist and what each one needs.

Each action is a tool with a name, a description and a schema for its input. The MCP in WebMCP stands for the Model Context Protocol, a standard way for AI agents to call tools that a server offers.

I haven’t added WebMCP to a site yet. Everything here comes from the spec and Chrome’s docs, so you won’t find benchmarks.

WebMCP is also different from the chat on this site. That chat is my own assistant behind my own endpoint. WebMCP is for an agent the visitor runs in their own browser, such as one inside a browser extension.

tabcrew, a project of mine, lets an AI coding assistant type into ChatGPT, DeepSeek or Gemini. It finds the message box and the reply in the page with code I wrote for each site. A page’s own tools would replace that code.

The same task, two waysAn illustrative flow for filling in a booking form.

Without tools

Every step depends on the agent reading a page that was designed for people.

  • Read the DOM or a screenshot
  • Work out which field is which
  • Type and click, one step at a time
  • Read the page again to see the result

With a WebMCP tool

The page says what it can do, and the agent sends data that matches a schema.

  • Get the page's list of tools
  • Send JSON that matches the tool's schema
  • The page runs its own code
  • Get the result back

Registering a tool with JavaScript

The JavaScript API, which Chrome’s docs call imperative, is one call on document.modelContext. You give the tool a name, a description the agent will read, a schema for its input and a function to run:

js
if ("modelContext" in document) {
  await document.modelContext.registerTool({
    name: "search_posts",
    description: "Search this blog's posts by keyword. Returns titles and URLs.",
    inputSchema: {
      type: "object",
      properties: { query: { type: "string" } },
      required: ["query"],
    },
    annotations: { readOnlyHint: true },
    execute: async ({ query }, { signal }) => {
      // searchPosts is your own app code.
      const posts = await searchPosts(query, signal);
      return JSON.stringify(posts);
    },
  });
}

The if makes the tool an extra: in a browser without the API, the page works exactly as before. The API only exists on a secure page: HTTPS, or localhost while you develop.

To remove a tool later, you need a separate signal, not the one execute receives. Create an AbortController, pass { signal: controller.signal } as the second argument to registerTool, and call controller.abort() when the tool should go away.

You’ll still see navigator.modelContext in older posts. The current spec puts it on document, so I’d write new code against that.

Turning a form into a tool

If the action is already a form, two attributes are enough. Chrome’s docs call this the declarative API:

html
<form
  toolname="search_posts"
  tooldescription="Search this blog's posts by keyword."
  action="/search"
>
  <label for="q">Keyword</label>
  <input id="q" name="q" type="text" required />
  <button type="submit">Search</button>
</form>

The browser builds the schema from the fields and labels. When an agent calls the tool, the browser focuses the form and fills it in while the user watches. The user still clicks Submit unless you add toolautosubmit.

In your submit handler, event.agentInvoked tells you the agent triggered it, and event.respondWith() sends a result back to the agent. Call event.preventDefault() before respondWith().

One tool call, start to finishScrub through it, or press play.
  1. Register

    The page registers its tools when it loads.

    document.modelContext.registerTool(...)
  2. Discover

    The browser passes the tool list to the agent: names, descriptions and schemas.

  3. Choose

    The agent picks a tool and writes arguments that match its schema.

    { "query": "cloudflare" }
  4. Run

    The tool runs in the page, with the session of the signed-in user.

  5. Result

    Whatever the function returns goes back to the agent as the tool's output.

WebMCP and MCP solve different problems

The name makes it sound like MCP in the browser. Chrome’s docs call it MCP-inspired and say plainly that it’s neither an extension of MCP nor a replacement for it.

An MCP server connects an agent to your services over JSON-RPC, from anywhere and at any time. A WebMCP tool exists only while someone has your page open, and it works with that person’s session. If you already have an MCP server, keep it. WebMCP adds a way for an agent to use the site the user is looking at.

Annotations are hints

Annotations are extra flags on a tool, like the readOnlyHint in the code above. Three matter most:

  • readOnlyHint says the tool doesn’t change anything.
  • consequentialHint marks something significant or hard to undo, so the agent or browser can ask the user first.
  • untrustedContentHint says the output contains things like reviews or comments, which can carry prompt injection.

The spec is direct about the limit: a malicious site can leave these out or lie in them. They help an honest site describe its tools, and your own code still has to do the enforcing.

A tool runs with the user’s logged-in session, so I’d send it through the same validation and permission checks as the visible UI. Chrome’s best-practices page recommends one shared piece of code that both the UI and the tool call for validation, permissions and side effects.

Tools are off inside an iframe that loads a page from another site (a cross-origin iframe) unless you add allow="tools". Chrome extensions, though, can list and run a page’s tools, so don’t treat a tool as private.

Where it stands in November 2026

The spec is a Draft Community Group Report. A W3C community group publishes it, but it isn’t on the Standards Track, the path that ends in an official W3C standard.

Chrome’s docs list an origin trial starting with Chrome 149 and say the API can still change. Chrome is the only implementation I could confirm. To try it locally, turn on chrome://flags/#enable-webmcp-testing.

WebMCP also won’t do anything for search engines. An agent only finds your tools after it has opened the page.

I’d try it on a real multi-step flow, like a booking form or a filter-heavy catalog, starting with a read-only tool behind the if above. A blog like this one has little to gain, because an agent can already read the page.

References

  1. WebMCP: Draft Community Group Report
  2. Chrome for Developers: WebMCP
  3. Chrome for Developers: Imperative API
  4. Chrome for Developers: Declarative API
  5. Chrome for Developers: WebMCP versus MCP
  6. Chrome for Developers: Secure WebMCP tools
  7. Chrome for Developers: WebMCP best practices
  8. Chrome Platform Status: WebMCP

Written by:

Full Stack Software EngineerSamsun, Türkiye

Full Stack Software Engineer. I started with client sites at an agency in 2019, then worked on embeds, a dashboard and analytics at a startup called Popupsmart.