WebMCP: browser agents and online stores
Understand WebMCP’s role in browser-agent interactions. Compare it with server MCP, inspect shopping actions and check support, permissions and fallbacks.
- Published
- Last updated
WebMCP is a proposed browser interface through which a website exposes actions that an AI agent can call. A store can describe a product-search tool directly, reducing the need for an agent to interpret buttons and simulate clicks.
WebMCP is experimental. The specification is a Draft Community Group Report, not a W3C Standard or a specification on the W3C Standards Track. A retailer must distinguish that status from a platform announcing an integration.
What WebMCP exposes
WebMCP exposes named tools with descriptions and structured inputs, backed by functions on the page. A hypothetical search tool could accept a product category and a maximum price. The agent can request that action without guessing which search field to fill.
The store defines the tool and connects it to the store’s existing behaviour. A compatible browser makes the tool available. An agent interprets the customer’s request and chooses whether to call it. Each part must support the interaction.
The WebMCP specification places the JavaScript interface on document.modelContext. Chrome also documents a declarative approach that adds tool annotations to HTML forms. These are ways to expose page actions, without replacing the storefront customers already use.
A tool definition describes what an action does. It doesn’t establish that the agent understood the customer or that the store implemented the action correctly. Keep input validation and access checks in the actual operation.
WebMCP and server MCP solve different connections
WebMCP exposes actions in a page, while a server Model Context Protocol (MCP) connection lets an AI application call a separate server. The MCP architecture documentation describes servers running either locally or remotely. A store connector typically reaches store services through its own authorised connection.
A browser action can use the active storefront’s session and application state. That can include the basket the customer sees. A remote connector doesn’t automatically inherit that browser session. Its credentials and permissions determine which store data and actions it can access.
The two approaches can work together. Cloudflare’s Commerce integration announcement describes a browser bridge to existing server-side shopping tools. The browser entry point and backend connection remain different parts of that system.
For example, a Shopify MCP connector concerns an agent’s server connection to store capabilities. Adding that connector doesn’t by itself prove the storefront exposes WebMCP tools. Equally, a browser finding a search tool doesn’t establish that it can pay for an order.
Choose the connection from the customer journey. An assistant working in an open storefront needs that page’s context. An assistant connecting to a store outside that page needs the appropriate server interface and authority.
Choose shopping actions deliberately
Separate reading catalogue information from changing a basket or placing an order. For each tool, define the permitted session and the result the customer can observe. Authentication proves who is signed in. It doesn’t prove what that customer asked an agent to do.
Catalogue search
A public search can accept “waterproof jacket under $120” and return matching product identifiers with current prices. It usually needs no customer account. Keep personalised offers behind the same access checks used by the ordinary store.
A search request authorises a search. It doesn’t authorise adding the first result to a basket. Return enough information for the customer to understand why a product matches.
Product options
A product-options tool can read available sizes and colours for a selected product. Bind its result to the actual variant identifier. A product name alone doesn’t identify the navy size-M variant the customer wants.
If the requested option is unavailable, return that outcome. Ask before substituting another colour or size. Recheck stock when the customer proceeds because a previously displayed option can sell out.
Basket changes
A basket tool changes the current shopping session. It can operate on a guest basket if the storefront permits that. An account-specific basket must pass the store’s account checks.
Require a clear instruction for the exact variant and quantity. After the action, show the resulting basket so the customer can inspect the change. Keep purchase confirmation separate from permission to add an item.
Google’s WebMCP tool security guidance describes hints for read-only tools and consequential actions. These hints help an agent decide how to handle a call. They don’t replace enforcement by the store or the agent’s own protections.
For a purchase, require the authority that the actual checkout flow needs. Present the final goods and quantities with the payable total before the customer confirms. An open product page supplies none of that approval by itself.
Evaluate browser and platform support
Evaluate the specification, browser implementation and store integration separately. The specification describes the interface. A browser trial makes an implementation available under particular conditions. A platform rollout supplies an integration for eligible stores.
Google’s Chrome WebMCP documentation describes an origin trial from Chrome 149 and a flag for local development. An origin trial lets sites try an experimental feature in supported browsers. It is different from an ordinary supported release available to every visitor.
For local evaluation, Chrome documents chrome://flags/#enable-webmcp-testing. Enable it in a test browser and relaunch that browser. Record the exact browser version and the agent you use, because a working API doesn’t prove that every assistant calls it.
Check whether the page exposes document.modelContext in the intended environment. Older examples can use navigator.modelContext. Google’s current implementation guidance uses the document interface. Follow the interface supported by the browser you are evaluating.
Commerce announces that eligible BigCommerce stores receive its integration by default. Its announced flow lets browser agents search products and build a basket, then returns checkout to the merchant’s storefront. Cloudflare describes merchant opt-out controls and a fallback when the browser lacks support.
Those announcements establish a particular integration. They don’t establish support across all BigCommerce configurations, other platforms or every browser agent. Inspect the tools actually exposed on the intended storefront and test them with the intended customer session.
Declaring tools also doesn’t guarantee discovery or sales. Chrome documents that a client must visit the site to discover its callable tools.
Keep the customer journey usable
Keep the normal storefront usable when a WebMCP action is unavailable or fails. If the browser lacks the interface, customers must still be able to search and use the basket themselves. Cloudflare describes this fallback in its integration.
If a session expires, stop protected actions and request sign-in through the store’s normal flow. Resume only after checking the active account and basket again. Avoid replaying a basket change automatically when its first result is uncertain.
Reject invalid tool results, such as a variant identifier that doesn’t belong to the selected product. Show a useful failure and leave the basket unchanged. Treat instructions embedded in returned reviews or product text as untrusted content. Google’s agent security guidance explains this prompt-injection risk.
Use a bounded test with entirely invented products and a non-production basket. This is an example test design, not a reported compatibility result:
- Start with an empty guest basket and an invented Harbour jacket priced at $89. Its navy size-M variant is in stock. The customer asks to find a jacket under $100.
- Run search and inspect the options. The expected basket remains empty because the customer has authorised only reading information.
- Ask the customer to approve adding one navy size-M jacket. After that instruction, call the basket action. The expected basket contains exactly one matching variant at $89, before delivery charges.
- Reset to an empty test basket and return an invalid variant. Expect a rejected action with the basket still empty. Separately, expire a signed-in session and confirm account-protected actions stop.
- Ask the agent to continue after the basket is ready, without authorising a purchase. It must stop at the purchase boundary. Verify that the purchase stops before an order or payment is created.
Inspect saved basket state after a reload, then complete the same journey through the normal storefront controls. Expose only the actions whose effects and stopping points you can observe and enforce.
Give your store its own shopping agent
Customers ask in their own words. Your agent finds, compares and checks out from your catalogue, right on your site.