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
Prerequisites
- Node.js (version 16 or higher)
- Shopify Custom App Access Token (see setup instructions below)
Installation
Clone the Repository:
git clone https://github.com/pashpashpash/shopify-mcp-server.git cd shopify-mcp-server
Install Dependencies:
npm install
Build the Project:
npm run build
Shopify Setup
Creating a Custom App
- From your Shopify admin, go to Settings > Apps and sales channels
- Click Develop apps (you may need to enable developer preview first)
- Click Create an app
- Set a name for your app (e.g., "Shopify MCP Server")
- Click Configure Admin API scopes
- Select the following scopes:
read_products
,write_products
read_customers
,write_customers
read_orders
,write_orders
- Click Save
- Click Install app
- Click Install to give the app access to your store data
- After installation, you'll see your Admin API access token
- Copy this token - you'll need it for configuration
Note: Store your access token securely. It provides access to your store data and should never be shared or committed to version control.
Configuration
Create Environment File:Create a
.env
file in the project root:SHOPIFY_ACCESS_TOKEN=your_access_token MYSHOPIFY_DOMAIN=your-store.myshopify.com
Configure Claude Desktop:
Add this to your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"shopify": {
"command": "node",
"args": ["path/to/shopify-mcp-server/dist/index.js"],
"env": {
"SHOPIFY_ACCESS_TOKEN": "your_access_token",
"MYSHOPIFY_DOMAIN": "your-store.myshopify.com"
}
}
}
}
Note: Replace "path/to/shopify-mcp-server" with the actual path to your cloned repository.
Available Tools
Product Management
get-products
- Get all products or search by title
- Inputs:
searchTitle
(optional string): Filter products by titlelimit
(number): Maximum number of products to return
get-products-by-collection
- Get products from a specific collection
- Inputs:
collectionId
(string): ID of the collectionlimit
(optional number, default: 10): Maximum products to return
get-products-by-ids
- Get products by their IDs
- Inputs:
productIds
(array of strings): Array of product IDs to retrieve
get-variants-by-ids
- Get product variants by their IDs
- Inputs:
variantIds
(array of strings): Array of variant IDs to retrieve
Customer Management
get-customers
- Get shopify customers with pagination
- Inputs:
limit
(optional number): Maximum customers to returnnext
(optional string): Next page cursor
tag-customer
- Add tags to a customer
- Inputs:
customerId
(string): Customer ID to tagtags
(array of strings): Tags to add
Order Management
get-orders
- Get orders with advanced filtering
- Inputs:
first
(optional number): Limit of orders to returnafter
(optional string): Next page cursorquery
(optional string): Filter querysortKey
(optional enum): Sort fieldreverse
(optional boolean): Reverse sort
get-order
- Get a single order by ID
- Inputs:
orderId
(string): ID of the order
create-draft-order
- Create a draft order
- Inputs:
lineItems
(array): Items with variantId and quantityemail
(string): Customer emailshippingAddress
(object): Shipping detailsnote
(optional string): Optional note
complete-draft-order
- Complete a draft order
- Inputs:
draftOrderId
(string): ID of draft ordervariantId
(string): ID of variant
Discount Management
create-discount
- Create a basic discount code
- Inputs:
title
(string): Discount titlecode
(string): Discount codevalueType
(enum): 'percentage' or 'fixed_amount'value
(number): Discount valuestartsAt
(string): Start dateendsAt
(optional string): End dateappliesOncePerCustomer
(boolean): Once per customer flag
Collection Management
get-collections
- Get all collections
- Inputs:
limit
(optional number, default: 10)name
(optional string): Filter by name
Shop Information
get-shop
- Get basic shop details
- No inputs required
get-shop-details
- Get extended shop details
- No inputs required
Webhook Management
manage-webhook
- Manage webhooks
- Inputs:
action
(enum): 'subscribe', 'find', 'unsubscribe'callbackUrl
(string): Webhook URLtopic
(enum): Webhook topicwebhookId
(optional string): Required for unsubscribe
Debugging
If you run into issues, check Claude Desktop's MCP logs:
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
Common issues:
Authentication Errors:
- Verify your Shopify access token
- Check your shop domain format
- Ensure all required API scopes are enabled
API Errors:
- Check rate limits
- Verify input formats
- Ensure required fields are provided
Development
# Install dependencies
npm install
# 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
License
MIT
Note: This is a fork of the [original shopify-mcp-server repository](https://github.com/rezapex/shopify-mcp-server-main