WebMCP explained: Inside Chrome 146’s agent-ready web preview
The digital landscape is undergoing a fundamental shift. For decades, the internet has been designed primarily for human eyes. We navigate through visual cues: buttons with gradients, drop-down menus, and layouts optimized for a 15-inch laptop or a 6-inch smartphone. However, a new class of users is emerging that doesn’t care about aesthetics—AI agents. These autonomous programs are designed to navigate the web, book services, and complete transactions on behalf of human users. To facilitate this, Google has introduced a groundbreaking proposal in Chrome 146: WebMCP. WebMCP, or the Web Model Context Protocol, is currently available as an early preview behind a feature flag. It represents a paradigm shift in how websites communicate with Large Language Models (LLMs) and AI agents. Instead of forcing an AI to “guess” how a website works by scraping its HTML, WebMCP allows developers to expose structured tools directly to the browser. This ensures that agents can interact with site functionality with the same precision as a developer using an API, but without the massive overhead of building a separate, public-facing API for every site feature. The Evolution from a Human Web to an Agentic Web Since the early days of the World Wide Web, the goal of web design has been user experience (UX) for humans. We use CSS to make things pretty and JavaScript to make things interactive. When an AI agent currently tries to use a website, it has to perform a series of complex tasks: it must “see” the page (often via screenshots or DOM analysis), interpret what a button does based on its label or proximity to other elements, and attempt to fill out forms by predicting which data goes into which field. This current method is notoriously fragile. A simple change in a CSS class or the color of a “Submit” button can break an AI agent’s workflow. Furthermore, A/B testing—where different users see different versions of a site—can completely confuse an agent that was trained on a specific layout. WebMCP addresses this by moving the interaction layer from the visual “surface” of the site to a structured “functional” layer. By implementing WebMCP, a website essentially provides a manual to the AI agent. It says, “Don’t worry about what the button looks like. Here is a function called ‘BookFlight.’ It requires a date, a destination, and a passenger count. If you call this function with those parameters, I will return a confirmation number.” This transition marks the beginning of the “Agentic Web,” where websites are built to be both human-readable and machine-actionable. Inside the Mechanics: How WebMCP Operates WebMCP operates as a bridge between the browser and the AI model. It provides a standardized way for a website to tell an AI agent what it is capable of doing. This communication happens through three primary phases: Discovery, Schema Definition, and State Management. 1. Discovery: Mapping Capabilities When an AI agent lands on a WebMCP-enabled page, the first thing it does is ask the browser, “What tools are available here?” The site then provides a manifest of actions. On an e-commerce site, these might include ‘searchProducts,’ ‘addToCart,’ and ‘checkout.’ On a B2B portal, they might include ‘requestQuote’ or ‘checkInventory.’ This discovery process eliminates the need for the agent to crawl every link on the page to figure out what the site is for. 2. JSON Schemas: Defining the Language Once the agent knows what tools exist, it needs to know how to use them. WebMCP uses JSON Schemas to provide these definitions. A JSON Schema acts as a contract. It defines exactly what inputs are required (e.g., a string for a name, an integer for a quantity) and what the output will look like (e.g., a JSON object containing a price and a tracking number). This structure removes the guesswork, ensuring that the agent provides valid data every time. 3. State Management: Contextual Tools One of the most intelligent features of WebMCP is its ability to handle “State.” Tools can be registered or unregistered dynamically based on what the user (or agent) is doing. For instance, a ‘processPayment’ tool shouldn’t be visible if the shopping cart is empty. Once an item is added, the site updates its context, and the payment tool becomes available. This prevents AI agents from trying to take actions that aren’t yet valid, streamlining the process and reducing errors. Two Paths to Implementation: Imperative vs. Declarative APIs Google has designed WebMCP to be accessible for developers of all levels. There are two primary ways to make a website “agent-ready”: the Imperative API and the Declarative API. The Imperative API: Developer Control The Imperative API is designed for complex, highly dynamic web applications. It allows developers to define tools programmatically using JavaScript through the navigator.modelContext interface. This is ideal for Single Page Applications (SPAs) where the functionality changes rapidly without a page reload. Using the Imperative API, a developer can write a script that registers a tool with a specific name and a handler function. When the AI agent decides to “call” that tool, the JavaScript function executes on the page, interacting with the site’s internal logic. This gives developers total control over how the agent interacts with their backend and frontend systems. The Declarative API: Retrofitting with Ease The Declarative API is perhaps the most exciting part of WebMCP for the broader web. It allows developers to make existing HTML forms agent-compatible by simply adding a few attributes. By adding tags like toolname and tooldescription directly to a <form> element, the browser automatically handles the heavy lifting. The browser reads the form fields, generates the necessary JSON Schema, and presents it to the AI agent. If the toolautosubmit attribute is present, the agent can even fill out and submit the form in one go. This means that millions of existing websites—from local restaurant reservation pages to government contact forms—could become AI-compatible with just a few lines of HTML code. Real-World Impact: B2B and B2C Scenarios To understand the magnitude of WebMCP, we must look at