Shopify Admin MCP

io.github.A1-x-Tech由 GitHub 账号 A1-x-Tech 发布v1.2.2更新于 Nov 3, 2026

MCP server for the Shopify Admin API: products, orders, customers, inventory, discounts.

已验证STDIO仅桌面开发者工具商业与电商

概览

AI 生成的概览

把 AI 助手连接到单个 Shopify 店铺的 Admin GraphQL API,用于读取和修改商品、订单、客户、库存与折扣。

可以做什么
  • 读取店铺信息、地点、商品、订单、客户和折扣,支持游标分页与 Shopify 搜索语法
  • 创建和更新商品,设置变体价格与划线价
  • 按地点设置库存的绝对可售数量
  • 取消订单,并明确选择是否退款、是否回库
  • 创建百分比或固定金额的基础折扣码
  • 执行任意 Admin GraphQL 文档,处理没有专用工具的功能
适用场景
适合只管理一个 Shopify 店铺、希望助手直接回答商品、订单、客户和库存问题,或完成改价、调整库存、建折扣码等日常操作的场景,无需打开后台。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 20 或更高版本;仅浏览器的网页版对话无法启动。需要 SHOPIFY_STORE_DOMAIN,以及同一 Shopify 组织内 Dev Dashboard 应用的 SHOPIFY_CLIENT_ID 与 SHOPIFY_CLIENT_SECRET,或旧版 SHOPIFY_ACCESS_TOKEN。应用需具备 read_products、write_products、read_orders、read_customers 等 Admin API 权限;60 天前的订单需 read_all_orders。变量仅在启动时读取。
安装前请注意
客户端密钥和访问令牌等同密码,不要提交到 Git。写入会改变店铺数据:更新商品会覆盖所传字段,标签整体替换,库存设为绝对值,新建商品不会自动上架。取消订单不可撤销,可能退款并回库。graphql_request 可执行任意变更,被标记为破坏性操作。服务器会发送匿名遥测,包含错误片段,除非设置 ASKADS_TELEMETRY=0。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Shopify Admin MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[A1] Shopify Admin MCP

English | Русский

[npm] [Glama] [CI] [License: MIT]

A1 Shopify Admin MCP connects AI applications to one Shopify store through the Admin GraphQL API. Ask in plain language about products, orders, customers, inventory, discounts, and shop data; the assistant uses the server's ready-made tools and shows the result.

  • One store per server. The store domain and credentials come from configuration; tools cannot switch to another store.
  • Tokens stay fresh. Give the server the client ID and secret of a Shopify Dev Dashboard app and it mints the Admin API token itself, keeps it in memory only, and re-mints it before the 24-hour expiry. A ready-made token from an older custom app still works too.
  • 16 focused tools. Read shop data, products, orders, customers, locations, inventory, and discounts, plus create or update the supported records.
  • GraphQL failures are surfaced. Shopify can return HTTP 200 for a failed mutation, so the server checks userErrors and rejects empty or malformed GraphQL responses.
  • Cost-aware responses. Every result includes the GraphQL cost bucket: the cost of the request and the points currently available for the next calls.
  • Risk is visible. Reads are read-only; product, price, inventory, and discount writes are explicit; order cancellation and arbitrary GraphQL are marked destructive.

Start with a read-only request:

Show the latest orders and the products that currently have inventory.

Connect the server · Explore use cases · Open technical documentation


See it work in a minute

You: Show the latest orders and the products that currently have inventory.

Assistant: Shows recent orders with their statuses and totals, then products with prices and inventory. Nothing changes.

You: Prepare a 20% discount code called SUMMER for two weeks.

Assistant: Shows the proposed code, percentage, dates, and limits, then asks for confirmation before creating it.

You: Confirm.

Contents

Quick start

You need Node.js 20+, a store domain such as my-store.myshopify.com, and Admin API credentials. The recommended set is the client ID and secret of a Shopify Dev Dashboard app: the server exchanges them for an access token itself and keeps that token fresh, which matters because the token Shopify issues for this grant expires after 24 hours. The app and the store must belong to the same Shopify organization.

  1. Get access and prepare the app's client ID and client secret.
  2. Add the MCP server to your AI application.
  3. Send the safe request from the opening section.

