Shopify’s WebMCP Rollout Shows Why Agent Tools Need Shared Cart State
- Robert Martinez
- 507 reads
Shopify’s WebMCP tools connect agents to storefronts and checkout, with structured cart updates improving reliability while exposing gaps in testing and user control.

Web agents work better when a storefront offers more than buttons to click. Shopify’s WebMCP rollout gives browser-based agents structured tools for product search, cart management and checkout, while keeping the buyer in the merchant’s live site. The deployment also surfaced a practical lesson: reliable agent workflows depend less on elaborate instructions and more on tool designs that make repeated actions safe.

Shopify shipped WebMCP tools to every Liquid storefront in August, with the latest Hydrogen storefronts following. In September, it added Checkout WebMCP, letting an agent help a buyer through checkout in a shared browser session while leaving the buyer to confirm the order. Shopify says its implementation is intended to work across storefronts, rather than requiring each merchant to build a separate agent interface.
Why give browser agents structured tools?
Agents can interact with commerce sites in three broad ways. They can call merchant services directly over HTTP, as server-side MCP agents do. They can display part of a merchant’s experience inside their own interface, as with the Embedded Checkout Protocol. Or they can work alongside a person in a browser, using the real site and session. That last mode, often called co-browsing, can run in the person’s browser or a cloud browser, with the agent working independently until it needs the person’s attention.
Shopify supports all three approaches. Its case for co-browsing is that the merchant’s existing relationship with the buyer and the storefront’s visual identity remain present during the interaction. But there’s a technical cost to relying on ordinary browser automation: an agent must inspect a page, interpret its controls and then operate them through scripts or an automation protocol. It may use screenshots, the DOM or the accessibility tree to work out what to do.
That process is slower and more error-prone than calling a purpose-built function. It can also be awkward for the person watching an agent navigate a human-oriented interface. Checkout adds another concern: merchants may need an explicit signal that the buyer has approved a consequential step before an order can be completed.
WebMCP offers a more structured arrangement. A page registers tools with descriptions and defined input and output schemas; an agent discovers the tools and calls the relevant one directly. Instead of guessing which button or field to manipulate, the agent can request an operation and receive structured results, including information about where the buyer needs to step in.
In a Shopify checkout benchmark, WebMCP averaged 10.3 seconds per attempt, compared with 27.4 seconds for browser automation. Shopify reported a 58% lower cost and 60 successful attempts out of 60, versus 56 out of 60 for browser automation.

