shopify-web-replicator
Deterministic Shopify storefront replication MCP server for local agent workflows
Shopify Web Replicator is a local-first MCP product for turning a public storefront into reviewable output. The repo includes companion API and web UI surfaces that share the same engine behavior, so teams can move between agent-driven and human review workflows without switching tools. MCP clients can connect over local stdio or streamable HTTP, depending on the client. 1. pnpm install 2. pnpm build 3. cp config/destination-stores.example.json config/destination-stores.json 4. pnpm dev for watch mode 5. Open MCP or UI flow per docs/mcp-setup.md / docs/operator-runbook.md
Summary extracted from the README.
Shopify Web Replicator
Shopify Web Replicator is a local-first MCP product for turning a public storefront into reviewable output.
It currently supports two tracks:
replicate_site_to_theme: the stable default path for deterministic Shopify theme generation and operator reviewreplicate_site_to_hydrogen: an advanced / beta path for async Hydrogen workspace generation using Playwright discovery plus a live Figma bridge
The repo includes companion API and web UI surfaces that share the same engine behavior, so teams can move between agent-driven and human review workflows without switching tools. MCP clients can connect over local stdio or streamable HTTP, depending on the client.
Team first-run
pnpm installpnpm buildcp config/destination-stores.example.json config/destination-stores.jsonpnpm devfor watch mode- Open MCP or UI flow per
docs/mcp-setup.md/docs/operator-runbook.md
Workspace layout
apps/mcp: MCP server with both stdio and streamable HTTP entrypointsapps/api: companion HTTP API backed by the same replication engineapps/web: companion operator UI for intake, job review, and handoffpackages/engine: shared deterministic replication engine used by MCP and APIpackages/shared: shared contracts and pipeline typespackages/theme-workspace: Shopify theme workspace that receives generated output
Scripts
pnpm dev: build shared and engine packages, then start shared watch, engine watch, API, web app, and MCP server watchpnpm build: build shared, engine, API, web, and MCP packagespnpm typecheck: run TypeScript checks across all apps and packagespnpm test: run shared, engine, API, web, and MCP tests in sequencepnpm theme:check: run Shopify theme validation on the local theme workspace
Runtime configuration
REPLICATOR_DB_PATHDefault:.data/replicator.dbTHEME_WORKSPACE_PATHDefault:packages/theme-workspaceREPLICATOR_HYDROGEN_ROOTDefault:generated-sitesREPLICATOR_CAPTURE_ROOTDefault:.data/capturesREPLICATOR_DESTINATION_STORES_PATHDefault:config/destination-stores.jsonFIGMA_MCP_URLDefault:http://127.0.0.1:3845/mcp
These variables affect the MCP server, the API, and the companion web handoff flow because they all use the same engine package.
Destination stores are loaded from a local JSON file. Use config/destination-stores.example.json as the template for your local config/destination-stores.json.
MCP tool surface
replicate_site_to_themeRuns source qualification, reference capture, and the deterministic pipeline end to end in one tool call and returns the terminal handoff payload.replicate_site_to_hydrogenCreates an async Hydrogen replication job that runs Playwright discovery,figma_import,figma_design_context, backend inference, and Hydrogen workspace generation.get_replication_jobLoads a persisted job by id.list_replication_jobsLists recent persisted jobs, newest first.list_destination_storesLists configured destination store profiles so the agent can choose a validdestinationStoreid before running replication.
The one-shot tool returns:
- job identity and lifecycle state
- typed source qualification, capture, analysis, mapping, generation, store setup, commerce, validation, and integration snapshots
- generated artifact metadata and timestamps
- resolved destination store metadata when available
- runtime handoff info: theme workspace path, capture root path, and preview command
- deterministic next actions for operator review
Stable theme flow
- An agent or companion UI selects a configured destination store and submits a reference URL, optional page type, and optional notes.
- The engine persists a durable SQLite job record.
- The pipeline runs
source_qualificationfirst and fails fast for unsupported or non-Shopify sources. captureuses Playwright to capture the rendered source, derive headings, navigation links, primary CTAs, image assets, style tokens, route hints, and persist a capture bundle plus desktop/mobile screenshots under the local capture root.- The deterministic pipeline then runs
analysis,mapping,theme_generation,store_setup,commerce_wiring,validation,integration_check, andreview. - Theme generation overwrites the stable page-type-specific section and template outputs in the theme workspace.
- Store setup planning writes
config/generated-store-setup.json. - Commerce wiring writes
snippets/generated-commerce-wiring.liquid. - Final validation runs against the fully generated workspace.
- Integration checks write
config/generated-integration-report.jsonand verify generated files on disk, commerce entrypoints, section snippet rendering, checkout handoff markup, and final validation status. - The final result is either
needs_revieworfailed.
Advanced Hydrogen flow
- An agent calls
replicate_site_to_hydrogenwithreferenceUrl,targetId, and optionaltargetLabel,notes, andseedRoutes. - The engine creates a durable Hydrogen job and runs these stages asynchronously:
source_qualificationplaywright_discoveryfigma_importfigma_design_contextfrontend_specbackend_inferencehydrogen_generationworkspace_validationreview
- The generated Hydrogen workspace is written under
generated-sites/<targetId>by default. - The workflow depends on a reachable Figma MCP bridge. If the bridge is unavailable, the job fails at
figma_importby design.
Capture artifacts
- Capture bundles are written under
.data/captures/<jobId>by default. - Each successful capture writes:
capture-bundle.jsondesktop.jpgmobile.jpg
- Job payloads store the artifact paths, extracted style tokens, and route hints rather than embedding large blobs in SQLite.
Stable generated outputs
sections/generated-reference.liquidsections/generated-homepage-reference.liquidsections/generated-product-reference.liquidsections/generated-collection-reference.liquidtemplates/page.generated-reference.jsontemplates/index.generated-reference.jsontemplates/product.generated-reference.jsontemplates/collection.generated-reference.jsonconfig/generated-store-setup.jsonsnippets/generated-commerce-wiring.liquidconfig/generated-integration-report.json
Companion HTTP API
POST /api/jobsPOST /api/hydrogen/jobsGET /api/jobs/:jobIdGET /api/jobs?limit=<n>GET /api/runtimeGET /api/destination-stores
The API uses the same packages/engine orchestrator as the MCP server.
Local MCP setup
See docs/mcp-setup.md for stdio launch details, streamable HTTP setup, Figma bridge configuration, and environment overrides. docs/setup-guide.md is the broader client-facing setup guide.
Companion operator flow
The web app remains useful for manual review of the stable theme workflow:
- Start the repo with
pnpm dev. - Submit a job in the web UI or create one through MCP.
- Open the job detail or handoff view.
- Review source qualification, capture artifact paths, extracted route/style signals, generated artifacts, validation output, integration output, and next steps.
- Run
shopify theme devin the configured workspace and verify layout, content, commerce wiring, and cart-to-checkout handoff.
Hydrogen is currently more MCP-first than web-UI-first. Use get_replication_job or the API to inspect those jobs and review the generated workspace under generated-sites/<targetId>.
Current limits
- The pipeline is local-only and currently supports sources that qualify as public Shopify storefronts.
- Source capture requires a local Playwright/Chromium runtime and currently targets public Shopify storefronts that can be loaded in a browser session.
- Store setup output is still a generated plan, not Shopify Admin automation.
- Commerce wiring is deterministic and native-route-based, not live checkout automation.
- Multi-page replication and checkout customization are out of scope for this slice.
- The Hydrogen + Figma path is an advanced / beta workflow. It depends on a live Figma MCP bridge and is not yet documented as a first-class web-UI review flow.