shopify-mcp-server
v1.0.1
Published
MCP Server for Shopify API, enabling interaction with store data through GraphQL API.
Readme
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- Get products from your Shopify store
- Inputs:
searchTitle(optional string): Filter products by titlelimit(number): Maximum number of products to return
- Returns: Formatted product details including:
- Title, description, handle
- Variants with prices, SKUs, and inventory policies
get-customers- Retrieve customer information
- Inputs:
limit(optional number): Maximum number of customers to returnnext(optional string): Pagination cursor for next page
- Returns: Customer data in JSON format
tag-customer- Add tags to a customer
- Inputs:
customerId(string): ID of the customer to tagtags(array of strings): Tags to add to the customer
- Returns: Success or failure message
get-orders- Fetch and filter orders
- Inputs:
first(optional number): Number of orders to returnafter(optional string): Pagination cursorquery(optional string): Filter querysortKey(optional enum): Sort field ('PROCESSED_AT', 'TOTAL_PRICE', 'ID', 'CREATED_AT', 'UPDATED_AT', 'ORDER_NUMBER')reverse(optional boolean): Reverse sort order
- Returns: Formatted order details including:
- Order ID and status
- Financial information
- Customer details
- Shipping information
- Line items with variants
Setup
Shopify Access Token
To use this MCP server, you'll need to create a custom app in your Shopify store:
- 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_productsread_customers,write_customersread_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. More details on how to create a Shopify app can be found here.
Usage with Claude Desktop
Add 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
.envfile:
SHOPIFY_ACCESS_TOKEN=your_access_token
MYSHOPIFY_DOMAIN=your-store.myshopify.com- Build the project:
npm run build- Run tests:
npm testDependencies
- @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
Built with ❤️ using the Model Context Protocol
