Skip to main content
Glama
shopify-storefront-mcp-server

shopify-storefront-mcp-server

README.md
# shopify-storefront-mcp-server

A zero-dependency, **read-only** [MCP](https://modelcontextprotocol.io) server that lets an AI assistant browse a Shopify store's public catalogue: search products, read variants and prices, list collections. No API key, no app install, no writes.

> Built free by [Ecom Swift LLC](https://www.ecomswiftllc.com/free-tools?utm_source=github&utm_medium=repo&utm_campaign=shopify-storefront-mcp-server). Curious how AI assistants and search engines see your store? [Run a free store audit](https://audit.ecomswiftllc.com/?utm_source=github&utm_medium=repo&utm_campaign=shopify-storefront-mcp-server).

## Why this exists

Shopify ships its own official MCP surface for stores, and it has been changing: tools have moved between servers and been replaced (see [shopify-ucp-readiness-checker](https://github.com/Ecom-Swift-LLC/shopify-ucp-readiness-checker) for the current Universal Commerce Protocol picture). That is the right thing to build real agentic checkout on.

This repo is the small, boring alternative for a different job: you want Claude, Cursor or any MCP client to *look at a store* (yours, a client's, a competitor's public catalogue) and answer questions like "which bags are under $30 and in stock?" or "does this product have a size variant that is sold out?". It reads the same public JSON endpoints a browser can read, and it can only ever make `GET` requests.

## Example

Ask your assistant: *"Search Acme Goods for tote bags and tell me which colours are in stock."* It calls two tools:

```
search_products {"query": "tote"}
get_product     {"handle": "canvas-tote-2"}
```

and `get_product` returns:

```json
{
  "title": "Canvas Tote 2",
  "handle": "canvas-tote-2",
  "url": "https://acme-goods.example/products/canvas-tote-2",
  "vendor": "Acme Goods",
  "options": [{ "name": "Colour", "values": ["Natural", "Black"] }],
  "variants": [
    { "title": "Natural", "sku": "T2-N", "price": "24.00", "compare_at_price": null, "available": true, "options": ["Natural"] },
    { "title": "Black", "sku": "T2-B", "price": "28.00", "compare_at_price": "32.00", "available": false, "options": ["Black"] }
  ],
  "available": true
}
```

(The example store is the local mock in `samples/mock-store.js`; the domain above is a placeholder.)

## Tools

| Tool | What it does | Reads |
| --- | --- | --- |
| `store_info` | Name, description, country, currency | `/meta.json`, `/cart.js` |
| `list_products` | Paginated catalogue with price range, availability, tags | `/products.json` |
| `search_products` | Keyword search using the storefront's predictive search | `/search/suggest.json` |
| `get_product` | One product: options, every variant, prices, images | `/products/<handle>.js` |
| `list_collections` | Collections with product counts | `/collections.json` |
| `collection_products` | Products in one collection | `/collections/<handle>/products.json` |

Every tool is marked `readOnlyHint: true` and `destructiveHint: false`. Output is trimmed for a model's context window: descriptions are plain text (HTML and scripts stripped) and capped, lists are capped at 50 items, and out-of-range `limit`/`page` values are clamped.

## Install

```bash
git clone https://github.com/Ecom-Swift-LLC/shopify-storefront-mcp-server.git
cd shopify-storefront-mcp-server
node bin/ssmcp.js my-store.myshopify.com --check   # test the connection
```

Node.js 18+. No `npm install` needed.

## Connect it to an assistant

The server speaks the stdio transport. You give the client a command to launch, with the store domain as the argument.

**Claude Code**

```bash
claude mcp add acme-store -- node /path/to/shopify-storefront-mcp-server/bin/ssmcp.js acme-goods.example
```

**Claude Desktop, Cursor and most other clients** (JSON config):

```json
{
  "mcpServers": {
    "acme-store": {
      "command": "node",
      "args": ["/path/to/shopify-storefront-mcp-server/bin/ssmcp.js", "acme-goods.example"]
    }
  }
}
```

One server process connects to one store. To compare two stores, register it twice under different names.

## Command line

```bash
ssmcp <store-domain>          # start the server on stdio (clients run this for you)
ssmcp <store-domain> --check  # print store info and confirm products.json is readable
ssmcp --tools                 # list the tools
```

The store is fixed by whoever launches the server. The assistant cannot point it at a different host, and tool arguments are limited to search words, handles and small integers. Handles are validated (`[a-z0-9_-]`) so a model cannot smuggle a path like `../cart` into a request.

## What it does NOT do

- **It cannot buy anything.** No cart, no checkout, no customer login, no orders. If you want an agent that checks out, that is Shopify's UCP, not this.
- **It only sees what the public storefront shows.** Draft and unpublished products, products hidden from the Online Store channel, inventory counts, metafields and customer-specific pricing are invisible. "Available" is a yes/no point-in-time flag, not a stock level.
- **Public JSON endpoints can be switched off.** Some themes, apps and proxies block `/products.json` or `/search/suggest.json`. The tool then returns a plain error message and the assistant can tell you why. Password-protected stores are detected and reported, not bypassed.
- **Prices are as the storefront reports them** in the store's default market. Multi-currency and market-specific pricing are not resolved.
- **It does not use the Storefront GraphQL API or the Admin API**, so there is no access token to leak and nothing it could modify. If you need those, see [shopify-storefront-graphql-examples](https://github.com/Ecom-Swift-LLC/shopify-storefront-graphql-examples).
- **It does not rate-limit for you beyond a 15-second timeout.** Be considerate when pointing it at a store you do not own, and respect that store's robots.txt and terms.
- **stdio only.** No HTTP/SSE transport, no authentication layer, no resources or prompts: just tools.

## FAQ

**Does it work on a store I do not own?** It reads only what any visitor can read. That does not make it appropriate for bulk scraping; keep requests light and check the store's terms.

**Why not just fetch the URLs with a generic web tool?** You can. This gives the model a stable, small, typed set of tools with trimmed output instead of raw HTML or 250-product JSON blobs, which saves tokens and avoids the model guessing URL shapes.

**Why handles and not product IDs?** Handles are what appears in the storefront URL, so an assistant can lift one straight from a page or a search result.

## Use it as a library

```js
const { Storefront } = require('./lib/storefront');

const sf = new Storefront('acme-goods.example');
const { products } = await sf.searchProducts({ query: 'tote', limit: 3 });
const detail = await sf.getProduct({ handle: products[0].handle });
```

Pass `{ fetchImpl }` to use your own HTTP client or a test double.

## Tests

```bash
npm test   # node --test, 20 tests against a local mock storefront (no network needed)
```

The suite includes a real subprocess test: it launches `bin/ssmcp.js`, speaks JSON-RPC to it over stdio, and checks that stdout carries only protocol messages. The server was also run read-only against a real public store while building it.

## Related Shopify tools

- [shopify-audit-mcp](https://github.com/Ecom-Swift-LLC/shopify-audit-mcp): connect an assistant to our store audit
- [shopify-ucp-readiness-checker](https://github.com/Ecom-Swift-LLC/shopify-ucp-readiness-checker): see what an AI agent can do on a store via UCP
- [shopify-ai-shopping-readiness](https://github.com/Ecom-Swift-LLC/shopify-ai-shopping-readiness): audit product schema and AI-crawler access
- [shopify-llms-txt-generator](https://github.com/Ecom-Swift-LLC/shopify-llms-txt-generator): generate and lint an `llms.txt`
- [shopify-storefront-graphql-examples](https://github.com/Ecom-Swift-LLC/shopify-storefront-graphql-examples): the Storefront GraphQL API, with a cost-aware client

## Contributing

Issues and pull requests are welcome, especially compatibility reports for stores where an endpoint behaves differently. Keep it dependency-free and read-only. Run `npm test` before opening a PR.

## Roadmap

- Optional streamable-HTTP transport for hosted use
- A `get_policies` tool
- Market/currency selection via the `?country=` parameter

## Need help?

Want your store ready for AI shopping assistants, or a custom MCP integration built? We are a Shopify Partner: [our Partner Directory profile](https://www.shopify.com/partners/directory/partner/waowy), or start with a [free store audit](https://audit.ecomswiftllc.com/?utm_source=github&utm_medium=repo&utm_campaign=shopify-storefront-mcp-server).

## Want this handled for you?

We build and maintain Shopify stores at [Ecom Swift LLC](https://www.ecomswiftllc.com?utm_source=github&utm_medium=repo&utm_campaign=shopify-storefront-mcp-server): SEO, speed, structured data and conversion work. Check your own store with the [free audit](https://audit.ecomswiftllc.com/?utm_source=github&utm_medium=repo&utm_campaign=shopify-storefront-mcp-server), or browse our [free tools](https://www.ecomswiftllc.com/free-tools?utm_source=github&utm_medium=repo&utm_campaign=shopify-storefront-mcp-server).

## License

MIT © Ecom Swift LLC