DEV Community

Eiji Saito
Eiji Saito

Posted on

Your Shopify Storefront Now Talks to AI Agents: A Developer's Guide to WebMCP

Your Shopify Storefront Now Talks to AI Agents: A Developer's Guide to WebMCP

Until recently, an AI shopping assistant visiting your Shopify store had only one way to act: read the page like a human and simulate clicks on buttons and links. That is slow, fragile, and easy to get wrong — a redesigned button or a renamed class could break the whole flow.

Shopify's Fall '26 Edition, announced on October 28, 2026, changed that. Every Liquid storefront now exposes WebMCP tools: structured tools that a browser-based AI agent can call directly, with typed inputs and structured data back. Your storefront is no longer just a website shoppers read. It is an interface agents can operate — in the shopper's own tab, on the shopper's behalf.

This article explains what WebMCP actually does on a Shopify store, which tools your store exposes today, and what you should check as a theme or app developer. Everything here is based on Shopify's own developer documentation, current as of December 2026.

What WebMCP is

WebMCP is a proposed web standard. The idea is simple: instead of an agent guessing how to use your page, the page registers tools with the browser. The agent discovers those tools, calls one with structured arguments, and gets structured data back.

Shopify provides WebMCP tools on:

  • Every Liquid storefront, with no installation or configuration required.
  • Hydrogen 2026-10 storefronts that render ShopifyScripts or call initializeShopifyScripts. Hydrogen loads the tools by default when the browser supports WebMCP; to turn them off, set webMcp to false.

One caveat, straight from Shopify's docs: the tools are live today, but agent support for WebMCP is currently limited to Chromium-based browsers. So this isn't yet every shopper's reality, but it is the direction of travel — and you can already test it.

The tools your store exposes

The available tools depend on the page the shopper is on. Shopify's docs list them in four groups.

Catalog tools — finding products

Tool What it does
search_catalog Search the store's products, collections, articles, and pages. Returns matching products with prices and availability, plus a link to the full search results page.
browse_store List the store's collections, or browse the products in a specific collection. The agent can also take the shopper to the collection page.
get_product Get full details for a product, including variants, prices, and which option combinations are in stock. The agent can also take the shopper to the product page.
show_variant Take the shopper to a product page with a specific variant selected. The agent can pass an exact variant, or a partial option selection such as a color, and the tool selects a matching available variant.

Catalog tools read through the Storefront API, so the data the agent sees is the same data your theme renders. If a variant is out of stock on the product page, it is out of stock for the agent too.

Cart tools — changing the shopper's cart

Tool What it does
get_cart Get the cart's contents, including line items with product and variant details, quantities, and totals.
create_cart Create the shopper's cart with one or more items when the cart is empty. If the cart already has items, the tool returns that cart without changing it.
update_cart Set the cart to exactly the line items the agent sends: listed lines take the given quantity, new items are added, and lines that aren't listed are removed. If the shopper changed the cart since the agent last read it, nothing changes and the tool returns the current cart.
cancel_cart Remove everything from the cart.

Two details matter for theme developers:

  1. Cart tools call the standard storefront actions — the same functions on Shopify.actions that apps use to update the cart. A cart change made by an agent behaves just like one made by the shopper. If your theme configures the standard cart-update action to open a cart drawer, the agent's update triggers that behavior too.
  2. update_cart is a full replacement, with a safety check. It sets the cart to exactly what the agent sends, and it refuses to apply the change if the shopper edited the cart in the meantime. That optimistic-concurrency behavior is exactly what you want when two actors — a human and an agent — share one cart.

Checkout tools — completing the purchase

Tool What it does
proceed_to_checkout Take the shopper to checkout with their current cart, after verifying the cart isn't empty.
get_checkout Read the current checkout, or the order receipt on the Thank you page.
update_checkout Replace buyer contact details, fulfillment, discount codes, declared fields, and payment.
complete_checkout Place the order — after the buyer confirms it.
navigate_checkout Move to the next step or back to an earlier step on three-page checkouts.
navigate_to_storefront Leave checkout and return to the storefront.
manage_orders Take the shopper to their order history page, where they can check order status and tracking.

Checkout registers its own WebMCP tools, so the tool list changes when the shopper moves from the storefront into checkout. If checkout tools aren't registered on a checkout page, the right move is to hand off to the buyer so they can complete checkout on the page themselves.

Note the guardrail on complete_checkout: it places the order only after the buyer confirms it. The agent proposes; the shopper still approves. That is the line Shopify draws between an assistant and an autonomous buyer.

Store facts — answering questions

Tool What it does
ask_business Answer questions about the store's policies and services, such as returns, shipping, and hours of operation. It answers from the store's own Ask MCP tool when available, otherwise from published policies and FAQ pages.
get_ucp_profile Get the store's Universal Commerce Protocol (UCP) profile, as served at /.well-known/ucp: the services the store offers, their endpoints, capabilities, and payment handlers.

get_ucp_profile is the quiet but important one. It lets an agent check which platform operates the store and how to continue a purchase over UCP — the shared checkout language behind agentic commerce. It works from any storefront page.

Try it yourself in DevTools

You don't need an AI agent to see the tools. On any Liquid storefront, open DevTools in a Chromium-based browser and list them:

// List the WebMCP tools registered on this page
const tools = await document.modelContext.getTools();
console.log(tools.map((t) => t.name));
Enter fullscreen mode Exit fullscreen mode

