Skip to content
Install on Shopify

Architecture

ShopMD is one web application that runs on Cloudflare’s edge. It does three jobs: it takes requests to generate files, it runs the work that builds them, and it serves the finished files to people and agents. This page describes the parts and how data moves between them. It’s a map, not a build guide: ShopMD isn’t open source, so there’s nothing here to install.

flowchart LR
  web["shopmd.ai<br/>(browser)"] --> edge["Edge app"]
  admin["Shopify admin<br/>(embedded app)"] --> edge
  shopify["Shopify<br/>(webhooks)"] --> edge
  edge --> pipeline["Generation pipeline"]
  pipeline --> browser["Headless browser"]
  pipeline --> ai["AI model"]
  pipeline --> storefront["Store's storefront<br/>and admin data"]
  pipeline --> storage[("Object storage<br/>(files)")]
  pipeline --> db[("Relational database<br/>(jobs, state)")]
  storage --> edge
  db --> edge
  edge --> proxy["Storefront URLs<br/>/apps/shopmd/…"]
  edge --> mcp["MCP server<br/>shopmd.ai/mcp"]

Read it left to right: requests come in on the left, the pipeline builds files in the middle, and every way of reading a file goes back out through the edge app on the right.

Part What it does
Edge app The single entry point. It serves the shopmd.ai website, the app inside the Shopify admin, the MCP server and the storefront file URLs. It checks who is calling before it reads or starts anything.
Generation pipeline Builds each file as a series of steps that can retry on their own. One run builds one file for one store. See Generation pipeline.
Headless browser Opens the storefront like a shopper’s browser, so ShopMD can read rendered colours, fonts and layout, and read pages that only appear after scripts run.
AI model Writes the prose parts of a file from facts the pipeline has already collected. Structured parts, such as design tokens, policy quotes and catalog tables, are produced by code.
Object storage Holds the generated files. A file has a published version, and can have a draft waiting for approval beside it.
Relational database Holds accounts, linked stores, jobs, approvals, withdrawals, section edits and gap answers.
Job queue Receives store-change events from Shopify and starts the right refresh.
Scheduler Runs the nightly refresh of catalog.md and shop.md.
  • shopmd.ai in a browser. Anyone can generate design.md, brand.md, policies.md and catalog.md from a store URL. Signed-in users can also generate Store Intel (store.md) and save files to a dashboard. See Generate files for any store.
  • The Shopify admin. A merchant who installs the app reviews, edits, approves and withdraws files there. Installed stores also get shop.md, agents.md and product and collection files. See Install the Shopify app.
  • Shopify itself. When a product, collection, theme or store setting changes, Shopify tells ShopMD, and the affected file is refreshed. See Webhooks.

Every reader gets the same stored file. Section edits are applied whenever the file is served; the excerpts in shop.md and agents.md quote the stored version.

  • The storefront. Shopify forwards https://<store-domain>/apps/shopmd/… to ShopMD through the App Proxy, so files are served from the store’s own domain. The app doesn’t change the theme. See Publish your files on your storefront.
  • The MCP server at https://shopmd.ai/mcp. Its public tools return exactly what the storefront serves. Its signed-in tools return the caller’s own store’s files. See MCP server.

store.md is never published on the storefront, never shown in the public gallery, and not listed or served by the MCP public tools.