The server runs locally over stdio through npx. Browser-only ChatGPT and Claude web sessions cannot start a local stdio process directly.

Every snippet below uses that pair. If your store still holds a ready-made token from an admin-created custom app, replace SHOPIFY_CLIENT_ID and SHOPIFY_CLIENT_SECRET with a single SHOPIFY_ACCESS_TOKEN — see Getting access.

Codex

Through the app:

  1. Open Settings → MCP servers.

  2. Select Add server.

  3. Choose STDIO, then enter npx -y mcp-shopify-admin@latest and set SHOPIFY_STORE_DOMAIN, SHOPIFY_CLIENT_ID, and SHOPIFY_CLIENT_SECRET.

  4. Select Save, then Restart.

Through the CLI:

bash
codex mcp add shopify-admin \  --env SHOPIFY_STORE_DOMAIN=my-store.myshopify.com \  --env SHOPIFY_CLIENT_ID=your_client_id \  --env SHOPIFY_CLIENT_SECRET=your_client_secret \  -- npx -y mcp-shopify-admin@latest
codex mcp list

Codex MCP documentation

Claude Code
bash
claude mcp add \  --env SHOPIFY_STORE_DOMAIN=my-store.myshopify.com \  --env SHOPIFY_CLIENT_ID=your_client_id \  --env SHOPIFY_CLIENT_SECRET=your_client_secret \  --transport stdio --scope user shopify-admin \  -- npx -y mcp-shopify-admin@latest
claude mcp list

Claude Code MCP documentation

Claude Desktop

The current official path is Settings → Extensions. For a custom desktop extension, open Advanced settings → Extension Developer → Install Extension…, select a .mcpb file and follow the prompts.

This repository currently publishes an npm stdio package and does not contain a .mcpb bundle. For Claude Desktop builds that still support local configuration, use the following JSON stdio configuration as a fallback:

json
{  "mcpServers": {    "shopify-admin": {      "command": "npx",      "args": ["-y", "mcp-shopify-admin@latest"],      "env": {        "SHOPIFY_STORE_DOMAIN": "my-store.myshopify.com",        "SHOPIFY_CLIENT_ID": "your_client_id",        "SHOPIFY_CLIENT_SECRET": "your_client_secret"      }    }  }}

In those builds, save it to ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows.

Claude Desktop MCP documentation

Cursor

Add this server to ~/.cursor/mcp.json on macOS/Linux or %USERPROFILE%\.cursor\mcp.json on Windows:

json
{  "mcpServers": {    "shopify-admin": {      "type": "stdio",      "command": "npx",      "args": ["-y", "mcp-shopify-admin@latest"],      "env": {        "SHOPIFY_STORE_DOMAIN": "my-store.myshopify.com",        "SHOPIFY_CLIENT_ID": "your_client_id",        "SHOPIFY_CLIENT_SECRET": "your_client_secret"      }    }  }}

Cursor MCP documentation

VS Code

Run MCP: Open User Configuration and add:

json
{  "inputs": [    {      "type": "promptString",      "id": "shopify_store_domain",      "description": "Shopify store domain, for example my-store.myshopify.com"    },    {      "type": "promptString",      "id": "shopify_client_id",      "description": "Client ID of the Shopify Dev Dashboard app"    },    {      "type": "promptString",      "id": "shopify_client_secret",      "description": "Client secret of that app",      "password": true    }  ],  "servers": {    "shopify-admin": {      "type": "stdio",      "command": "npx",      "args": ["-y", "mcp-shopify-admin@latest"],      "env": {        "SHOPIFY_STORE_DOMAIN": "${input:shopify_store_domain}",        "SHOPIFY_CLIENT_ID": "${input:shopify_client_id}",        "SHOPIFY_CLIENT_SECRET": "${input:shopify_client_secret}"      }    }  }}

