The Shopify MCP Server enables interaction with Shopify store data through GraphQL API, providing tools for managing products, customers, orders, and more. It simplifies access to Shopify's Admin API with structured tools for common operations.
Before using the MCP server, you need to create a custom app in your Shopify store:
read_products
, write_products
read_customers
, write_customers
read_orders
, write_orders
Note: Store your access token securely. It provides access to your store data and should never be shared or committed to version control.
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"
}
}
}
}
Retrieves all products or searches by title
searchTitle
(optional string): Filter products by titlelimit
(number): Maximum number of products to returnRetrieves products from a specific collection
collectionId
(string): ID of the collection to get products fromlimit
(optional number, default: 10): Maximum number of products to returnRetrieves products by their specific IDs
productIds
(array of strings): Array of product IDs to retrieveUpdates the price of a product
productId
(string): ID of the product to updateprice
(string): New price for the productRetrieves product variants by their IDs
variantIds
(array of strings): Array of variant IDs to retrieveRetrieves Shopify customers with pagination support
limit
(optional number): Maximum number of customers to returnnext
(optional string): Next page cursorAdds tags to a customer
customerId
(string): Customer ID to tagtags
(array of strings): Tags to add to the customerRetrieves orders with advanced filtering and sorting
first
(optional number): Limit of orders to returnafter
(optional string): Next page cursorquery
(optional string): Filter orders using query syntaxsortKey
(optional enum): Field to sort by ('PROCESSED_AT', 'TOTAL_PRICE', 'ID', 'CREATED_AT', 'UPDATED_AT', 'ORDER_NUMBER')reverse
(optional boolean): Reverse sort orderRetrieves a single order by ID
orderId
(string): ID of the order to retrieveCreates a draft order
lineItems
(array): Array of items with variantId and quantityemail
(string): Customer emailshippingAddress
(object): Shipping address detailsnote
(optional string): Optional note for the orderCompletes a draft order
draftOrderId
(string): ID of the draft order to completevariantId
(string): ID of the variant in the draft orderCreates a basic discount code
title
(string): Title of the discountcode
(string): Discount code that customers will entervalueType
(enum): Type of discount ('percentage' or 'fixed_amount')value
(number): Discount value (percentage as decimal or fixed amount)startsAt
(string): Start date in ISO formatendsAt
(optional string): Optional end date in ISO formatappliesOncePerCustomer
(boolean): Whether discount can be used only once per customerRetrieves all collections
limit
(optional number, default: 10): Maximum number of collections to returnname
(optional string): Filter collections by nameRetrieves basic shop details
Retrieves extended shop details including shipping countries
Subscribes, finds, or unsubscribes webhooks
action
(enum): Action to perform ('subscribe', 'find', 'unsubscribe')callbackUrl
(string): Webhook callback URLtopic
(enum): Webhook topic to subscribe towebhookId
(optional string): Webhook ID (required for unsubscribe)To search for products with "shirt" in the title, limited to 5 results:
const products = await mcp.call("shopify", "get-products", {
searchTitle: "shirt",
limit: 5
});
console.log(products);
To add tags to a customer:
const result = await mcp.call("shopify", "tag-customer", {
customerId: "gid://shopify/Customer/1234567890",
tags: ["VIP", "Repeat Customer"]
});
console.log(result);
To create a 15% off discount code:
const discount = await mcp.call("shopify", "create-discount", {
title: "Summer Sale",
code: "SUMMER15",
valueType: "percentage",
value: 15,
startsAt: new Date().toISOString(),
endsAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(), // 30 days from now
appliesOncePerCustomer: true
});
console.log(discount);
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.