@curless/shopify-storefront

中文文档
0.76.0发布于 2026/11/11MITES Module近 30 天下载 7139

One Shopify storefront MCP connector, driven by a config file. Identity, tool names, vocabulary and shop wiring come from a StorefrontConfig, so a second merchant is a JSON file rather than a fork of 3,400 lines.

原始使用文档
文档目录5 节
  1. The tools
  2. Configuration
  3. Endpoints
  4. What it guards
  5. License

@curless/shopify-storefront

A Shopify store as an MCP connector for AI assistants (Claude, ChatGPT and any other MCP host). A buyer browses the catalogue, picks options, builds a cart and is handed a link to the merchant's own Shopify checkout — the money and the order stay in the merchant's Shopify. Results render as an MCP Apps card.

One server, driven by a config file: the merchant's name, tool names, the words for what they sell and the shop wiring all come from config.json, so a second merchant is a second file, not a fork.

npm install -g @curless/shopify-storefront
STOREFRONT_CONFIG=./config.json \
STOREFRONT_SHOPIFY_CLIENT_ID=… STOREFRONT_SHOPIFY_CLIENT_SECRET=… \
curless-shopify-storefront

Deployed on Node 22. It listens on PORT (default 8090) and expects a TLS-terminating reverse proxy in front of it that sets X-Forwarded-For.

The tools

Named from the config's naming.prefix and nouns — with prefix acme and the default noun product:

ToolWhat it does
list_acme_productsThe catalogue as a card; optional query, maxPrice, limit.
get_acme_productOne product: options, prices, which combinations are in stock.
add_to_acme_cart / view_acme_cart / clear_acme_cartA cart kept by this server, in memory, per conversation. Nothing reaches Shopify until the buyer pays.
get_acme_checkout_linkA Shopify cart permalink for one variant, or for the whole cart. Creates nothing.
lookup_acme_orderOne order, given its order number and the email it was placed with.
get_acme_store_policiesThe shop's published returns, shipping, privacy and terms pages.
check_acme_checkout_statusFor the card only: whether the checkout it opened has been paid.

Configuration

config.json holds everything that identifies the merchant; the environment holds only secrets and machine settings.

{
  "id": "acme",
  "server": { "name": "acme-shop", "title": "Acme", "websiteUrl": "https://acme.example" },
  "naming": { "prefix": "acme" },
  "shopify": { "mode": "env", "shopDomain": "acme.myshopify.com" },
  "urls": { "appUrl": "https://mcp.acme.example" },
  "legal": {
    "operatorContact": "[email protected]",
    "merchantContact": "[email protected]",
    "updated": "1 October 2026"
  }
}
  • shopify.mode: "env" serves one shop, installed once through the app's OAuth flow (/auth/install); the token is stored at shopify.tokenPath (default /app/data/<id>-token.json — keep it on a volume). "oauth-install" is the multi-shop form, where the shop is whoever installed the app and the connector URL is /s/<shop>/mcp.
  • urls.appUrl is the app URL registered with Shopify; urls.publicUrl, when set, is the hostname buyers connect to.
  • legal.* fills the /privacy, /terms and /docs pages that directory reviewers read. Missing contacts do not fail the boot, but leave gaps there.
env
STOREFRONT_CONFIGPath to config.json (required).
STOREFRONT_SHOPIFY_CLIENT_ID / _CLIENT_SECRETThe Shopify app's credentials; the secret also signs the OAuth callback and webhooks.
STOREFRONT_SHOPIFY_ADMIN_TOKENOptional: an existing Admin API token, skipping the install.
PORTDefault 8090.
CATALOG_REFRESH_MSDefault 300000 (5 minutes). A failed refresh keeps serving the last good catalogue.
OPENAI_APPS_CHALLENGE_TOKENShost=token,… — ChatGPT Apps domain verification.

Endpoints

POST /mcp (and /) is the MCP endpoint (streamable HTTP, JSON responses). Alongside it: /healthz, /docs, /privacy, /terms, /icon.png, /logo.png, /img (the card's image proxy for Shopify's CDN), and the Shopify install routes /auth/install, /auth/callback, /webhooks/shopify.

What it guards

  • No write access to the shop is needed for selling. Checkout is a Shopify link; no card number or payment token reaches this server.
  • Order lookup needs the order number and the email together, answers a wrong email and a missing order alike, and pauses lookups after five misses in fifteen minutes for one order number, one email or one conversation (fifty for one network address, a hundred for the whole shop).
  • Limits: 60 requests a minute per address, a 1 MB request body, bounded tool arguments.
  • The merchant's own text (descriptions, policies) is stripped of control and invisible characters, length-capped and fenced before it reaches the assistant.

License

MIT

版本与发布记录

@curless/shopify-storefront 共发布 130 个版本,首次发布于 2026/08/24;过去 12 个月发布了 130 个版本。

版本发布日期距今
0.76.0latest2026/11/11今天
0.75.02026/11/064 天前
0.74.02026/11/064 天前
0.73.02026/11/055 天前
0.72.02026/11/029 天前
0.71.02026/10/2912 天前

关于 @curless/shopify-storefront 的常见问题

@curless/shopify-storefront 是什么?

One Shopify storefront MCP connector, driven by a config file. Identity, tool names, vocabulary and shop wiring come from a StorefrontConfig, so a second merchant is a JSON file rather than a fork of 3,400 lines.

如何安装 @curless/shopify-storefront?

在项目目录运行 npm install @curless/shopify-storefront,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 curless-shopify-storefront,可以用 npx curless-shopify-storefront 直接运行。

@curless/shopify-storefront 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/curless__shopify-storefront 是否存在。

@curless/shopify-storefront 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@curless/shopify-storefront 可以商用吗?

@curless/shopify-storefront 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@curless/shopify-storefront 的下载量有多少?

根据 npm 官方下载统计,@curless/shopify-storefront 在 2026/10/11 – 2026/11/09 这 30 天内被下载 7,139 次,日均约 238 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@curless/shopify-storefront 还在维护吗?

最新版本 0.76.0 发布于 2026/11/11(今天);至今共发布 130 个版本,其中过去 12 个月发布了 130 个;首次发布于 2026/08/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。