shopify-mcp-server
by: amir-bengherbi
MCP Server for Shopify API
📌Overview
Purpose: The Shopify MCP Server is designed to facilitate interaction with Shopify store data through a robust GraphQL API, enabling effective management of products, customers, orders, and more.
Overview: This server acts as an integration tool that allows developers to seamlessly connect with Shopify's GraphQL Admin API, providing a comprehensive suite for the management of various store elements including products, customers, and orders, while ensuring strong error handling and intuitive querying capabilities.
Key Features:
-
Product Management: Enables searching and retrieving product information, helping users manage inventory effectively.
-
Customer Management: Allows loading customer data and managing tags, which aids in maintaining customer relationships and segmentation.
-
Order Management: Supports advanced querying and filtering of orders, providing detailed insights into sales and customer transactions.
-
GraphQL Integration: Directly integrates with Shopify's GraphQL Admin API, streamlining the data retrieval process.
-
Comprehensive Error Handling: Offers clear error messages for API and authentication issues, enhancing the user experience and troubleshooting process.
Shopify MCP Server
MCP Server for Shopify API, enabling interaction with store data through GraphQL API. This server provides tools for managing products, customers, orders, and more.
Features
- Product Management: Search and retrieve product information
- Customer Management: Load customer data and manage customer tags
- Order Management: Advanced order querying and filtering
- GraphQL Integration: Direct integration with Shopify's GraphQL Admin API
- Comprehensive Error Handling: Clear error messages for API and authentication issues
Tools
-
get-products
Retrieve all products or search by title.
Inputs:searchTitle
(optional string): Filter products by titlelimit
(number): Maximum number of products to return
Returns: Formatted product details including title, description, handle, and variants
-
get-products-by-collection
Retrieve products from a specific collection.
Inputs:collectionId
(string): ID of the collectionlimit
(optional number, default: 10): Maximum number of products
Returns: Formatted product details from the specified collection
-
get-products-by-ids
Retrieve products by their IDs.
Inputs:productIds
(array of strings): Product IDs to retrieve
Returns: Formatted product details for specified products
-
get-variants-by-ids
Retrieve product variants by their IDs.
Inputs:variantIds
(array of strings): Variant IDs to retrieve
Returns: Detailed variant information including product details
-
get-customers
Retrieve Shopify customers with pagination support.
Inputs:limit
(optional number): Maximum customers to returnnext
(optional string): Next page cursor
Returns: Customer data in JSON format
-
tag-customer
Add tags to a customer.
Inputs:customerId
(string): Customer IDtags
(array of strings): Tags to add
Returns: Success or failure message
-
get-orders
Retrieve orders with advanced filtering and sorting.
Inputs:first
(optional number): Limit on ordersafter
(optional string): Next page cursorquery
(optional string): Filter querysortKey
(optional enum): Sort field ('PROCESSED_AT', 'TOTAL_PRICE', 'ID', 'CREATED_AT', 'UPDATED_AT', 'ORDER_NUMBER')reverse
(optional boolean): Reverse order
Returns: Formatted order details
-
get-order
Retrieve a single order by ID.
Inputs:orderId
(string): Order ID
Returns: Detailed order information
-
create-discount
Create a discount code.
Inputs:title
(string): Discount titlecode
(string): Discount codevalueType
(enum): Discount type ('percentage' or 'fixed_amount')value
(number): Discount valuestartsAt
(string): Start date ISOendsAt
(optional string): End date ISOappliesOncePerCustomer
(boolean): Single-use flag
Returns: Created discount details
-
create-draft-order
Create a draft order.
Inputs:lineItems
(array): Items with variantId and quantityemail
(string): Customer emailshippingAddress
(object): Shipping addressnote
(optional string): Optional note
Returns: Created draft order details
-
complete-draft-order
Complete a draft order.
Inputs:draftOrderId
(string): Draft order IDvariantId
(string): Variant ID
Returns: Completed order details
-
get-collections
Retrieve all collections.
Inputs:limit
(optional number, default: 10): Maximum collectionsname
(optional string): Filter by name
Returns: Collection details
-
get-shop
Retrieve shop details.
Inputs: None
Returns: Basic shop information -
get-shop-details
Retrieve extended shop details including shipping countries.
Inputs: None
Returns: Extended shop information -
manage-webhook
Manage webhooks (subscribe, find, unsubscribe).
Inputs:action
(enum): 'subscribe', 'find', or 'unsubscribe'callbackUrl
(string): Webhook URLtopic
(enum): Webhook topicwebhookId
(optional string): Webhook ID (for unsubscribe)
Returns: Webhook details or success message
Setup
Shopify Access Token
To use this MCP server, create a custom app in your Shopify store:
- From Shopify admin, go to Settings > Apps and sales channels
- Click Develop apps (enable developer preview if needed)
- Click Create an app
- Name your app (e.g., "Shopify MCP Server")
- Click Configure Admin API scopes
- Select scopes:
read_products
,write_products
read_customers
,write_customers
read_orders
,write_orders
- Save and click Install app
- Confirm installation
- Copy the Admin API access token
Store the token securely; do not share or commit it to version control.
More details on creating Shopify apps can be found here.
Usage with Claude Desktop
Add the following to your claude_desktop_config.json
:
{
"mcpServers": {
"shopify": {
"command": "npx",
"args": ["-y", "shopify-mcp-server"],
"env": {
"SHOPIFY_ACCESS_TOKEN": "<YOUR_ACCESS_TOKEN>",
"MYSHOPIFY_DOMAIN": "<YOUR_SHOP>.myshopify.com"
}
}
}
}
Development
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file:SHOPIFY_ACCESS_TOKEN=your_access_token MYSHOPIFY_DOMAIN=your-store.myshopify.com
- Build the project:
npm run build
- Run tests:
npm test
Dependencies
- @modelcontextprotocol/sdk - MCP protocol implementation
- graphql-request - GraphQL client for Shopify API
- zod - Runtime type validation
Contributing
Contributions are welcome! Please read our Contributing Guidelines first.
License
MIT
Community
- MCP GitHub Discussions: https://github.com/modelcontextprotocol/servers/discussions
- Report Issues: https://github.com/your-username/shopify-mcp-server/issues
Built with ❤️ using the Model Context Protocol