Open-source B2B and marketplace ecommerce; new stores include an MCP server for AI agents.
shopify-operations-mcp
概览
作者提供的说明(英文原文)
Safe-write Shopify operations: plan-before-execute writes with out-of-band approval and audit.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i尚未统计★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 网店与支付
- 你需要填写:SHOPIFY_STORE_DOMAIN, SHOPIFY_ADMIN_TOKEN
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 需要你自己填写:
SHOPIFY_STORE_DOMAIN,SHOPIFY_ADMIN_TOKEN,SHOPIFY_CONFIG,SHOPIFY_PLAN_TTL_MS,SHOPIFY_APPROVAL_SERVER_PORT,SHOPIFY_PROTECTED_TAGS,SHOPIFY_CALLER_ID,SHOPIFY_AUDIT_PATH
标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"shopify-operations": {
"command": "npx",
"args": [
"-y",
"shopify-operations-mcp"
],
"env": {
"SHOPIFY_STORE_DOMAIN": "your-value",
"SHOPIFY_ADMIN_TOKEN": "your-value",
"SHOPIFY_CONFIG": "your-value",
"SHOPIFY_PLAN_TTL_MS": "your-value",
"SHOPIFY_APPROVAL_SERVER_PORT": "your-value",
"SHOPIFY_PROTECTED_TAGS": "your-value",
"SHOPIFY_CALLER_ID": "your-value",
"SHOPIFY_AUDIT_PATH": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add shopify-operations --env SHOPIFY_STORE_DOMAIN=your-value --env SHOPIFY_ADMIN_TOKEN=your-value --env SHOPIFY_CONFIG=your-value --env SHOPIFY_PLAN_TTL_MS=your-value --env SHOPIFY_APPROVAL_SERVER_PORT=your-value --env SHOPIFY_PROTECTED_TAGS=your-value --env SHOPIFY_CALLER_ID=your-value --env SHOPIFY_AUDIT_PATH=your-value -- npx -y shopify-operations-mcp运行前请先填写空着的值。
或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"shopify-operations": {
"command": "npx",
"args": [
"-y",
"shopify-operations-mcp"
],
"env": {
"SHOPIFY_STORE_DOMAIN": "your-value",
"SHOPIFY_ADMIN_TOKEN": "your-value",
"SHOPIFY_CONFIG": "your-value",
"SHOPIFY_PLAN_TTL_MS": "your-value",
"SHOPIFY_APPROVAL_SERVER_PORT": "your-value",
"SHOPIFY_PROTECTED_TAGS": "your-value",
"SHOPIFY_CALLER_ID": "your-value",
"SHOPIFY_AUDIT_PATH": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"shopify-operations": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"shopify-operations-mcp"
],
"env": {
"SHOPIFY_STORE_DOMAIN": "your-value",
"SHOPIFY_ADMIN_TOKEN": "your-value",
"SHOPIFY_CONFIG": "your-value",
"SHOPIFY_PLAN_TTL_MS": "your-value",
"SHOPIFY_APPROVAL_SERVER_PORT": "your-value",
"SHOPIFY_PROTECTED_TAGS": "your-value",
"SHOPIFY_CALLER_ID": "your-value",
"SHOPIFY_AUDIT_PATH": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
需要你填写的值
- The myshopify.com store domain, e.g. my-store.myshopify.com. Overrides shopify.storeDomain from the config file.
- Shopify Admin API access token. Required and only ever read from the environment — never from the config file.
SHOPIFY_CONFIGenvPath to a config.json with shopify/plans/approvalServer/protectedTags settings. Defaults to ./config.json in the working directory.SHOPIFY_PLAN_TTL_MSenvHow long a plan token stays valid before it must be executed or expires, in milliseconds. Default 60000.SHOPIFY_APPROVAL_SERVER_PORTenvPort the localhost human-approval HTTP server binds to (127.0.0.1 only). Default 4319.SHOPIFY_PROTECTED_TAGSenvComma-separated tags that plans may never modify; any plan touching an item carrying one is refused. Default do-not-touch.SHOPIFY_CALLER_IDenvIdentity recorded as the caller on every audit log row. Default unknown.SHOPIFY_AUDIT_PATHenvFile path for the tamper-evident JSONL audit log. Default shopify-operations-audit.jsonl in the working directory.
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 jpka 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“网店与支付”中的其他服务器比较i
- 星标数多于此分类中其他 2534 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 2534 个服务器的 26% 更新
- 基础检查结果等于或优于此分类中其他 2534 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
shopify-operations-mcp 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
你需要填写:SHOPIFY_STORE_DOMAIN, SHOPIFY_ADMIN_TOKEN
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(0.1.2)于3个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:Spree Commerce: open-source B2B and marketplace ecommerce, Stripe MCP, MCP Cn Commerce
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Stripe MCP
MCP server integrating with Stripe - tools for customers, products, payments, and more.
MCP Cn Commerce
8 read-only MCP platform entries; support is operation-specific; merchant live acceptance pending
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Safe-write MCP server for Shopify Admin API operations
An agent can read and modify a Shopify store without being able to cause an unrecoverable accident. The safety layer is the differentiator: every write previews before it commits, large or irreversible changes require out-of-band human approval, and every action is recorded to a tamper-evident hash-chained audit file.
Architecture
flowchart TB
subgraph agent["Agent"] A[Claude] end
subgraph mcp["MCP stdio transport"] T[tools/call] end
subgraph core["safe-write-mcp-core"] PS[PlanStore] AS[ApprovalServer] end
subgraph shopify["Shopify Admin API"] GQL[GraphQL endpoint /admin/api/2026-04/graphql.json] end
subgraph audit["Audit"] LF[JSONL audit file hash-chained] end
A -->|"MCP stdio"| T T -->|create plan| PS T -->|preview| PS T -->|execute plan| PS PS -->|awaiting_approval| AS AS -->|approve/reject| PS PS -->|execute| GQL PS -->|record| LF
style PS fill:#e1f5fe style AS fill:#fff3e0 style LF fill:#f3e5f5 style GQL fill:#e8f5e9
The two-phase pattern (preview → token → execute) is the core discipline. Every write tool:
- Preview — reads current state and computes what would change, performing zero mutation calls
- Token — issues a plan token bound to the exact previewed manifest via a SHA-256 fingerprint
- Approval — plans exceeding
approvalRequiredAboveItems(default 25) or containing always-gated operations wait for human approval at the token-bearing URL the server prints on startup (e.g.http://127.0.0.1:4319/?token=) - Execute — re-reads current values, refuses if they drifted from the preview (
STATE_CHANGED), then applies mutations per-item with a full success/failure ledger
A plan whose manifest exceeds hardMaxItems (default 250) is refused outright — no token, no approval path.
Irreversible operations (cancel_order, refund_order) always require approval regardless of item count and cannot be rolled back. Reversible operations (price changes, inventory adjustments) support rollback within a configurable window (default 24 hours).
Threat model
The risk is not a malicious agent — the agent is trusted to author correct GraphQL. The risk is a trusted-but-fallible agent: syntactically perfect, well-formed operations whose *scope* is the problem.
The killer scenario — a syntactically perfect bulk reprice with a misplaced decimal:
update_prices([...], newPrice: 1.5) ← meant 15.00, typed 1.5
A 500-product bulk update that runs without preview-and-approve, or where the agent's price calculation contains a typo, produces exactly the wrong result at scale. Approval would catch it: a human sees "change 500 prices from $X to $1.50" and flags the不对劲. Without approval, or without the preview that makes the damage visible *before* it happens, the error lands silently in Shopify.
Three mechanisms carry the safety guarantee:
1. Preview-first, computed-diff. Every write tool reads current state and computes the manifest ({ref, before, after} pairs) without calling any mutation. A STATE_CHANGED re-read at execute time refuses the write if the world moved since preview. The blast radius is visible *before* anything changes.
2. Approval gating above the threshold. Plans touching >= approvalRequiredAboveItems items (default 25) require human approval. The threshold is sized for "is this large enough to warrant a human eye?" — meaningful for bulk value changes; irrelevant for one-item operations (which get unconditional approval for irreversible ops instead).
3. Plan token bound to exact manifest. The token is a SHA-256 fingerprint of the exact previewed manifest — not an opaque ID. Swapping in a wider set of items or a different price at execute time produces a different fingerprint and is refused as STATEMENT_MISMATCH.
Rollback provides recovery for reversible mistakes (wrong price, wrong inventory level) within the rollback window. It does *not* recover from the irreversible operations: a cancelled order stays cancelled, a refunded payment stays refunded.
Quick start
npm install
npm test npm run build
Set the required environment variable and point Claude Desktop at the server (see Configuration below). node dist/index.js starts the localhost approval UI alongside the MCP stdio server.
Demo: the step-by-step walkthrough script (store-wide reprice refused → approval-gated reprice → one-call rollback → hash-chained audit) is in docs/demo-runbook.md.
Configuration
Configuration file (default config.json in the working directory, or path via SHOPIFY_CONFIG):
{
"shopify": { "storeDomain": "my-store.myshopify.com", "apiVersion": "2026-04" }, "plans": { "planTtlMs": 60000, "approvalRequiredAboveItems": 25, "hardMaxItems": 250, "maxPriceChangePct": 30, "rollbackTtlMs": 86400000 }, "approvalServer": { "enabled": true, "port": 4319, "requireAuth": true }, "protectedTags": ["do-not-touch"], "callerId": "shopify-operations-mcp" }
Config reference
| Field | Type | Default | Description |
|---|---|---|---|
shopify.storeDomain | string | *(required)* | MyShopify domain, e.g. "my-store.myshopify.com" |
shopify.apiVersion | string | "2026-04" | Pinned quarterly Admin API version |
shopify.adminToken | string | *(env only)* | Admin API token — never in config file, only SHOPIFY_ADMIN_TOKEN env var |
plans.planTtlMs | positive int | 60000 | How long a plan token stays valid (ms). Overridable: SHOPIFY_PLAN_TTL_MS |
plans.approvalRequiredAboveItems | positive int | 25 | Plans touching this many items require human approval. Overridable: SHOPIFY_APPROVAL_REQUIRED_ABOVE_ITEMS |
plans.hardMaxItems | positive int | 250 | Plans exceeding this item count are refused outright. Overridable: SHOPIFY_HARD_MAX_ITEMS |
plans.maxPriceChangePct | positive int | 30 | Price changes exceeding this % require approval. Overridable: SHOPIFY_MAX_PRICE_CHANGE_PCT |
plans.rollbackTtlMs | positive int | 86400000 | Rollback window (ms, default 24h). Overridable: SHOPIFY_ROLLBACK_TTL_MS |
approvalServer.enabled | boolean | true | Start localhost approval UI alongside MCP server. Overridable: SHOPIFY_APPROVAL_SERVER_ENABLED |
approvalServer.port | positive int | 4319 | Port for localhost approval UI (127.0.0.1 only). Overridable: SHOPIFY_APPROVAL_SERVER_PORT |
approvalServer.requireAuth | boolean | true | Require the per-session bearer token on every approval-server route. Set false to fall back to pre-0.4.0 behavior (not recommended). Overridable: SHOPIFY_APPROVAL_SERVER_REQUIRE_AUTH |
approvalServer.authToken | string? | *(env only)* | Explicit bearer token for the approval server — never in config file, only SHOPIFY_APPROVAL_SERVER_AUTH_TOKEN env var. Unset means a random token is generated per start and printed once on stderr. |
protectedTags | string[] | ["do-not-touch"] | Tags that plans may never modify. Overridable: SHOPIFY_PROTECTED_TAGS (comma-separated) |
callerId | string | "unknown" | Identity recorded on every audit row. Overridable: SHOPIFY_CALLER_ID |
Invariant: plans.hardMaxItems must be >= plans.approvalRequiredAboveItems. The loader throws if violated.
Environment variables
All config fields are overridable by environment variables (precedence: env > config file > default). SHOPIFY_ADMIN_TOKEN is required and only ever read from the environment.
Tools
Read tools
search_products
Search products by title, SKU, vendor, or tag. Returns products with variants, current prices, and per-location inventory levels.
Arguments:
| Field | Type | Description |
|---|---|---|
title | string? | Matches products whose title contains the term (Shopify fuzzy search) |
sku | string? | Matches products with a variant whose SKU equals the term |
vendor | string? | Matches products from this vendor |
tag | string? | Matches products carrying this tag |
first | positive int? | Page size passed to Admin API (default 50) |
Returns: products[] with id, title, vendor, tags, variants (each with id, sku, price, inventoryItemId, inventoryLevels), plus flags.protected / flags.protectedTags indicating whether the product carries a protected tag.
Safety properties: Pure read — zero mutation calls. Protected-tagged products are returned (never filtered out) so a later write plan that touches them is refused.
list_orders
List orders filtered by financial status, fulfillment status, and date range.
Arguments:
| Field | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
financialStatus | FinancialStatus? | `"pending" \ | "authorized" \ | "partially_paid" \ | "paid" \ | "partially_refunded" \ | "refunded" \ | "voided"` |
fulfillmentStatus | FulfillmentStatus? | `"fulfilled" \ | "partial" \ | "unfulfilled"` | ||||
createdAfter | ISO-8601 string? | Orders created at or after this datetime | ||||||
createdBefore | ISO-8601 string? | Orders created at or before this datetime | ||||||
first | positive int? | Page size (default 250) |
Returns: orders[] with id, name, financialStatus, fulfillmentStatus, totalPrice, lineItems[].
Safety properties: Pure read — zero mutation calls.
Write tools (two-phase)
All write tools go through preview → token → (approval) → execute.
update_inventory
Set absolute inventory quantities at a named location for multiple inventory items. Preview reads current levels; execute calls inventorySetQuantities.
Arguments:
| Field | Type | Description |
|---|---|---|
locationId | string | gid://shopify/Location/… id |
adjustments | InventoryAdjustment[] | Each {inventoryItemId, quantity} sets the available quantity at locationId |
Safety properties:
- Threshold gating: requires approval when
adjustments.length >= approvalRequiredAboveItems(default 25); refused outright when> hardMaxItems(default 250) - Protected-tag enforcement: plans touching a product with a protected tag throw
PROTECTED_RESOURCEbefore a token is issued — no approval path - Per-item ledger: partial failure is recorded, never hidden
- Rollback: supported — restores
before.availablequantities via the snapshot
cancel_order
Cancel a Shopify order. Always requires approval regardless of item count. Cannot be rolled back.
Arguments:
| Field | Type | Description | |||
|---|---|---|---|---|---|
orderId | string | gid://shopify/Order/… id | |||
reason | string | `"customer" \ | "inventory" \ | "fraud" \ | "other"` |
restock | boolean | Return items to inventory | |||
notifyCustomer | boolean | Send cancellation email |
Safety properties:
- Always approval:
alwaysRequireApproval: trueis hardcoded in the tool — approval thresholds are never consulted - No snapshot: no
snapshotStore.capture()call — rollback is not opened for this operation - Rollback: refused with
ROLLBACK_UNSUPPORTED— cancellation is a state transition, not a value change
refund_order
Refund a Shopify order. Always requires approval regardless of item count. Cannot be rolled back.
Arguments:
| Field | Type | Description |
|---|---|---|
orderId | string | gid://shopify/Order/… id |
refundLineItems | RefundLineItem[]? | Line items and quantities to refund; absent = full refund of all fulfilled items |
reason | string | Human-readable reason recorded in audit |
Each RefundLineItem: {lineItemId, quantity, restockType?} where restockType is "RETURN" \| "NO_RESTOCK" \| "CANCEL".
Safety properties:
- **A
只显示了开头部分;其余内容请在仓库中阅读