Shopify
STDIO通过GraphQL API管理Shopify店铺数据的MCP服务器
通过GraphQL API管理Shopify店铺数据的MCP服务器
(please leave a star if you like!)
MCP Server for Shopify API, enabling interaction with store data through GraphQL API. This server provides tools for managing products, customers, orders, and more.
📦 Package Name: shopify-mcp
🚀 Command: shopify-mcp (NOT shopify-mcp-server)
To use this MCP server, you'll need to create a custom app in your Shopify store:
read_products, write_productsread_customers, write_customersread_orders, write_ordersread_content, write_content (for blogs and articles)Add this to your claude_desktop_config.json:
{ "mcpServers": { "shopify": { "command": "npx", "args": [ "shopify-mcp", "--accessToken", "<YOUR_ACCESS_TOKEN>", "--domain", "<YOUR_SHOP>.myshopify.com" ] } } }
Locations for the Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.jsonIf you prefer to use environment variables instead of command-line arguments:
Create a .env file with your Shopify credentials:
SHOPIFY_ACCESS_TOKEN=your_access_token
MYSHOPIFY_DOMAIN=your-store.myshopify.com
Run the server with npx:
npx shopify-mcp
If you want to install the package globally:
npm install -g shopify-mcp
Then run it:
shopify-mcp --accessToken=<YOUR_ACCESS_TOKEN> --domain=<YOUR_SHOP>.myshopify.com
⚠️ Important: If you see errors about "SHOPIFY_ACCESS_TOKEN environment variable is required" when using command-line arguments, you might have a different package installed. Make sure you're using shopify-mcp, not shopify-mcp-server.
get-products
searchTitle (optional string): Filter products by titlelimit (optional number, default: 10): Maximum number of products to returnafter (optional string): Cursor for pagination - get items after this cursorbefore (optional string): Cursor for pagination - get items before this cursorreverse (optional boolean, default: false): Reverse the order of the returned productsproducts: Array of products, each containing:
title: Product title (SEO-optimized)description: Plain text product descriptiondescriptionHtml: HTML-formatted product descriptioncursor: Cursor for paginationpageInfo: Pagination information containing:
hasNextPage: Whether there are more items after the current pagehasPreviousPage: Whether there are more items before the current pagestartCursor: Cursor for the first item in the current pageendCursor: Cursor for the last item in the current page// Get first page of products { "limit": 10 } // Get next page using the endCursor from previous response { "limit": 10, "after": "endCursor_from_previous_response" } // Get previous page using the startCursor from current response { "limit": 10, "before": "startCursor_from_current_response" }
// Search products with pagination { "searchTitle": "t-shirt", "limit": 5, "after": "cursor_from_previous_response" }
// Get products in reverse order { "limit": 10, "reverse": true }
startCursor and endCursor from each responsehasNextPage and hasPreviousPage to show/hide navigation controlslimit value for consistent page sizesreverse when you need newest/oldest items firstsearchTitle for paginated search resultsget-product-by-id
productId (string): The GID of the product to fetch (e.g., "gid://shopify/Product/1234567890")title: Product title (SEO-optimized)description: Plain text product descriptiondescriptionHtml: HTML-formatted product descriptionupdate-product
productId (required string): The product's ID (e.g., "gid://shopify/Product/1234567890")title (optional string): New product titledescriptionHtml (optional string): Product description in HTML formatseo (optional object): SEO settings
title (optional string): SEO-optimized titledescription (optional string): Meta description for search enginesstatus (optional string): Product status - "ACTIVE", "ARCHIVED", or "DRAFT"vendor (optional string): Product manufacturer or brandproductType (optional string): Category or type of producttags (optional array of strings): Product tags for categorizationvariants (optional array of objects): Product variants to update
id (string): Variant ID to updateprice (optional string): New pricecompareAtPrice (optional string): Original/compare-at pricesku (optional string): Stock Keeping Unitbarcode (optional string): Product barcodeinventoryPolicy (optional string): "DENY" or "CONTINUE" for out-of-stock behavior// Update product title and status { "productId": "gid://shopify/Product/1234567890", "title": "Awesome T-Shirt", "status": "ACTIVE" }
// Make your product more visible in search results { "productId": "gid://shopify/Product/1234567890", "seo": { "title": "Awesome T-Shirt | 100% Cotton | Available in 5 Colors", "description": "High-quality cotton t-shirt perfect for everyday wear. Available in multiple colors and sizes." } }
// Change prices and inventory settings { "productId": "gid://shopify/Product/1234567890", "variants": [ { "id": "gid://shopify/ProductVariant/1234567", "price": "29.99", "compareAtPrice": "39.99", "inventoryPolicy": "DENY" } ] }
// Update multiple aspects at once { "productId": "gid://shopify/Product/1234567890", "title": "Premium Cotton T-Shirt", "vendor": "Fashion Basics", "productType": "Apparel", "tags": ["cotton", "t-shirt", "basics", "summer"], "seo": { "title": "Premium Cotton T-Shirt | Fashion Basics | Multiple Colors", "description": "Experience comfort with our premium cotton t-shirt. Perfect for any occasion." }, "variants": [ { "id": "gid://shopify/ProductVariant/1234567", "price": "29.99", "compareAtPrice": "39.99" } ] }
compareAtPrice to show savingsget-productsget-product-by-id to see all variantsupdate-product-image-alt-text
productId (string): The GID of the product to which the image belongs (e.g., "gid://shopify/Product/1234567890")imageId (string): The GID of the product image/media to update (e.g., "gid://shopify/MediaImage/123")altText (string | null): The new descriptive alt text for the image. Set to null to remove. Best practice is to keep it under 125 characters, max 512.id: The media IDaltText: The updated alt textget-collections
searchTitle (optional string): Filter collections by titlelimit (optional number, default: 10): Maximum number of collections to returnget-blogs
searchTitle (optional string): Filter blogs by titlelimit (optional number, default: 10): Maximum number of blogs to returnid: Blog IDtitle: Blog titlehandle: URL-friendly handletemplateSuffix: Template suffix for custom themescommentPolicy: Comment moderation policycreatedAt: Creation timestampupdatedAt: Last update timestampupdate-blog
blogId (string, required): The GID of the blog to update (e.g., "gid://shopify/Blog/1234567890")title (optional string): New blog titlehandle (optional string): New URL-friendly handletemplateSuffix (optional string): New template suffix for custom themescommentPolicy (optional string): New comment policy ("MODERATED" or "CLOSED")get-blog-by-id
blogId (string, required): The GID of the blog to fetchid: Blog IDtitle: Blog titlehandle: URL-friendly handletemplateSuffix: Template suffixcommentPolicy: Comment policyarticles: Recent articles (first 5)get-articles
blogId (string, required): The GID of the blog to get articles fromsearchTitle (optional string): Filter articles by titlelimit (optional number, default: 10): Maximum number of articles to returnid: Article IDtitle: Article titlehandle: URL-friendly handleauthor: Author informationpublishedAt: Publication datetags: Associated tagsimage: Featured image (if any)create-article
blogId (string, required): The GID of the blog to create the article intitle (string, required): The title of the articlecontent (string, required): The content of the article in HTML formatauthor (object, required):
name (string, required): The name of the article's authorpublished (optional boolean): Whether to publish immediately (default: false)tags (optional array of strings): Tags to categorize the articleid: Article IDtitle: Article titlehandle: URL-friendly handle (auto-generated from title)body: Article contentsummary: Article summary (if provided)author: Author informationtags: Associated tagsimage: Featured image details (if provided)// Create a published article with formatted content { "blogId": "gid://shopify/Blog/123456789", "title": "My New Article", "content": "<p>Article content with <strong>HTML formatting</strong>.</p>", "author": { "name": "John Doe" }, "published": true, "tags": ["news", "updates"] } // Create a draft article with future publication { "blogId": "gid://shopify/Blog/123456789", "title": "Upcoming Article", "content": "<p>Draft content...</p>", "author": { "name": "Jane Smith" }, "published": false, "tags": ["draft"] }
update-article
articleId (string, required): The GID of the article to updatetitle (optional string): New article titlebody (optional string): New article contentsummary (optional string): New article summarytags (optional array of strings): New article tagsauthor (optional object): Author information
name (string): Author's nameget-article-by-id
articleId (string, required): The GID of the article to fetchid: Article IDtitle: Article titlehandle: URL-friendly handleauthor: Author informationbody: Article contentblog: Parent blog informationtags: Associated tagsWorking with Blog Content
get-blogs first to obtain valid blog IDsget-blog-by-id to fetch detailed information about a specific blogcommentPolicy can only be set to "MODERATED" or "CLOSED"Working with Articles
get-articles to list articles within a specific blogbody field supports HTML contentBest Practices for Article Creation
<p>, <h2>, <ul>, etc.)published: false to save without publishingArticle Creation Tips
<p>First paragraph with <strong>bold text</strong>.</p> <h2>Section Heading</h2> <ul> <li>List item one</li> <li>List item two</li> </ul>
"tags": ["product-updates", "how-to", "tips"]
{ "published": false, // other fields... }
"author": { "name": "Full Author Name" }
search-shopify
query (string, required): The search query to find content across the storetypes (optional array of strings): Types of resources to search for. Available types:
first (optional number, default: 10, max: 50): Number of results to returnid: Resource IDtitle: Resource titletype: Resource typeurl: Resource URL// Search for articles and blogs about "kawaii" { "query": "kawaii", "types": ["ARTICLE", "BLOG"], "first": 5 } // Search across all content types { "query": "new collection", "first": 10 }
get-pages
searchTitle (optional string): Filter pages by titlelimit (optional number, default: 10): Maximum number of pages to returnid: Page IDtitle: Page titlehandle: URL-friendly handlebody: Page contentbodySummary: Content summarycreatedAt: Creation timestampupdatedAt: Last update timestampupdate-page
pageId (string, required): The GID of the page to update (e.g., "gid://shopify/Page/1234567890")title (optional string): New page titlebody (optional string): New page contentbodyHtml (optional string): New HTML contentseo (optional object): SEO settings
title (optional string): SEO titledescription (optional string): SEO descriptionpublished (optional boolean): Whether the page is published// Update page content and SEO { "pageId": "gid://shopify/Page/123456789", "title": "About Our Store", "bodyHtml": "<h1>Welcome!</h1><p>Learn about our story...</p>", "seo": { "title": "About Us - Kawaii Store", "description": "Discover our journey in bringing kawaii culture to you" } }
get-collections
searchTitle (optional string): Filter collections by titlelimit (optional number, default: 10): Maximum number of collections to returnid: Collection IDtitle: Collection titlehandle: URL-friendly handledescription: Collection descriptiondescriptionHtml: HTML-formatted descriptionupdatedAt: Last update timestampproductsCount: Number of products in collectionupdate-collection
collectionId (string, required): The GID of the collection to updatetitle (optional string): New collection titledescription (optional string): New collection descriptiondescriptionHtml (optional string): New HTML descriptionseo (optional object): SEO settings
title (optional string): SEO titledescription (optional string): SEO description// Update collection with SEO optimization { "collectionId": "gid://shopify/Collection/123456789", "title": "Summer Kawaii Collection", "descriptionHtml": "<p>Discover our cutest summer items!</p>", "seo": { "title": "Summer Kawaii Collection 2025", "description": "Explore our adorable summer collection featuring..." } }
get-products
searchTitle (optional string): Filter products by titlelimit (optional number, default: 10): Maximum number of products to returnid: Product IDtitle: Product titlehandle: URL-friendly handledescription: Product descriptiondescriptionHtml: HTML-formatted descriptionstatus: Product statustotalInventory: Total inventory countpriceRange: Product price rangeimages: Product imagesget-product-by-id
productId (string, required): The GID of the product to fetchid: Product IDtitle: Product titlehandle: URL-friendly handledescription: Product descriptiondescriptionHtml: HTML-formatted descriptionstatus: Product statustotalInventory: Total inventory countvariants: Product variantsimages: Product imagescollections: Associated collectionsupdate-product
productId (string, required): The GID of the product to updatetitle (optional string): New product titledescriptionHtml (optional string): New HTML descriptionid: Product IDtitle: Updated titledescriptionHtml: Updated descriptionupdatedAt: Update timestampSEO Optimization
Content Organization
Performance Considerations
Content Management Tips
All tools include comprehensive error handling:
Error responses include:
Rate Limits
Content Restrictions
Authentication