Check the server with MCP: List Servers.

VS Code MCP documentation

What you can ask it to do

  • Inspect the store. Show shop details, locations, products, orders, customers, or discounts.
  • Work with products. Create a product draft, update product fields, or change variant prices.
  • Track inventory. Find locations and set the absolute available quantity for inventory items.
  • Review orders. Search orders, inspect a complete order, or cancel an eligible order with explicit refund and restock choices.
  • Manage discounts. List existing discounts or create a basic code discount.
  • Use the escape hatch. Run an arbitrary Admin GraphQL document for capabilities that do not have a dedicated tool.

What can change in Shopify

OperationWhat happensData boundary
Shop, products, orders, customers, locations, discountsReads store dataRead-only
Product fields or variant pricesReplaces the fields supplied in the requestChanges the storefront data
Inventory quantitiesSets the absolute available quantityChanges product availability
Product or discount creationCreates a new Shopify objectCreates data and cannot be undone automatically
Order cancellationCancels an order and can refund and/or restockDestructive and irreversible
graphql_requestCan run any Admin API query or mutationPotentially destructive

This server does not provide dedicated tools for creating orders, fulfillment, customer writes, variant creation, media, targeted discounts, or publishing products to sales channels. Use graphql_request only when you understand the document and its userErrors response.

The AI client may ask for confirmation before a write, but confirmation behavior belongs to that client. A clear request to create, update, set, or cancel authorizes the corresponding server operation.

Getting access

The server authenticates in one of two ways: with the client ID and secret of a Dev Dashboard app, which it exchanges for an access token itself, or with a ready-to-use Admin API access token that it sends as-is. If both are configured, the ready-made token wins.

Dev Dashboard app (recommended)

Shopify stopped allowing new admin-created custom apps on 2026-01-01, so this is the path for any store being set up today.

  1. Create an app in the Shopify Dev Dashboard or with the Shopify CLI, in the same Shopify organization the store belongs to.
  2. Give it the Admin API access scopes you need, such as read_products, write_products, read_orders, read_customers, read_locations, write_inventory, read_discounts, and write_discounts.
  3. Install the app on the store.
  4. Use the app's client ID and client secret as SHOPIFY_CLIENT_ID and SHOPIFY_CLIENT_SECRET.

From there the server runs the client credentials grant against https://{store}.myshopify.com/admin/oauth/access_token on its own. The token Shopify returns lives 24 hours; the server keeps it in memory only — never on disk — re-mints it shortly before it expires, lets parallel tool calls share one exchange, and mints a fresh one if the API answers 401. Nothing to renew by hand.

The grant works only when the app and the store belong to the same Shopify organization. Otherwise Shopify refuses with shop_not_permitted, and the server relays that as a hint naming the organization mismatch. Re-issuing the credentials does not help: move the app into the store's organization, or use a store from it.

Existing admin-created custom apps (legacy)

Apps created in the Shopify admin before 2026-01-01 keep working, and their token is still accepted. If you already maintain one:

  1. Open the app in the Shopify admin.
  2. Confirm the required Admin API access scopes, such as read_products, write_products, read_orders, read_customers, read_locations, write_inventory, read_discounts, and write_discounts.
  3. Install or reinstall the app if Shopify asks you to generate credentials.
  4. Use the issued Admin API access token as SHOPIFY_ACCESS_TOKEN.

The server sends this token as-is and never refreshes it, so replacing it when it stops working is yours to do. See Shopify's legacy admin-created custom app documentation.

Treat the access token and the client secret as passwords and never commit them to Git. For safe testing, use a Shopify development store.

Configuration

