How Commerce.com and Cloudflare are getting storefronts ready for AI agents
Commerce.com and Cloudflare use edge‑injected WebMCP scripts to give AI agents reliable, token‑efficient access to storefront tools without requiring merchants to rewrite their sites.

How Commerce.com and Cloudflare Are Getting Storefronts Ready for AI Agents
AI‑driven shopping assistants are still tripping over traditional e‑commerce sites. Most agents scrape raw HTML, guess button functions, and waste tokens on trial‑and‑error clicks. A single theme tweak can break the whole flow, making agentic commerce slow, costly, and fragile.
WebMCP: Structured Tools for Agents
WebMCP (Web‑based Machine‑Readable Commerce Protocol) is an emerging browser standard that exposes semantic actions—such as `searchproducts`, `addto_cart`, and `checkout`—directly on a page. Instead of hunting for a button, an AI agent calls the exact tool it needs, receiving a predictable response. The result is:
- Faster interactions – no visual parsing, just API‑like calls.
- Lower token usage – agents send concise commands instead of long prompts.
- Robustness – UI changes don’t break the workflow because the contract lives in the page’s metadata, not its visual layout.
WebMCP is still experimental, available behind Chrome flags and in Origin Trials, but Cloudflare has built an edge‑level implementation that injects the required script automatically.
Why Commerce.com Adopted WebMCP
Commerce.com runs nearly 100,000 merchant domains on a flexible, headless platform. Their product team faced three recurring merchant requests:
- Visibility in agent answers – merchants want their inventory to appear when a shopper asks an AI assistant.
- Control of the checkout experience – keeping the transaction on the merchant’s site preserves branding and data.
- Zero‑code integration – rebuilding every storefront for agents is impractical.
WebMCP satisfies all three. By exposing structured tools, agents can retrieve product data, build carts, and complete purchases while the merchant retains full checkout control.
Edge‑Injected Opt‑Outs: Giving Merchants Control
To roll WebMCP across thousands of stores without forcing code changes, Cloudflare introduced edge‑level opt‑outs:
- A simple toggle in the Cloudflare dashboard enables or disables the injection per domain.
- Merchants can set granular rules (e.g., only on product pages or for specific subdomains).
- The system respects existing security policies, ensuring that the injected script runs in a sandboxed environment.
This approach lets Commerce.com activate WebMCP globally while still honoring individual merchant preferences.
Lessons Learned and Next Steps
- Performance matters – injecting a lightweight script at the edge adds sub‑millisecond latency, far less than the token savings agents achieve.
- Observability is key – Cloudflare’s Workers Observability tools helped track script execution, error rates, and agent success metrics.
- Gradual rollout – Starting with a beta cohort allowed the team to refine opt‑out UI and gather real‑world feedback before wider deployment.
Looking ahead, the partnership aims to:
- Standardize WebMCP across more browsers, moving it out of experimental flags.
- Expand toolsets (e.g., `applypromo`, `trackorder`) to cover more of the checkout journey.
- Integrate with AI platforms so agents can discover and use these tools automatically.
Practical Takeaway
For merchants eager to stay visible in the age of AI shopping assistants, leveraging Cloudflare’s edge‑injected WebMCP offers a low‑friction path: enable the feature, configure opt‑outs as needed, and let agents interact with your store through reliable, structured actions—without rewriting a single line of front‑end code.
Source
Read original sourceWhy we picked this
Core AI content about enabling AI agents for e‑commerce storefronts