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 分