Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 11 min read Case study mediumAdept

Shipping WebMCP tools in storefronts and Checkout

Shopify deployed WebMCP tools to every Liquid storefront and to Checkout, letting browser agents call page-registered tools with structured schemas instead of driving the UI through screenshots and DOM automation. In a Checkout benchmark this ran 2.7x faster and 58% cheaper than browser automation, succeeding 60/60 times versus 56/60. Key lessons: wrap tools around Standard Actions so client UI stays in sync, reuse UCP schemas, and test with deterministic tests plus model-based evals built from user journeys. Tool shape steers agents better than descriptions: replacing an add_to_cart tool with idempotent full-state create_cart/update_cart calls stopped duplicate additions. Open gaps include measurement, enforced human confirmation, agent identity, testing against real agents, and tools being torn down on navigation, which Shopify is taking to a proposed W3C Agentic Web Working Group.

Assumes: Model Context Protocol basicsbrowser JavaScript APIsLLM tool calling

Related posts

  • How We Optimized Browser Use for Deep Agents

    LangChain mediumAdept

    Tool design dominated cost and speed for browser agents: across seven toolsets on 100 WebVoyager tasks, pass rates ranged 78–90%, but Stagehand passed 90% for $1.98 total while Playwright MCP passed 78% for $26.71 at three times the latency. The gains came from code mode (one `run` call batches many actions and keeps intermediate page data out of context, averaging 10 steps versus 26), compact accessibility-tree snapshots with element IDs instead of raw HTML or screenshots, and running inside the browser to avoid per-action CDP round trips. Accepting Playwright-style code beat Stagehand's native API by 5.3 points, and truncating snapshots after the fact didn't help because agents just re-fetched. Replacing fixed sleeps with a 500 ms network-quiet settle wait cut median HardBench time from 182 s to 124 s with no accuracy loss, all validated through trace-driven iteration and evals.

  • ShopGym: Realistic, reproducible sandboxes for shopping agents

    Shopify Engineering mediumAdept

    ShopGym turns live storefronts into self-contained, resettable sandbox shops and generates grounded shopping tasks so agents can be evaluated reproducibly. ShopArena explores a seed store with planner and browser agents to write an anonymized shop specification, then generates a fictional catalog and storefront in fixed stages. Each stage runs an execution-verification loop of fresh coding agents, rule-based checks and visual browser verification. ShopGuru builds rule-based single-skill tasks and LLM-written multi-step journeys, validated against the shop's actual products and filters. Across 224 tasks in six shops, graph-based analysis showed similar state counts and page complexity to live stores, with fewer connections. Agent success rates on the twins tracked live stores and preserved model rankings on multi-step tasks, though some focused tasks showed larger gaps.

  • Browser Use in Managed Deep Agents

    LangChain mediumAdept

    Managed Deep Agents in LangSmith now runs a remote browser in its own sandbox and gives agents Stagehand-based tools: browser_snapshot (accessibility tree with element IDs), browser_run (batched actions or Playwright-style JavaScript in one call to keep page content out of context), browser_screenshot, and browser_handoff for letting a human sign in without exposing credentials. Sessions can be scoped per thread or per user so logins persist, and a private localhost bridge lets the browser reach apps running in the agent's sandbox for end-to-end testing, with passing runs exportable as Playwright scripts. On 100 WebVoyager tasks the toolset passed 90% for $1.98 total, versus 89% at 9x the cost for Browserbase's MCP server.

  • MCP UI: Breaking the text wall with interactive components

    Shopify Engineering easyNovice

    MCP UI extends the Model Context Protocol so servers can return interactive UI components, such as product selectors, galleries and cart flows, as embedded ui:// resources alongside JSON data. Components can be delivered three ways: inline HTML via srcDoc in a sandboxed iframe, remote resources loaded in a sandboxed iframe, or Remote DOM for direct client-side rendering. Components never modify state directly. They emit intents like view_details, checkout, notify and ui-size-change, which the agent interprets, so the agent stays in control. Hosts can pass CSS through render data to match their branding, and Shopify argues this beats having agents generate commerce UI with variants, bundles, subscriptions and live inventory.

  • Agentic Testing: Where Agents Fit in the E2E Testing Stack

    Slack Engineering mediumAdept

    Across 200+ agent-driven E2E runs against Slack test workspaces, agents using Playwright MCP were the most reliable (0% failures on a simple thread-reply flow, ~12% on a longer search flow). Playwright CLI agents failed 12–20%, mostly from auth, navigation timing and session instability. Agent-generated Playwright tests ran fastest (~3 min including generation, ~30–45 s raw) but failed ~48% on the complex flow. Agent runs cost $15–30 each, driven by turn count and retransmitted context such as accessibility-tree snapshots rather than model choice; CLI took ~85 turns versus MCP's ~40. The recommendation is to keep deterministic tests for CI and add agentic testing as a top pyramid layer for exploration, debugging and bug reproduction.

The quest for software engineering knowledge.

Look:
Layout: