Shopify MCP
A read-only MCP server that exposes the full Shopify Admin GraphQL API through 6 universal tools, with multi-store support and mutation rejection at the parser level for safety.
README
Shopify MCP — Universal, Read-Only
A single MCP server exposing 100% of the Shopify Admin GraphQL API read surface (version 2026-04) through 6 universal tools. Read-only is enforced at the query-parser level — mutations are rejected before they ever reach Shopify, not merely discouraged. Multi-store by design: one server instance can serve many shops.
Built and maintained by Scalably. Runs on the Model Context Protocol. License: MIT.
Why read-only at the parser level? Giving an AI agent write access to a live store is how you end up with a deleted product or a wrong-priced variant. This server enforces read-only by parsing every query and rejecting mutations before they leave the process — not by trusting the model to behave, and not by relying on Shopify-side scopes alone. It's the safety boundary an agent in production actually needs. (more on the pattern)
Quick start
pip install -r requirements.txt
# Single store (simplest)
export SHOPIFY_DOMAIN="my-store.myshopify.com"
export SHOPIFY_ACCESS_TOKEN="shpat_..." # or SHOPIFY_CLIENT_ID + SHOPIFY_CLIENT_SECRET
python server.py
Then point any MCP client at the server. See Authentication below for multi-store and OAuth client-credentials setup.
Tools (6)
| Tool | Description |
|---|---|
shopify_list_stores |
Lists configured stores. Agent calls first. |
shopify_graphql_query |
Arbitrary read-only GraphQL. Mutations rejected by the parser. |
shopify_graphql_introspect |
Schema introspection — full catalog or single type. |
shopify_bulk_query |
Launch async bulk export (JSONL). |
shopify_bulk_poll |
Poll bulk operation status + download URL. |
shopify_shopifyql |
ShopifyQL analytics (SQL-like; requires read_reports). |
Every non-list tool takes an optional shop argument (alias or domain). Required when >1 store configured; auto-selected when exactly 1.
Coverage
100% of Admin GraphQL API read surface — any object, field, or connection accessible with the token's scopes is reachable via shopify_graphql_query. Anything large-scale (>10k records) should use shopify_bulk_query. Analytics goes through shopify_shopifyql.
Authentication
Multi-store (preferred for agency setups)
Set SHOPIFY_STORES to a JSON object mapping alias → store config:
{
"main": {"domain": "my-store.myshopify.com", "client_id": "...", "client_secret": "..."},
"outlet": {"domain": "my-store-outlet.myshopify.com", "client_id": "...", "client_secret": "..."},
"legacy": {"domain": "legacy-store.myshopify.com", "access_token": "shpat_..."}
}
- Each store can use EITHER
client_id+client_secret(Dev Dashboard OAuth, 24h tokens auto-refreshed per store) ORaccess_token(legacyshpat_). - Aliases:
[a-z0-9][a-z0-9_-]{0,63}. Lowercase-normalized on load. - Token cache is per-store-domain; one throttled store doesn't block others.
Single-store (backward-compat)
If SHOPIFY_STORES is unset, the MCP falls back to single-store env vars:
SHOPIFY_DOMAINorSHOPIFY_SHOP_DOMAIN—<shop>.myshopify.com- Auth path A:
SHOPIFY_CLIENT_ID+SHOPIFY_CLIENT_SECRET(Dev Dashboard) - Auth path B:
SHOPIFY_ACCESS_TOKEN(legacyshpat_)
The single store registers under alias default — callers can omit shop argument on tool calls.
Read-only enforcement
Every query is parsed with graphql-core before transmission. The parser rejects:
subscriptionoperations (not supported by Admin API anyway)- Any top-level
mutationEXCEPTbulkOperationCancel(cancels an in-flight bulk job, no shop-data write) - Malformed GraphQL (syntax errors)
- Queries > 100KB
bulkOperationRunQuery is NOT in the generic parser allowlist. Legitimate bulk exports go through the dedicated shopify_bulk_query tool, which validates the inner query with _assert_read_only BEFORE wrapping it in the bulk mutation. Single source of truth — no reliance on Shopify-side validation.
Rate limiting
Per-store cost-based leaky bucket (Shopify's model). Each response includes extensions.cost.throttleStatus. On THROTTLED errors, the MCP sleeps ceil((requestedQueryCost - currentlyAvailable) / restoreRate) seconds (minimum 1s) and retries up to 3 times. Over limit → surfaced to caller.
Buckets are independent per store — throttle on store A doesn't affect store B.
Security hardening
- Shop domain validated against
^[a-z0-9][a-z0-9-]*\.myshopify\.com$(no arbitrary hostnames — defeats SSRF). - Alias pattern
^[a-z0-9][a-z0-9_-]{0,63}$. allow_redirects=Falseon both token exchange and GraphQL calls.X-Shopify-Access-Token,client_secret, and all token prefixes (shpua_,shpat_,shpss_,shpca_) redacted from logs and error messages.- Input validation: GraphQL parsed, operation IDs regex-matched, type names validated, query-size ceiling 100KB.
- Per-store token cache in memory only; flushed on 401/ACCESS_DENIED with one retry.
Service name
shopify
API version
Default pin: 2026-04. Callers can override per-tool via api_version="YYYY-MM". Bump the module constant SHOPIFY_API_VERSION quarterly after smoke-testing new versions.
Scopes needed (read-only)
Minimum viable: read_products read_orders read_customers.
Recommended baseline:
read_products read_orders read_customers read_inventory read_locations read_fulfillments read_discounts read_content read_themes read_files read_markets read_metaobjects read_metaobject_definitions read_reports read_translations read_locales read_shipping.
Add read_all_orders for >60-day order history. Enable Protected customer data access in Dev Dashboard → Configuration if the agent needs customer PII.
Privacy Policy
This connector runs locally, on your own machine, under your own Shopify credentials. It is a thin read-only bridge between your MCP client and Shopify's Admin API.
- Data collection: The connector collects no personal data and contains no telemetry, analytics, or external reporting. It does not phone home.
- Data usage: Shopify store data you query is returned to your local MCP client to fulfill your request, and is not used for any other purpose.
- Data storage: The connector stores nothing persistently. Access tokens are held in memory only for the life of the process and are never written to disk. The only network destination is Shopify's own API (
*.myshopify.com), enforced by a domain allowlist. - Third-party sharing: None. Data flows only between your machine and Shopify. No third party (including the connector's author) ever receives your data or credentials.
- Retention: No data is retained by the connector after the process exits.
- Secret handling: Access tokens, client secrets, and all Shopify token prefixes are redacted from logs and error messages.
- Contact: hello@scalably.io
The canonical hosted version of this policy: https://scalably.io/connector-privacy.html
Learn more
We write about building production MCP servers and AI agents at scalably.io/blog:
- How to build an MCP server in Python — the read-only enforcement pattern used here, from a server we run in production
- What is an MCP server? — the host/client/server model
- MCP Inspector: debug your MCP server — the silent failures to watch for
References
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。