shopify-mcp

v2.0.1
@junis/shopify-mcp Checked 1 day ago Published 24 days ago

Read-only MCP server for the Shopify Admin GraphQL API: products, orders, customers, inventory, content, metafields and ShopifyQL analytics

A read-only Model Context Protocol server for the Shopify Admin GraphQL API. It lets an AI agent look up products, variants, collections, inventory, orders, draft orders, customers, blog content, metafields, metaobjects, files and ShopifyQL analytics of one store. It only sends GraphQL queries; it never changes store data. Published on npm as @junis/shopify-mcp; the command is shopify-mcp. All 43 tools are marked readOnlyHint: true, destructiveHint: false, idempotentHint: true. Full input schemas, with defaults and limits, are in the tools/list response.

Summary extracted from the README.

shopify-mcp

A read-only Model Context Protocol server for the Shopify Admin GraphQL API. It lets an AI agent look up products, variants, collections, inventory, orders, draft orders, customers, blog content, metafields, metaobjects, files and ShopifyQL analytics of one store. It only sends GraphQL queries; it never changes store data.

Published on npm as @junis/shopify-mcp; the command is shopify-mcp.

Not affiliated with or endorsed by Shopify Inc. "Shopify" is their trademark. This project started as a fork of GeLi2001/shopify-mcp (MIT); see NOTICE.

Tools