VariableRequiredDescription
SHOPIFY_STORE_DOMAINYes*Permanent store host such as my-store.myshopify.com; a bare store name also works.
SHOPIFY_CLIENT_IDYes**Client ID of a Dev Dashboard app. Together with the secret, the server mints its own 24-hour access token and keeps it fresh.
SHOPIFY_CLIENT_SECRETYes**Client secret of that app. Sent only to the store's /admin/oauth/access_token; the minted token stays in memory.
SHOPIFY_ACCESS_TOKENYes**Legacy alternative: a ready-to-use Admin API access token from a pre-2026 custom app. The server sends it in X-Shopify-Access-Token and never refreshes it; it wins if the client pair is set too.
SHOPIFY_API_VERSIONNoQuarterly YYYY-MM release or unstable; default: 2026-01.
SHOPIFY_API_BASENoFull http/https GraphQL endpoint override, useful for a local mock.
SHOPIFY_TIMEOUT_MSNoPer-request timeout; default: 30000 ms.
SHOPIFY_MAX_RETRIESNoRetries for THROTTLED/429 and for 5xx/network errors on reads; default: 4.
SHOPIFY_TOKEN_LEEWAY_SECONDSNoHow early a minted token is replaced; default: 300 s. Has no effect with a ready-made token.

* SHOPIFY_API_BASE can replace the store domain for local tests, but a real Shopify request still needs credentials.

** One of the two authentication paths is required: SHOPIFY_CLIENT_ID + SHOPIFY_CLIENT_SECRET, or SHOPIFY_ACCESS_TOKEN. With neither, the server still starts and answers initialize, but every tool call returns an error naming both options. Variables are read at startup, so restart the server after changing them.

Data, limits, and background work

  • GraphQL cost bucket. Every result exposes actualQueryCost, currentlyAvailable, maximumAvailable, and restoreRate when Shopify provides them. A page with first up to 250 is usually cheaper than many small pages.
  • Retries are asymmetric. THROTTLED and HTTP 429 are retried with the wait Shopify reports. 5xx and network errors are retried only for reads; mutations are not replayed after those failures.
  • Order history. Orders older than 60 days require the read_all_orders scope; without it, Shopify does not return them.
  • No background monitoring. The server works when called. If your AI application supports scheduled tasks, it can periodically check orders or inventory.
  • Anonymous telemetry. The server sends technical installation and tool-use events without secrets, store data, arguments, or prompts. For each tool call it also sends the outcome and, on failure, an excerpt of the error text with e-mails, addresses, tokens, numbers of 4+ digits and quoted text replaced by #; a value from your request can appear in it if the error text contains it. Disable it for all Ask Ads MCP servers with ASKADS_TELEMETRY=0.

Technical documentation

Support

Found a bug or missing scenario? Create an issue or contact us on Telegram.


[Two Monas giving a high five]

You made it to the end!

来源:README.md,提交 09c1ecf

工具

16

get_shop

Данные магазина

Возвращает магазин, к которому привязан сервер: название, myshopifyDomain, основной домен витрины, валюту, тариф (plan), контактный email, часовой пояс, число товаров и список локаций (id локаций нужны инструменту set_inventory). Аргументов не принимает — магазин задан в SHOPIFY_STORE_DOMAIN и не выбирается для отдельного вызова. Как и у всех инструментов здесь, в ответе есть cost: состояние cost-бакета GraphQL (actualQueryCost — сколько стоил запрос, currentlyAvailable/maximumAvailable — остаток и размер бакета, restoreRate — восстановление в секунду).

无需输入参数。

list_products

Список товаров

Возвращает страницу товаров магазина (id, название, handle, статус, вендор, тип, теги, общий остаток, до 5 вариантов с ценами) плюс count — число товаров под тем же фильтром. Пагинация курсорная: в ответе pageInfo-поля hasNextPage и endCursor, следующий вызов передаёт endCursor в after; параметра "номер страницы" у Shopify нет. query — строка поиска Shopify, например "status:active", "vendor:Nike created_at:>=2026-01-01", "title:*shirt*". Страница first до 250 за один вызов дешевле по cost-бакету, чем много мелких страниц.

输入参数afterfirstquery

get_product

Карточка товара

