Shopify MCP server

Integrates with Shopify's GraphQL API to enable comprehensive store management, including product, customer, order, and discount operations.
Back to servers
Provider
Amir Bengherbi
Release date
Jan 27, 2025
Language
TypeScript
Package
Stats
970 downloads
8 stars

This MCP server enables interaction with Shopify store data through GraphQL API, providing tools for managing products, customers, orders, and more via a standardized protocol that AI assistants can use.

Getting Started with Shopify MCP Server

Prerequisites

Before using this server, you'll need to create a custom app in your Shopify store to obtain an access token:

  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

Installation and Configuration

To use the Shopify MCP Server with Claude Desktop, add the following to your claude_desktop_config.json file:

{
  "mcpServers": {
    "shopify": {
      "command": "npx",
      "args": ["-y", "shopify-mcp-server"],
      "env": {
        "SHOPIFY_ACCESS_TOKEN": "<YOUR_ACCESS_TOKEN>",
        "MYSHOPIFY_DOMAIN": "<YOUR_SHOP>.myshopify.com"
      }
    }
  }
}

Replace <YOUR_ACCESS_TOKEN> with the token you generated in the prerequisites and <YOUR_SHOP> with your Shopify store name.

Available Tools

Product Management

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 IDs:

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

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 Management

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 Management

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

Discount Management

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

Draft Order Management

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

Collection Management

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

Shop Information

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

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