StackMCP
Blog
·9 min read

WebMCP for Ecommerce: How to Make Your Online Store AI-Agent Ready

AI agents will browse and buy from your store. WebMCP lets you expose product search, cart actions, and checkout to any AI agent — here's how to implement it.

webmcpecommerceai-agentsweb-standard

Your next customer might not have a browser window. AI agents are learning to shop on behalf of users -- researching products, comparing prices, and completing purchases. WebMCP is the emerging web standard that lets your storefront speak a language those agents understand.

graph LR
    subgraph Today["Today: Fragile"]
        A1[AI Agent] -->|Headless browser<br/>scrape DOM| S1[Store]
        S1 -->|Raw HTML| A1
    end

    subgraph WebMCP["With WebMCP: Structured"]
        A2[AI Agent] -->|search_products| S2[Store]
        S2 -->|JSON: products,<br/>prices, stock| A2
        A2 -->|add_to_cart| S2
        S2 -->|JSON: cart state| A2
        A2 -->|begin_checkout| S2
        S2 -->|JSON: order ID| A2
    end

Published as a W3C Community Group report on February 10, 2026, WebMCP defines a structured way for websites to expose actions to AI agents. For ecommerce, that means product search, add-to-cart, and checkout become typed tool calls instead of fragile DOM scraping. Chrome 146 Canary has the first implementation, with stable browser support expected mid-to-late 2026.

What WebMCP Means for Online Stores

Today, an AI agent shopping on your site has two options: simulate clicks with a headless browser (slow, brittle, breaks on every redesign), or use your REST API (requires API keys, rate limiting, not designed for shopping workflows).

WebMCP introduces a third path. Your storefront declares the tools it supports, and any AI agent visiting your site can discover and call them through a standardized interface. Authentication flows through the user's existing browser session. No API keys, no scraping.

Product search returns clean JSON with prices, availability, and images. "Add to cart" is a typed function call, not a simulated button click. This is the same shift that happened with structured data and search engines -- stores that added JSON-LD schema got rich snippets. Stores that add WebMCP tools will get clean AI-agent interactions.

The Declarative Approach: Annotating Existing Forms

The easiest starting point. Add three attributes -- toolname, tooldescription, and optionally toolautosubmit -- to forms you already have.

<form toolname="search_products" tooldescription="Search the product catalog by keyword, category, or price range">
  <input name="query" type="text" />
  <input name="category" type="hidden" value="electronics" />
  <input name="min_price" type="number" />
  <input name="max_price" type="number" />
  <button type="submit">Search</button>
</form>

Add to Cart

<form toolname="add_to_cart" tooldescription="Add a product to the shopping cart with specified quantity">
  <input name="product_id" type="hidden" value="sku-12345" />
  <input name="quantity" type="number" value="1" min="1" max="10" />
  <button type="submit">Add to Cart</button>
</form>

Checkout

<form toolname="begin_checkout" tooldescription="Start checkout with shipping address and selected shipping method">
  <input name="email" type="email" />
  <input name="shipping_address" type="text" />
  <input name="shipping_method" type="text" />
  <button type="submit">Continue to Payment</button>
</form>

These attributes are ignored by browsers that do not support WebMCP. Your forms work exactly as before. Zero risk in adding them today. For more on the declarative API in React/Next.js apps, see our WebMCP implementation guide.

The Imperative Approach: JavaScript for Complex Operations

The declarative API covers form-based interactions, but ecommerce often needs more. Checking real-time inventory, applying coupons, or fetching detailed product data -- these use the imperative JavaScript API via navigator.modelContext.

Product Details

navigator.modelContext.registerTool({
  name: "get_product_details",
  description: "Get full product details including price, availability, specs, and reviews",
  inputSchema: {
    type: "object",
    properties: {
      productId: { type: "string", description: "Product SKU or URL slug" }
    },
    required: ["productId"]
  },
  handler: async ({ productId }) => {
    const res = await fetch(`/api/products/${productId}`);
    return await res.json();
  }
});

Compare this to an agent scraping your product page and trying to extract the price from a <span class="price__current--sale"> element.

Inventory Check

navigator.modelContext.registerTool({
  name: "check_inventory",
  description: "Check real-time stock availability for a product in a specific size or variant",
  inputSchema: {
    type: "object",
    properties: {
      productId: { type: "string", description: "Product SKU" },
      variant: { type: "string", description: "Size, color, or variant identifier" }
    },
    required: ["productId"]
  },
  handler: async ({ productId, variant }) => {
    const params = new URLSearchParams({ productId, ...(variant && { variant }) });
    const res = await fetch(`/api/inventory?${params}`);
    return await res.json();
  }
});

Apply Coupon

navigator.modelContext.registerTool({
  name: "apply_coupon",
  description: "Apply a discount or coupon code to the current cart",
  inputSchema: {
    type: "object",
    properties: {
      code: { type: "string", description: "Coupon or discount code" }
    },
    required: ["code"]
  },
  handler: async ({ code }) => {
    const res = await fetch("/api/cart/coupon", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ code })
    });
    return await res.json();
  }
});

Order Tracking

navigator.modelContext.registerTool({
  name: "track_order",
  description: "Get current shipping status and tracking details for an order",
  inputSchema: {
    type: "object",
    properties: {
      orderId: { type: "string", description: "Order confirmation number" }
    },
    required: ["orderId"]
  },
  handler: async ({ orderId }) => {
    const res = await fetch(`/api/orders/${orderId}/tracking`);
    return await res.json();
  }
});

The Platform Gap: Shopify, WooCommerce, and BigCommerce

Shopify launched a backend MCP server that lets developers interact with the Shopify Admin API from their code editor. But Shopify has no WebMCP integration for storefronts. The same gap exists for WooCommerce and BigCommerce.

This is a concrete opportunity. A Shopify app that adds WebMCP annotations to Liquid templates would give every Shopify store instant AI-agent readiness. A WooCommerce plugin that registers navigator.modelContext tools would do the same for WordPress stores. The first movers here will define how AI agents interact with millions of online stores.

When to Implement

Today (zero risk): Add declarative toolname and tooldescription attributes to your existing product search, add-to-cart, and checkout forms. These are ignored by current browsers.

When Chrome stable ships: Build out imperative tools for inventory checks, coupons, and order tracking. Test with real AI agents.

Ongoing: Monitor which tools agents call most frequently. Optimize those tool responses.

Connection to MCP Stacks

There is a clean separation between the two sides of MCP in ecommerce.

You use MCP servers in your code editor to build the store. A Supabase MCP server gives your AI coding assistant access to your product database. A Stripe MCP server lets it set up payment processing and debug webhooks. For how-to details on these specific servers, see our guides on using Supabase MCP and using Stripe MCP.

WebMCP exposes the finished store to shoppers -- or rather, to AI agents shopping on behalf of users. Both sides use the same protocol family. Both define tools with names, descriptions, and JSON schemas. If you are comfortable building with MCP servers in your editor, you already understand how to design WebMCP tools. See From MCP to WebMCP for the full picture of how these protocols connect.

The stores that get both sides right will have a structural advantage as AI-driven commerce grows.

Related Stacks

Related Servers