Возвращает один товар целиком: описание (HTML), опции, до 100 вариантов с ценами, остатками, SKU и id inventoryItem (этот id нужен инструменту set_inventory). Принимает числовой id или gid://shopify/Product/<id>. Несуществующий товар — это data: null, а не ошибка. Медиафайлы и метаполя не возвращает — за ними graphql_request.

输入参数id必填

create_product

Создать товар

Создаёт товар и возвращает его с дефолтным вариантом, который Shopify добавляет сам. Товар НЕ появляется на витрине: созданные через API товары не опубликованы ни в одном канале продаж, и публикация делается отдельной операцией publishablePublish (её здесь нет — только через graphql_request). Статус по умолчанию — ACTIVE, но это не публикация: status: "DRAFT" дополнительно помечает товар черновиком. Цена задаётся следующим вызовом update_variant по id созданного дефолтного варианта (он есть в ответе). Варианты, изображения и остатки этот инструмент не создаёт. Повторный вызов создаст второй такой же товар. Провал приходит как ошибка с userErrors — HTTP-статус Shopify всегда 200.

输入参数tagstitle必填statusvendorproductTypedescriptionHtml

update_product

Изменить товар

Перезаписывает переданные поля товара (название, описание, вендор, тип, теги, статус) и не трогает остальные. tags замещают весь список тегов, а не добавляются к нему. Цены и остатки здесь не меняются — цены через update_variant, остатки через set_inventory. status: DRAFT снимает товар с витрины, ARCHIVED архивирует (обратимо — вернуть можно, снова передав ACTIVE). Провал приходит как ошибка с userErrors.

输入参数id必填tagstitlestatusvendorproductTypedescriptionHtml

update_variant

Изменить цены варианта

Задаёт цену и/или зачёркнутую цену (compareAtPrice) вариантам одного товара — до 250 вариантов за вызов, каждый элемент variants несёт id варианта и новые значения. Суммы — десятичные строки в валюте магазина ("1999.00"); compareAtPrice: null убирает зачёркнутую цену. Больше ничего в варианте не меняет (SKU, штрихкод, опции — через graphql_request). Требуется id товара-родителя: он есть в ответах list_products и get_product. Провал приходит как ошибка с userErrors.

输入参数variants必填productId必填

list_orders

Список заказов

Возвращает страницу заказов, новые первыми (номер, дата, финансовый статус, статус выдачи, сумма, клиент) плюс count под тем же фильтром. Пагинация курсорная: hasNextPage/endCursor в ответе, следующий вызов передаёт endCursor в after. query — строка поиска Shopify: "financial_status:pending", "fulfillment_status:unfulfilled", "created_at:>=2026-08-01", "email:[email protected]". Нужен scope read_orders; заказы старше 60 дней требуют ещё read_all_orders — без него они просто не приходят.

输入参数afterfirstquery

get_order

Карточка заказа

Возвращает один заказ целиком: позиции (до 100), суммы (итог, доставка, возвраты), адрес доставки, заметку, теги, отгрузки с трек-номерами. Принимает числовой id или gid://shopify/Order/<id> — id, не «номер» вида #1001 (номер ищется через list_orders с query "name:#1001"). Несуществующий заказ — это data: null, а не ошибка.

输入参数id必填

cancel_order

Отменить заказ

НЕОБРАТИМО отменяет заказ. Два решения обязательны и не имеют значений по умолчанию: refund — вернуть ли деньги покупателю, restock — вернуть ли позиции на склад. notifyCustomer управляет письмом покупателю. Отмена выполняется фоновой задачей: в ответе job, а не обновлённый заказ — итог стоит проверить через get_order. Уже выданный (fulfilled) заказ Shopify отменить не даст — это придёт ошибкой userErrors. Расформировать отмену нельзя; частичные возвраты этот инструмент не делает.

输入参数reason必填refund必填orderId必填restock必填staffNotenotifyCustomer

list_customers

Список клиентов

