WebMCP — Protocol and Site Readiness for AI Agents
What is WebMCP?
WebMCP (Web Model Context Protocol) is an initiative that lets a web page expose “tools”—functions described in natural language and with structured schemas—to AI agents and browser-based assistants. In practice, a site using WebMCP can act as a client-side MCP server: it tells agents how and where to interact (e.g. book a flight, submit a form, browse data), making workflows more reliable and precise than raw DOM manipulation.
WebMCP is developed by the Web Machine Learning Community Group at the W3C, with contributors such as Google and Microsoft. A first draft of the specification was published in February 2026. Google also runs an early preview program (EPP) in Chrome to experiment with two API styles: declarative (HTML forms) and imperative (JavaScript).
Important: the specification is still in development (draft), and aspects such as security and privacy are not yet fixed. WebMCP is therefore an evolving feature.
See the "unofficial" draft WebMCP specification (W3C, Web Machine Learning Community Group)
Declarative and imperative APIs
-
Declarative API: standard actions can be described directly in HTML forms. Agents can fill fields and submit forms without running arbitrary code. Best for predictable flows (contact forms, search, filter options).
-
Imperative API: more complex, dynamic interactions require JavaScript execution (e.g.
navigator.modelContext). Developers register “tools” with a name, natural-language description, input schema (JSON Schema), and a function to call. Agents invoke these tools instead of driving the DOM blindly.
Both approaches act as a bridge between the site and agents, for an “agent-ready” web with more robust workflows.
The navigator.modelContext API
In the current spec, the ModelContext interface is exposed via navigator.modelContext (secure context). It lets you register and manage tools:
-
provideContext(options): registers a set of tools and replaces any existing context. Useful for single-page apps that want to expose different tools depending on UI state. -
clearContext(): removes all context (all tools). -
registerTool(tool): adds a single tool without clearing others. Each tool has aname,description,inputSchema(JSON Schema), and anexecutefunction invoked when the agent calls the tool. -
unregisterTool(name): removes the tool with the given name.
Each tool is described by a ModelContextTool dictionary: name, description, inputSchema, execute (callback), and optionally annotations (e.g. readOnlyHint to indicate a read-only tool). The ModelContextClient interface lets a tool request user interaction (e.g. confirmation) via requestUserInteraction(callback).
Functions can be asynchronous (return a Promise); handling can be delegated to workers.
Typical use cases
- Customer support: an agent fills out a support ticket form with technical details to speed up request creation.
- E-commerce: product search, option configuration, checkout flow using structured data for accurate results.
- Travel: flight search, filters, bookings using described tools instead of page scraping.
Current limits and risks
- The security / privacy section of the spec is still empty. Classic risks (CSRF, XSS, etc.) and how they apply to WebMCP, as well as interaction with other APIs (Web AI, Prompt API), remain to be specified.
- There is no standard yet to discover a site’s tools without visiting it (a manifest retrievable via GET has been explored but is not stable).
- Synchronization between UI and application state is not defined by the spec; implementations must handle it.
What AI Ready Viewer measures today (and what it does not claim to measure)
What we measure:
AI Ready Viewer measures WebMCP and agent-readiness signals that can be detected on audited sites: technical readiness (structure, metadata, llms.txt, robots.txt, sitemap), and when observable, presence of documentation or agent-oriented usage (references to WebMCP, Model Context, best practices). These signals help assess whether a site is preparing for use by AI agents.
What we do not claim to measure:
We do not measure actual execution of the navigator.modelContext API in a browser (runtime), nor strict compliance with the evolving WebMCP specification. Detection is based on what is observable during an audit (content, structure, files, metadata).