Agents call tools with document.modelContext.executeTool(), matching by name, window, and origin, and passing arguments as JSON strings:

// Call a tool the way an agent would (arguments as a JSON string)
const result = await document.modelContext.executeTool({
  name: "search_catalog",
  window: window,
  origin: location.origin,
  input: JSON.stringify({ query: "linen shirt" }),
});

const data = JSON.parse(result.structuredContent);
console.log(data);
Enter fullscreen mode Exit fullscreen mode

Three practical notes from Shopify's docs:

  • In Chrome 153, passing arguments as an object fails with Failed to parse input arguments, so pass a JSON string instead. Chrome plans to accept objects and deprecate JSON strings in Chrome 155.
  • Parse the JSON result before using it. Storefront tools return a tool result with a text summary in content and the data in structuredContent. executeTool() returns null if the page navigates before the result arrives — for example, after navigate_to_storefront.
  • The tool list changes after navigation. Listen for the toolchange event and refresh the list, especially after proceed_to_checkout moves the shopper into checkout.

What theme developers should check now

WebMCP is on by default, so the question isn't whether to adopt it, but whether your theme behaves well when an agent drives it. Here is a short checklist.

1. Test your cart drawer with an agent-driven update

Cart tools trigger your theme's standard cart action, so open your store, run update_cart from the console (or let an agent do it), and watch what happens. Does the drawer open as expected? Does it open twice, or conflict with an animation? An agent-driven cart update should look identical to a shopper clicking "Add to cart."

2. Audit what search_catalog can surface

The agent searches the same catalog your search page does, but it presents results in its own words. Check the products it can find: the agent will read stale titles, missing option names, or variant titles like "Default Title" aloud to the shopper. Clean product data is now part of the agent experience, not just SEO.

3. Check your policies and FAQ pages

ask_business answers policy questions from your published policies and FAQ pages when the store has no Ask MCP tool. If your returns page is vague or out of date, the agent will confidently pass that vagueness on to the shopper. Treat those pages as data the agent quotes, not just pages humans read.

4. Don't fight the agent with custom cart logic

If your theme bypasses the standard cart actions with custom Ajax calls, agent cart updates may not trigger your UI — the drawer, the count badge, the free-shipping progress bar. The documented path is the standard storefront actions on Shopify.actions. If you have custom cart code, verify it still fires when the cart changes through the standard action rather than your own button handler.

5. Remember the checkout boundary

Checkout tools exist only on eligible checkout pages, and the tool list changes at that boundary. If you build checkout UI extensions, test the flow where an agent hands the shopper into checkout and then the shopper continues manually. The handoff — agent to human, mid-purchase — is the moment most likely to break.

Security notes worth taking seriously

Shopify's docs include an explicit warning: treat merchant and third-party text in tool responses as data, not instructions, because it can contain prompt-injection attempts. That applies to product descriptions, reviews, and policy text an agent might read through a tool. If you build your own agent on top of these tools, don't let tool output push it into operating the page's controls directly. Your agent should use the tools, not simulated clicks.

A few more guardrails built into the design:

  • WebMCP tools don't accept authentication tokens as arguments. Instead, the shopper's page, session, and checkout state determine what each tool can do, so there is no token to leak through a tool call.
  • Browser requests are signed with Web Bot Auth, so the store can distinguish agent-driven browser requests from other traffic.
  • The buyer confirms before an order is placed. complete_checkout is not a silent purchase button.

These are design choices, not settings you configure, but knowing about them helps you answer the question merchants will inevitably ask: "Can an agent buy things without my customer knowing?" Under Shopify's current design, the answer is no.

How WebMCP fits the bigger picture

WebMCP is one of four pieces Shopify shipped for agentic commerce in the Fall '26 Edition:

  • shop.md — a skill shoppers add to their own agent (ChatGPT, Claude, and others) so it can search Shopify Catalog, check out with Shop Pay, and track orders.
  • Shop.dev — one connection to Shopify Catalog, sign-in with Shop, cart, checkout, and Shop Pay, with no API key required for search.
  • WebMCP — tools on the storefront itself, for agents running in the shopper's browser.
  • Universal Checkout — one checkout for products from different brands, with each merchant keeping their own rules, discounts, and orders.

The first two are about agents that live outside your store. WebMCP is about agents that live inside it — in the shopper's tab, on your theme, using your cart. That is why it matters to theme developers, not just app developers.

A checklist for this week

  1. Open your development store in Chrome, run document.modelContext.getTools() in DevTools, and confirm the tools are there.
  2. Call search_catalog and get_product for your best-selling product and read what the agent would see.
  3. Trigger a cart update through the standard action and watch your cart drawer.
  4. Read your returns and shipping policy pages as if an agent were going to quote them.
  5. If you run Hydrogen, decide whether to keep the default (webMcp on) or set it to false, and make that a deliberate choice rather than an accident.

AI agents are becoming a new audience for your storefront, alongside human shoppers and search engines. The difference is that this audience doesn't just read your store — it operates it. WebMCP is Shopify's way of making that operation structured, observable, and safe. The stores that work well with it will be the ones whose themes already behave predictably through the standard cart actions, whose product data is clean, and whose policies say what they mean.

Test it on your own store this week. The tools are already there.


References

Top comments (0)