Shopify MCP server

Integrates with Shopify's GraphQL API to enable store data management through 16 specialized tools for handling products, customers, orders, collections, and webhooks.
Back to servers
Provider
Amir Bengherbi
Release date
Mar 18, 2025
Language
TypeScript
Stats
7 stars

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.

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

Installation and Setup

Getting a Shopify Access Token

Before using the MCP server, you need to create a custom app in your Shopify store:

  1. From your Shopify admin, go to Settings > Apps and sales channels
  2. Click Develop apps (you may need to enable developer preview first)
  3. Click Create an app
  4. Set a name for your app (e.g., "Shopify MCP Server")
  5. Click Configure Admin API scopes
  6. Select the following scopes:
    • read_products, write_products
    • read_customers, write_customers
    • read_orders, write_orders
  7. Click Save
  8. Click Install app
  9. Click Install to give the app access to your store data
  10. After installation, you'll see your Admin API access token
  11. 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.

Integration 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"
      }
    }
  }
}

Available Tools

Product Operations

Get Products

Retrieves all products or searches by title

  • Inputs:
    • searchTitle (optional string): Filter products by title
    • limit (number): Maximum number of products to return
  • Returns: Formatted product details including title, description, handle, and variants

Get Products by Collection

Retrieves products from a specific collection

  • Inputs:
    • collectionId (string): ID of the collection to get products from
    • limit (optional number, default: 10): Maximum number of products to return
  • Returns: Formatted product details from the specified collection

Get Products by IDs

Retrieves products by their specific IDs

  • Inputs:
    • productIds (array of strings): Array of product IDs to retrieve
  • Returns: Formatted product details for the specified products

Update Product Price

Updates the price of a product

  • Inputs:
    • productId (string): ID of the product to update
    • price (string): New price for the product
  • Returns: Response of the update operation

Get Variants by IDs

Retrieves product variants by their IDs

  • Inputs:
    • variantIds (array of strings): Array of variant IDs to retrieve
  • Returns: Detailed variant information including product details

Customer Operations

Get Customers

Retrieves Shopify customers with pagination support

  • Inputs:
    • limit (optional number): Maximum number of customers to return
    • next (optional string): Next page cursor
  • Returns: Customer data in JSON format

Tag Customer

Adds tags to a customer

  • Inputs:
    • customerId (string): Customer ID to tag
    • tags (array of strings): Tags to add to the customer
  • Returns: Success or failure message

Order Operations

Get Orders

Retrieves orders with advanced filtering and sorting

  • Inputs:
    • first (optional number): Limit of orders to return
    • after (optional string): Next page cursor
    • query (optional string): Filter orders using query syntax
    • sortKey (optional enum): Field to sort by ('PROCESSED_AT', 'TOTAL_PRICE', 'ID', 'CREATED_AT', 'UPDATED_AT', 'ORDER_NUMBER')
    • reverse (optional boolean): Reverse sort order
  • Returns: Formatted order details

Get Order

Retrieves a single order by ID

  • Inputs:
    • orderId (string): ID of the order to retrieve
  • Returns: Detailed order information

Create Draft Order

Creates a draft order

  • Inputs:
    • lineItems (array): Array of items with variantId and quantity
    • email (string): Customer email
    • shippingAddress (object): Shipping address details
    • note (optional string): Optional note for the order
  • Returns: Created draft order details

Complete Draft Order

Completes a draft order

  • Inputs:
    • draftOrderId (string): ID of the draft order to complete
    • variantId (string): ID of the variant in the draft order
  • Returns: Completed order details

Discount Operations

Create Discount

Creates a basic discount code

  • Inputs:
    • title (string): Title of the discount
    • code (string): Discount code that customers will enter
    • valueType (enum): Type of discount ('percentage' or 'fixed_amount')
    • value (number): Discount value (percentage as decimal or fixed amount)
    • startsAt (string): Start date in ISO format
    • endsAt (optional string): Optional end date in ISO format
    • appliesOncePerCustomer (boolean): Whether discount can be used only once per customer
  • Returns: Created discount details

Store Operations

Get Collections

Retrieves all collections

  • Inputs:
    • limit (optional number, default: 10): Maximum number of collections to return
    • name (optional string): Filter collections by name
  • Returns: Collection details

Get Shop

Retrieves basic shop details

  • Inputs: None
  • Returns: Basic shop information

Get Shop Details

Retrieves extended shop details including shipping countries

  • Inputs: None
  • Returns: Extended shop information including shipping countries

Webhook Management

Manage Webhook

Subscribes, finds, or unsubscribes webhooks

  • Inputs:
    • action (enum): Action to perform ('subscribe', 'find', 'unsubscribe')
    • callbackUrl (string): Webhook callback URL
    • topic (enum): Webhook topic to subscribe to
    • webhookId (optional string): Webhook ID (required for unsubscribe)
  • Returns: Webhook details or success message

Usage Examples

Example: Retrieving Products

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);

Example: Managing Customer Tags

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);

Example: Creating a Discount

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);

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later