AxidortGuidesStandards

What is WebMCP, and should you add it to your website?

WebMCP is a proposed web standard that lets a web page offer named tools to an AI agent running in the browser, so the agent calls a function such as search_flights instead of guessing which buttons to click. It has an imperative JavaScript API and a declarative API for HTML forms. It is in an origin trial in Chrome, so treat it as an experiment worth running, not a requirement.

By the Axidort team · Updated

What problem it solves

A browser agent normally works out a page from its HTML, accessibility tree and screenshots, then clicks and types like a person. That is slow and can go wrong. With WebMCP the page tells the agent what it can do and how. The tools run in the page, in the user’s session, with the user’s sign-in, so nothing new has to be hosted.

Status

Chrome’s documentation describes WebMCP as a proposed web standard, with an origin trial that began in Chrome 149 and a local testing flag at chrome://flags/#enable-webmcp-testing (Chrome for Developers). The API has already changed during the trial: the entry point is now document.modelContext, and older examples that use navigator.modelContext are out of date. Expect more changes.

The imperative API

Register a tool from JavaScript with a name, a description, an input schema and a function to run:

if ('modelContext' in document) {
  await document.modelContext.registerTool({
    name: 'search_products',
    description: 'Search the catalog by keyword. Returns matching products with name, price and availability.',
    inputSchema: {
      type: 'object',
      properties: { query: { type: 'string' }, inStockOnly: { type: 'boolean' } },
      required: ['query'],
    },
    annotations: { readOnlyHint: true },
    execute: async ({ query, inStockOnly }) => {
      const results = await searchCatalog(query, { inStockOnly }); // your existing function
      return JSON.stringify(results.slice(0, 10));
    },
  });
}

Feature-detect before calling, as above, so the page works unchanged in browsers without the API. Use annotations to tell the agent whether a tool only reads or has consequences.

The declarative API

An existing HTML form becomes a tool by adding attributes. No JavaScript is needed:

<form toolname="request_quote"
      tooldescription="Request a price quote for a product and quantity."
      action="/quote" method="post">

  <label for="sku">Product code</label>
  <input id="sku" name="sku" required>

  <label for="qty">Quantity</label>
  <input id="qty" name="qty" type="number" min="1" required
         toolparamdescription="Number of units, in the product's selling unit.">

  <button type="submit">Request quote</button>
</form>

By default the agent fills in the form and the user presses submit. Adding toolautosubmit lets the agent submit it. Leave that off for anything that spends money or sends a message in the user’s name.

WebMCP or an MCP server?

WebMCPMCP server
Where it runsIn your page, in the user’s browser.On your servers.
Who can use itAn agent in a browser that supports the API, while the page is open.Any MCP client, without opening your site.
Sign-inUses the session the user already has.Needs OAuth.
MaturityProposed standard, origin trial in Chrome.Published specification with broad client support.

They are complementary. Start with the page itself, add an MCP server if you have an API, and try WebMCP on one high-value form to learn how agents use it.

Should you add it now?

  • Yes, as a small experiment, if you have a form-driven task such as search, booking or a quote request, and developers to maintain it while the API changes.
  • Not yet, if agents are still blocked or cannot read your pages. Fix the basics first. They help every agent in every browser.

Frequently asked questions

01Is WebMCP the same as MCP?

No. MCP connects AI applications to servers. WebMCP is a browser API that lets a web page offer tools to an agent in that browser. They share the idea of named tools with schemas but are separate specifications.

02Which browsers support WebMCP?

Chrome, through an origin trial that started in Chrome 149 and a testing flag for local development. Check Chrome’s documentation for current status, and feature-detect so other browsers are unaffected.

03Does WebMCP replace making a site accessible to agents?

No. Most agents do not use it yet, and it only works while the page is open in a supporting browser. Semantic HTML and readable pages remain the foundation.

See how an AI agent experiences your site. A free scan returns your Axidort Score, seven component scores and the step where the agent stopped.
Want your site made agent ready?

Related guides