# WebMCP

WebMCP is a proposed browser API for exposing actions in an open web page to an agent. An annotated HTML form can describe a search or submission. A JavaScript handler can expose a richer operation against the page’s current state.

[Web Machine Learning Community Group draft](https://webmachinelearning.github.io/webmcp/)

## Two ways to expose an action

For an existing form, toolname and tooldescription identify the action and its fields supply the parameters. The imperative API uses document.modelContext.registerTool with a description, input schema and execute handler. Both designs let the page reuse the same interaction logic a person encounters.

[Declarative HTML form API](https://developer.chrome.com/docs/ai/webmcp/declarative-api) · [Imperative JavaScript API](https://developer.chrome.com/docs/ai/webmcp/imperative-api)

## Where “Script Tools” fits

In August 2025 the WebMCP project combined an early browser proposal called the Script Tools API with its WebMCP explainer. This history explains the name in earlier presentations. A backend tool implemented with a script and a script bundled in an Agent Skill each have a different execution environment.

[Original merge of the browser API explainers](https://github.com/webmachinelearning/webmcp/commit/9de1d71c0f22697c42897152a62b1c8bc87370d2)

## The browser boundary

WebMCP tool handlers run in the page. They see its current state and may call its application backend using the site’s normal authorization. An MCP server exposes operations to protocol clients over a transport such as stdio or HTTP. A site can support both interfaces by sharing application logic.

[Web Machine Learning Community Group draft](https://webmachinelearning.github.io/webmcp/) · [Chrome’s WebMCP guidance](https://developer.chrome.com/docs/ai/webmcp)

## When to use it

Use a page tool for work tied to what someone sees, such as selecting available filters or preparing a form to review. A scheduled integration that must run with the page closed needs a server or API. Keep a normal accessible form or equivalent controls so people can complete the task on other browsers.

[Web Machine Learning Community Group draft](https://webmachinelearning.github.io/webmcp/) · [Chrome’s WebMCP guidance](https://developer.chrome.com/docs/ai/webmcp)

## Status and outlook

Chrome offered an early preview and then a time-limited origin trial. The Web Machine Learning Community Group publishes the evolving draft. Feature-detect the API and test actual browser versions. The ordinary page should remain fully usable as the proposal changes.

[Web Machine Learning Community Group draft](https://webmachinelearning.github.io/webmcp/) · [Chrome’s WebMCP guidance](https://developer.chrome.com/docs/ai/webmcp)

## Basic

Annotate a catalog’s existing GET search form. In a supporting browser the agent can fill the field. Without toolautosubmit the person still submits the form, and the same controls work in other browsers.

```
<form action="/search" method="get" toolname="search_catalog" tooldescription="Find catalog entries by title">
  <label>Title <input name="q" required></label>
  <button type="submit">Search</button>
</form>
```

[Declarative HTML form API](https://developer.chrome.com/docs/ai/webmcp/declarative-api)

## Moderate

Register a read-only page tool that reports the titles currently visible in the catalog. Run the script after the page loads. Feature detection preserves the existing page on browsers without WebMCP.

```
if ("modelContext" in document) {
  document.modelContext.registerTool({
    name: "visible_titles",
    description: "List titles displayed in this catalog view",
    inputSchema: { type: "object", properties: {} },
    execute: () => Array.from(document.querySelectorAll("[data-catalog-title]"))
      .filter(el => el.checkVisibility())
      .map(el => el.textContent.trim())
  })
}
```

[Imperative JavaScript API](https://developer.chrome.com/docs/ai/webmcp/imperative-api)

## Production

For a booking flow, expose a read-only availability lookup and keep the final booking behind the site’s existing review step. Recheck inventory and the signed-in user on the backend, then test keyboard-only, unsupported-browser and tool-driven paths.

[Chrome’s WebMCP guidance](https://developer.chrome.com/docs/ai/webmcp)

## Timeline

- 2025-08-07 — The WebMCP project combines the browser Script Tools API and WebMCP explainers [Original merge of the browser API explainers](https://github.com/webmachinelearning/webmcp/commit/9de1d71c0f22697c42897152a62b1c8bc87370d2)

- 2026-02-10 — Chrome announces the WebMCP early preview [Chrome announces the WebMCP early preview](https://developer.chrome.com/blog/webmcp-epp)

- 2026-06-09 — Chrome opens the WebMCP origin trial in Chrome 149 [Chrome opens the WebMCP origin trial in Chrome 149](https://developer.chrome.com/blog/ai-webmcp-origin-trial)

- 2026-11-24 — The draft adds a way to signal when a page’s tool list is ready [The draft adds a way to signal when a page’s tool list is ready](https://github.com/webmachinelearning/webmcp/commit/47e2b993ea9fd0599ffca3f58588eb3fd5f474f2)

## Related articles

[MCP tools](/wiki/mcp-tools/)

[Model Context Protocol](/wiki/model-context-protocol/)