Those results are specific to Shopify’s test, not a guarantee for every agent or storefront. Still, they illustrate why structured calls matter: they reduce the amount of page interpretation an agent must do. Shopify argues that clearer schemas could also make simpler models practical for routine browsing, rather than requiring a high-end model for every shopping task.
Keeping the storefront and cart in sync
Shopify’s first implementation idea was to adapt its server-side MCP tools for use by browser agents. That looked like a straightforward reuse of existing capabilities, but it missed a defining feature of co-browsing: the agent and the buyer share a visible page whose interface needs to reflect what the agent has done.
A server-side cart operation can change backend data without updating the cart displayed in the storefront. The buyer then sees one version of the cart while the server holds another. That mismatch undermines the handoff between agent and person, even if the backend operation itself succeeded.
Shopify changed its approach to use Standard Actions. These let the platform notify storefront themes when an operation, such as a cart change, should trigger a user-interface update. The aim is to keep client-side and server-side state aligned, preserving continuity when a buyer takes over or checks the agent’s work.
The team also wrapped tool calls in monitoring code. That provides visibility into how often Shopify’s tools are called and helps identify increases in errors across storefronts. It’s a necessary operational layer for a shared implementation, though it doesn’t reveal whether an agent completed the buyer’s broader task or whether the interaction went well from the buyer’s perspective.
Browser support also shaped the rollout. The ChatGPT desktop app includes WebMCP in its built-in browser, while the feature remains in an Origin Trial in Chrome and Edge. Shopify used a third-party Origin Trial to turn it on across storefronts. Registering a token separately for every merchant domain wasn’t practical, so Shopify registered cdn.shopify.com and used an existing script loaded on storefronts to inject the token. The implementation may need changes if the API changes as it moves toward release.
UCP schemas shape the tools
Rather than inventing a separate set of data structures for browser agents, Shopify built its tools around Universal Commerce Protocol (UCP) schemas. Shopify says these schemas have been tested with server-side agents and are designed for catalog queries, cart creation and updates, and complex checkout flows.
That choice offers continuity: an agent can move from server-side actions to browser-based actions while working with familiar tools and semantics. It may also help model training, because well-defined schemas and descriptions can give models clearer examples of the tasks they need to perform. WebMCP does not yet have a defined transport for UCP, but Shopify has opened a proposal to add one. If adopted, that could make it clearer which UCP behaviors a WebMCP implementation supports.
The storefront tools cover product discovery and the shopping journey: agents can search the catalog, find products, add items to and manage the cart, then proceed to checkout. They can also query store information or direct a buyer to the orders page.
Checkout tools let the agent inspect the current checkout, make changes and request completion. The final operation carries a consequentialHint annotation, which signals that the agent should involve the buyer rather than treating completion as an ordinary background action. That annotation is a cue for the agent, not a browser-enforced guarantee that the person has confirmed.
Testing the interface, not just the code
Shopify needed a way to check that the tools continued to behave as their design changed. It split its continuous-integration tests into two groups. Deterministic tests verify that a tool performs the expected operation when called, much like conventional JavaScript tests. Agent evaluations test a different question: can different models interpret the tool shapes and use them correctly for a given task?
For those evaluations, the team wrote user journeys and converted them into JSON test cases, with a user request, expected tool calls and mocked outputs intended to lead the agent through the next step. The tests run when WebMCP code changes, using Chrome’s open-source WebMCP evals project. Shopify also contributed changes to address gaps it encountered.
These evaluations run against models, not complete browser agents. That distinction matters: a deployed agent also includes a harness, system instructions and security checks, all of which can affect its behavior. The evaluations can catch problems in tool design, but they don’t reproduce the full runtime environment.
Idempotent cart changes beat stronger instructions
One recurring failure involved adding products to a cart. Some agents called add_to_cart repeatedly to verify that the first call had worked, even when the tool returned a success result. That could add the same product more than once.
Shopify used AgentBoard, an open-source Chrome extension built by Shopify’s Ilya Grigorik, to inspect agent reasoning logs. The investigation linked the duplicate actions to page navigation after an item was added. On themes that didn’t implement the relevant Standard Action, navigation could happen before the tool returned its result. The agent then missed the success response, and navigation also cleared state held in memory by the WebMCP library.
Shopify first made the flow more resilient by storing state in localStorage and returning tool results before navigation. The more substantial change was to replace add_to_cart with UCP’s create_cart and update_cart tools.
With the revised design, the agent supplies the full cart state it wants to update and receives the resulting cart state in return. If the cart changes outside the tool—for example, because the buyer edits it directly—the update is rejected with an error describing the change. A repeated update with the same cart state becomes a no-op rather than adding another item.
This proved more dependable than repeatedly refining tool descriptions to tell agents not to retry. The tool’s structure and semantics guided behavior more effectively than extra wording. Shopify also notes that some agent vendors may treat instructions embedded in tool prompts as prompt-injection attempts, another reason to encode safe behavior in the operation itself.
What the rollout still can’t solve
Observability remains incomplete. Shopify can count and time calls to its own client-side tools, but tracking merchant-added tools may be harder. More fundamentally, a completed tool call doesn’t tell Shopify whether the agent fulfilled the buyer’s request, got confused, called the wrong tool or left the session unfinished. Nor does it indicate whether the person was satisfied.
Shopify has proposed real-user measurement for agent interactions. Feedback from agents and a buyer’s negative rating could help assess outcomes, but collecting and sharing such signals raises privacy questions.
Human confirmation also needs stronger support. Tool descriptions, outputs and consequentialHint can tell an agent to pause for the buyer, but Shopify would prefer a browser mechanism that can enforce the handoff. It has raised a proposal for browser-enforced confirmation.
Merchant systems also need to distinguish legitimate agents acting for buyers from unwanted automated traffic. Cloud-based agents can sign requests with Web Bot Auth; an agent running in a buyer’s own browser lacks a safe place to store a private key. Shopify points to proposals such as MoLE as possible groundwork for agents to identify themselves and prove they’re acting for a buyer in good standing. Separately, the team wants a way to distinguish human and agent interactions with a page, as raised in a WebMCP proposal.
Navigation creates another lifecycle problem. WebMCP tools are registered on an HTML document, so moving to another page tears them down and requires registration again. Shopify uses loading logic to register tools on initial visits and restore them quickly on later navigation, but slow networks can leave agents waiting or confused. A shared worker with a longer lifetime could preserve tools and state across same-origin page changes.
Finally, Shopify can’t yet run its automated evaluations against fully assembled browser agents. Standard infrastructure such as WebDriver BiDi could help if it exposed interfaces for testing agents that include their model, harness and other runtime components.
A broader effort around agent behavior
These gaps extend beyond the tool API itself. As WebMCP adoption grows, questions about measurement, identity, automation and threat modeling need a place to be worked through together. The W3C is drafting a charter for an Agentic Web Working Group that would cover those areas, along with WebMCP. Shopify’s Yoav Weiss is among its proposed co-chairs; if the charter is approved, work could begin in early 2027.
For Shopify merchants, the platform’s storefront tools are already available without additional setup. For teams building their own agent interfaces, the clearest practical lesson is to start with real user journeys, turn those journeys into evaluations and design tool behavior so that retries are safe. Better descriptions help, but predictable state transitions and explicit confirmation paths are the parts that will matter most as browser agents take on more of the shopping flow.