All 43 tools are marked readOnlyHint: true, destructiveHint: false, idempotentHint: true. Full input schemas, with defaults and limits, are in the tools/list response. List tools take first (1–250, Shopify's page limit) and after (pageInfo.endCursor of the previous page).

Tool What it returns Personal data
get-products Active products with prices, category, image, options and metafields; response_mode listing, full or essential; optional country pricing and minimum_review_count (Loox) filter
get-product-by-id One product with variants, inventory per location, unit cost, media, SEO, collections, selling plans and metafield references
get-product-variants Variants with price, SKU, inventory and metafields
get-product-attributes Distinct product tags, types or vendors
get-product-reviews Reviews stored by the Loox app in the loox.reviews metafield (up to 100) reviewer names
get-collections Collections
get-collection-by-id One collection with its products
get-collection-by-handle One collection by handle, with its products
get-collection-rules-conditions Rules available for smart collections
get-customers Customers yes: name, e-mail, phone, addresses, notes, consent, spend
get-customer-by-id One customer with the last 50 orders and the last order's customer journey yes
get-customer-by-identifier One customer by e-mail or phone yes
get-customer-orders Orders of one customer (numeric ID) yes: name, e-mail
get-customer-saved-searches Customer segments and their queries
get-orders Orders yes: customer, shipping and billing addresses
get-order-by-id One order with line items, fulfillments, transactions and events yes
get-draft-orders Draft orders yes
get-fulfillment-orders Fulfillment orders yes: destination address
get-inventory-items Inventory items
get-inventory-item-by-id One inventory item with levels per location
get-inventory-level One inventory level
get-inventory-transfers Inventory transfers
get-inventory-properties Inventory quantity names
get-locations Store locations
get-shop Shop settings, domains, currencies, plan, policies shop contact e-mail
get-blogs Blogs
get-articles Published articles; the body is cleaned of srcset, class, style and inline scripts author names
get-pages Published pages
get-comments Blog comments yes: commenter name, e-mail, IP address
get-metafield-definitions Metafield definitions of an owner type
get-metafield-definition One metafield definition
get-metafield-definition-types Metafield types
get-standard-metafield-templates Standard metafield templates
get-metaobjects Metaobjects of one type
get-metaobject-by-id One metaobject
get-metaobject-by-handle One metaobject by type and handle
get-metaobject-definitions Metaobject definitions
get-price-lists Price lists
get-price-list-by-id One price list with prices
get-counts Count of products, variants, orders, draft orders, customers, collections, blogs or pages
get-taxonomy Shopify's standard product taxonomy
get-files Uploaded files
get-shopifyql-analytics Result of a read-only ShopifyQL query (see below) can be customer-level

There is no tool that runs arbitrary GraphQL, uploads files, fetches URLs or reads local files.

get-products response modes

get-products can treat some metafields as long-form product detail. List them in SHOPIFY_DETAIL_METAFIELD_KEYS as namespace.key names, for example custom.long_description,custom.faq. With no list, every metafield is treated as a normal field.

  • listing (default): every field and metafield except the detail metafields.
  • full: every field and metafield.
  • essential: product fields plus only the detail metafields, with HTML tags removed; status, dates, cursor, isGiftCard, totalVariants and hasOutOfStockVariants are left out.

loox.reviews is never included (use get-product-reviews). minimum_review_count keeps products whose loox.num_reviews metafield is at least that number. It is applied to each page after Shopify returns it, so read every page before concluding that no product matches.

get-shopifyql-analytics

Runs one ShopifyQL query, e.g. FROM sales SHOW total_sales GROUP BY day SINCE -7d, through the shopifyqlQuery field. ShopifyQL is read-only and the query is sent as a GraphQL variable, not spliced into the document. It needs the read_reports scope and can return customer-level rows; turn it off with SHOPIFY_DISABLED_TOOLS=get-shopifyql-analytics if the agent should not have that.

Requirements

  • Node.js 22 or later
  • A Shopify Admin API access token for your store (a custom app or an app installed with OAuth), with read scopes for the tools you use, for example read_products, read_inventory, read_locations, read_orders, read_draft_orders, read_customers, read_content, read_files, read_metaobjects and read_reports. A tool whose scope is missing returns Shopify's ACCESS_DENIED error. Grant only what the agent needs.

Configuration

Set these environment variables in your MCP client configuration. Nothing is read from files.

Variable Required Default Description
SHOPIFY_ACCESS_TOKEN yes Admin API access token (secret)
SHOPIFY_DOMAIN yes Your store's <store>.myshopify.com domain. MYSHOPIFY_DOMAIN is read when this is not set
SHOPIFY_API_VERSION 2026-01 Admin API version
SHOPIFY_TIMEOUT_MS 120000 Timeout per Shopify request (1,000–600,000)
SHOPIFY_MAX_RESPONSE_BYTES 52428800 Largest Shopify response accepted (50 MB)
SHOPIFY_MAX_CONCURRENCY 5 Most Shopify requests in flight at once for the whole process (1–20)
SHOPIFY_DISABLED_TOOLS (none) Comma-separated tool names not offered to the agent
SHOPIFY_DETAIL_METAFIELD_KEYS (none) Comma-separated namespace.key metafields that get-products treats as long-form detail
SHOPIFY_ALLOWED_CUSTOM_DOMAINS (none) Comma-separated hosts (host or host:port) other than *.myshopify.com that may receive the token, e.g. a proxy you run
SHOPIFY_ALLOW_INSECURE_HTTP false Set to true to allow http:// in SHOPIFY_DOMAIN (local test servers only)
SHOPIFY_REFRESH_TOKEN, SHOPIFY_TOKEN_TYPE, SHOPIFY_REFRESH_TOKEN_EXPIRES_AT Accepted for hosts that manage expiring tokens; not used except that the refresh token is kept out of error text
SHOPIFY_TOKEN_EXPIRES_AT ISO 8601 time the access token expires; only used to explain a 401

The server never refreshes tokens itself. A host application that uses expiring offline tokens refreshes them and restarts the server with the new SHOPIFY_ACCESS_TOKEN.

--accessToken=<token> and --domain=<store>.myshopify.com on the command line still work and take precedence over the environment, but a token on the command line is visible to other users of the machine in the process list, so the server prints a warning. Prefer the environment.

Example for Claude Desktop, Claude Code or any MCP client that starts stdio servers:

{
  "mcpServers": {
    "shopify": {
      "command": "npx",
      "args": ["-y", "@junis/shopify-mcp@2.0.1"],
      "env": {
        "SHOPIFY_DOMAIN": "your-store.myshopify.com",
        "SHOPIFY_ACCESS_TOKEN": "<admin api access token>"
      }
    }
  }
}

Pin a version as above so an update is a deliberate change.

Security

  • The token only goes to your store. SHOPIFY_DOMAIN must be <store>.myshopify.com (letters, digits and hyphens). Any other host, an IP address, a port, a path, a query, a fragment or a user name is refused at startup, so a mistyped or malicious value cannot send the token elsewhere. A different host (for example your own proxy) has to be listed in SHOPIFY_ALLOWED_CUSTOM_DOMAINS, and the server warns at every start when one is used.
  • HTTPS only unless SHOPIFY_ALLOW_INSECURE_HTTP=true, which is meant for local test servers and prints a warning at every start.
  • Redirects are refused, because following one would resend the access token to another address.
  • Requests time out (SHOPIFY_TIMEOUT_MS), responses are size-limited (SHOPIFY_MAX_RESPONSE_BYTES) and requests are limited process-wide (SHOPIFY_MAX_CONCURRENCY).
  • Credentials are read from the environment (or the command line) only; no .env file is read. They are never logged. Error text from Shopify is passed to the agent only as text, with the access token, the refresh token and the shop address removed, and is capped in length.
  • Arguments are bounded: page sizes 1–250, search queries up to 5,000 characters, IDs up to 500, ShopifyQL up to 10,000. Results are bounded by Shopify's own page size.
  • Each call writes one line to stderr with the tool name, outcome and duration. Arguments and results are not logged. At startup it prints the version, plus warnings and the disabled-tools list when they apply.
  • Tool results contain personal data of your customers (see the table above). Treat tool output as your store's customer data, give the agent and the token only the access they need, and turn off tools you do not need with SHOPIFY_DISABLED_TOOLS, for example get-customers,get-customer-by-id,get-customer-by-identifier,get-customer-orders,get-orders,get-order-by-id,get-draft-orders,get-fulfillment-orders,get-comments,get-shopifyql-analytics.
  • Text from the store (product descriptions, articles, reviews, comments, customer notes) is written by merchants and customers. An agent should treat it as data, not as instructions.

Report vulnerabilities as described in SECURITY.md.

Development

npm ci
npm run typecheck
npm test        # unit and end-to-end tests against a fake Shopify; no network access
npm run build   # writes dist/

License

MIT (LICENSE). Copyright (c) 2023 Shopify MCP Server Contributors (upstream) and Copyright (c) 2026 TOOEASY Inc. See NOTICE for attribution and trademarks.

LICENSE, NOTICE, SECURITY.md and CHANGELOG.md are included in the package (files on npm).