Возвращает страницу клиентов (имя, email, телефон, число заказов, потраченная сумма, город) плюс count — число клиентов под тем же фильтром. Пагинация курсорная: hasNextPage/endCursor в ответе, следующий вызов передаёт endCursor в after. query — строка поиска Shopify: "email:[email protected]", "phone:+79001234567", "state:enabled", "created_at:>=2026-01-01". Клиентов не создаёт и не меняет — записи с персональными данными изменяются только через graphql_request. Нужен scope read_customers.

输入参数afterfirstquery

get_customer

Карточка клиента

Возвращает одного клиента целиком: контакты, адреса, заметку, теги и его 10 последних заказов с суммами. Принимает числовой id или gid://shopify/Customer/<id>; клиент по email ищется через list_customers с query "email:...". Несуществующий клиент — это data: null, а не ошибка.

输入参数id必填

list_locations

Список локаций

Возвращает локации магазина (склады и точки), включая неактивные: id, название, адрес, активность, выполняет ли онлайн-заказы. Именно id локации нужен инструменту set_inventory. У большинства магазинов локаций одна-две, так что страницы по умолчанию хватает.

输入参数first

set_inventory

Задать остатки

Устанавливает АБСОЛЮТНЫЙ доступный остаток (available) позиций на локациях — «стало N», не «изменить на N»: повторный вызов с теми же числами ничего не меняет. Каждый элемент quantities несёт inventoryItemId (id inventoryItem варианта — он в ответе get_product, это НЕ id варианта), locationId (из list_locations) и quantity >= 0. reason — из закрытого словаря Shopify, по умолчанию correction. Историю движений не пишет и резервы не трогает. Провал приходит как ошибка с userErrors — например, если позиция не отслеживается (inventory tracking выключен) или не привязана к локации.

输入参数reasonquantities必填

list_discounts

Список скидок

Возвращает страницу скидок магазина — промокодных и автоматических: тип (__typename), название, статус, период действия, лимит использований, для кодовых — до 5 кодов и счётчик применений. Пагинация курсорная (hasNextPage/endCursor → after). query — строка поиска Shopify: "status:active", "type:code", "title:BLACKFRIDAY". Ничего не создаёт и не выключает.

输入参数afterfirstquery

create_basic_discount

Создать промокод

Создаёт базовую промокодную скидку: один код, процент (percentage, доля 0..1: 0.2 = −20%) ИЛИ фиксированная сумма (amount в валюте магазина) — ровно одно из двух, для всех клиентов на все товары. startsAt по умолчанию — сейчас, то есть код начинает действовать немедленно; отложенный запуск задаётся явным startsAt. usageLimit — общий лимит применений, appliesOncePerCustomer — не больше раза на клиента. Скидки на отдельные коллекции/сегменты, BXGY и бесплатная доставка здесь не создаются (graphql_request), выключение скидки — тоже. Повторный вызов с тем же кодом провалится userErrors: код должен быть уникален.

输入参数code必填title必填amountendsAtstartsAtpercentageusageLimitappliesOncePerCustomer

graphql_request

Произвольный GraphQL-запрос

Выполняет произвольный GraphQL-документ против Admin API магазина — для всего, чему нет отдельного инструмента (метаполя, медиа, коллекции, вебхуки, сегменты, bulk-операции). Токен, магазин и версию API подставляет сервер; переменные — через variables. Помечен destructive, потому что документ может быть мутацией; query безопасен. ВАЖНО: у мутаций Shopify HTTP 200 не значит успех — реальный вердикт в userErrors внутри data, и здесь он возвращается как есть, без интерпретации: поле userErrors нужно проверить самому. Ретраев для мутаций нет (повтор мог бы применить изменение дважды) — вид операции определяется разбором документа, поэтому мутация с фрагментом перед ней тоже не повторяется; THROTTLED повторяется сам после паузы. Стоимость запроса видна в cost ответа — глубокие вложенные выборки стоят дорого, а дороже 1000 очков запрос отклоняется валидатором Shopify.

输入参数query必填variablesoperationName

版本历史

4
  1. v1.2.2最新Nov 1, 2026
  2. v1.2.1Oct 31, 2026
  3. v1.2.0Oct 31, 2026
  4. v1.1.0Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分