shopify mcp server

Local 2025-08-31 23:18:09 0

Enables interaction with Shopify store data using the GraphQL API, supporting product, customer, and order management with comprehensive error handling.


MCP Server for Shopify API, enabling interaction with store data through GraphQL API. This server provides tools for managing products, customers, orders, and more.

Shopify Server MCP server

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

  1. get-products
  2. Get all products or search by title
  3. Inputs:
    • searchTitle (optional string): Filter products by title
    • limit (number): Maximum number of products to return
  4. Returns: Formatted product details including title, description, handle, and variants

  5. get-products-by-collection

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

  9. get-products-by-ids

  10. Get products by their IDs
  11. Inputs:
    • productIds (array of strings): Array of product IDs to retrieve
  12. Returns: Formatted product details for the specified products

  13. get-variants-by-ids

  14. Get product variants by their IDs
  15. Inputs:
    • variantIds (array of strings): Array of variant IDs to retrieve
  16. Returns: Detailed variant information including product details

  17. get-customers

  18. Get shopify customers with pagination support
  19. Inputs:
    • limit (optional number): Maximum number of customers to return
    • next (optional string): Next page cursor
  20. Returns: Customer data in JSON format

  21. tag-customer

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

  25. get-orders

  26. Get orders with advanced filtering and sorting
  27. 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
  28. Returns: Formatted order details

  29. get-order

  30. Get a single order by ID
  31. Inputs:
    • orderId (string): ID of the order to retrieve
  32. Returns: Detailed order information

  33. create-discount

  34. Create a basic discount code
  35. 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
  36. Returns: Created discount details

  37. create-draft-order

    • Create 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
  38. complete-draft-order

    • Complete 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
  39. get-collections

    • Get all collections
    • Inputs:
    • limit (optional number, default: 10): Maximum number of collections to return
    • name (optional string): Filter collections by name
    • Returns: Collection details
  40. get-shop

    • Get shop details
    • Inputs: None
    • Returns: Basic shop information
  41. get-shop-details

    • Get extended shop details including shipping countries
    • Inputs: None
    • Returns: Extended shop information including shipping countries
  42. manage-webhook

    • Subscribe, find, or unsubscribe 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

Setup

Shopify Access Token

To use this MCP server, you'll 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:
  7. read_products, write_products
  8. read_customers, write_customers
  9. read_orders, write_orders
  10. Click Save
  11. Click Install app
  12. Click Install to give the app access to your store data
  13. After installation, you'll see your Admin API access token
  14. 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

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Create a .env file:
    SHOPIFY_ACCESS_TOKEN=your_access_token
    MYSHOPIFY_DOMAIN=your-store.myshopify.com
  4. Build the project:
    npm run build
  5. Run tests:
    npm test

Dependencies

  • @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

[
  {
    "description": "Get all products or search by title",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "limit": {
          "description": "Maximum number of products to return",
          "type": "number"
        },
        "searchTitle": {
          "description": "Search title, if missing, will return all products",
          "type": "string"
        }
      },
      "required": [
        "limit"
      ],
      "type": "object"
    },
    "name": "get-products"
  },
  {
    "description": "Get products from a specific collection",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "collectionId": {
          "description": "ID of the collection to get products from",
          "type": "string"
        },
        "limit": {
          "default": 10,
          "description": "Maximum number of products to return",
          "type": "number"
        }
      },
      "required": [
        "collectionId"
      ],
      "type": "object"
    },
    "name": "get-products-by-collection"
  },
  {
    "description": "Get products by their IDs",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "productIds": {
          "description": "Array of product IDs to retrieve",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "productIds"
      ],
      "type": "object"
    },
    "name": "get-products-by-ids"
  },
  {
    "description": "Get product variants by their IDs",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "variantIds": {
          "description": "Array of variant IDs to retrieve",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "variantIds"
      ],
      "type": "object"
    },
    "name": "get-variants-by-ids"
  },
  {
    "description": "Get shopify customers with pagination support",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "limit": {
          "description": "Limit of customers to return",
          "type": "number"
        },
        "next": {
          "description": "Next page cursor",
          "type": "string"
        }
      },
      "type": "object"
    },
    "name": "get-customers"
  },
  {
    "description": "Add tags to a customer",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "customerId": {
          "description": "Customer ID to tag",
          "type": "string"
        },
        "tags": {
          "description": "Tags to add to the customer",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "customerId",
        "tags"
      ],
      "type": "object"
    },
    "name": "tag-customer"
  },
  {
    "description": "Get shopify orders with advanced filtering and sorting",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "after": {
          "description": "Next page cursor",
          "type": "string"
        },
        "first": {
          "description": "Limit of orders to return",
          "type": "number"
        },
        "query": {
          "description": "Filter orders using query syntax",
          "type": "string"
        },
        "reverse": {
          "description": "Reverse sort order",
          "type": "boolean"
        },
        "sortKey": {
          "description": "Field to sort by",
          "enum": [
            "PROCESSED_AT",
            "TOTAL_PRICE",
            "ID",
            "CREATED_AT",
            "UPDATED_AT",
            "ORDER_NUMBER"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "name": "get-orders"
  },
  {
    "description": "Get a single order by ID",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "orderId": {
          "description": "ID of the order to retrieve",
          "type": "string"
        }
      },
      "required": [
        "orderId"
      ],
      "type": "object"
    },
    "name": "get-order"
  },
  {
    "description": "Create a basic discount code",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "appliesOncePerCustomer": {
          "description": "Whether discount can be used only once per customer",
          "type": "boolean"
        },
        "code": {
          "description": "Discount code that customers will enter",
          "type": "string"
        },
        "endsAt": {
          "description": "Optional end date in ISO format",
          "type": "string"
        },
        "startsAt": {
          "description": "Start date in ISO format",
          "type": "string"
        },
        "title": {
          "description": "Title of the discount",
          "type": "string"
        },
        "value": {
          "description": "Discount value (percentage as decimal or fixed amount)",
          "type": "number"
        },
        "valueType": {
          "description": "Type of discount",
          "enum": [
            "percentage",
            "fixed_amount"
          ],
          "type": "string"
        }
      },
      "required": [
        "title",
        "code",
        "valueType",
        "value",
        "startsAt",
        "appliesOncePerCustomer"
      ],
      "type": "object"
    },
    "name": "create-discount"
  },
  {
    "description": "Create a draft order",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "email": {
          "description": "Customer email",
          "format": "email",
          "type": "string"
        },
        "lineItems": {
          "description": "Line items to add to the order",
          "items": {
            "additionalProperties": false,
            "properties": {
              "quantity": {
                "type": "number"
              },
              "variantId": {
                "type": "string"
              }
            },
            "required": [
              "variantId",
              "quantity"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "note": {
          "description": "Optional note for the order",
          "type": "string"
        },
        "shippingAddress": {
          "additionalProperties": false,
          "description": "Shipping address details",
          "properties": {
            "address1": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "country": {
              "type": "string"
            },
            "countryCode": {
              "type": "string"
            },
            "firstName": {
              "type": "string"
            },
            "lastName": {
              "type": "string"
            },
            "province": {
              "type": "string"
            },
            "zip": {
              "type": "string"
            }
          },
          "required": [
            "address1",
            "city",
            "province",
            "country",
            "zip",
            "firstName",
            "lastName",
            "countryCode"
          ],
          "type": "object"
        }
      },
      "required": [
        "lineItems",
        "email",
        "shippingAddress"
      ],
      "type": "object"
    },
    "name": "create-draft-order"
  },
  {
    "description": "Complete a draft order",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "draftOrderId": {
          "description": "ID of the draft order to complete",
          "type": "string"
        },
        "variantId": {
          "description": "ID of the variant in the draft order",
          "type": "string"
        }
      },
      "required": [
        "draftOrderId",
        "variantId"
      ],
      "type": "object"
    },
    "name": "complete-draft-order"
  },
  {
    "description": "Get all collections",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "limit": {
          "default": 10,
          "description": "Maximum number of collections to return",
          "type": "number"
        },
        "name": {
          "description": "Filter collections by name",
          "type": "string"
        }
      },
      "type": "object"
    },
    "name": "get-collections"
  },
  {
    "description": "Get shop details",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {},
      "type": "object"
    },
    "name": "get-shop"
  },
  {
    "description": "Get extended shop details including shipping countries",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {},
      "type": "object"
    },
    "name": "get-shop-details"
  },
  {
    "description": "Subscribe, find, or unsubscribe webhooks",
    "inputSchema": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "additionalProperties": false,
      "properties": {
        "action": {
          "description": "Action to perform with webhook",
          "enum": [
            "subscribe",
            "find",
            "unsubscribe"
          ],
          "type": "string"
        },
        "callbackUrl": {
          "description": "Webhook callback URL",
          "format": "uri",
          "type": "string"
        },
        "topic": {
          "description": "Webhook topic to subscribe to",
          "enum": [
            "orders/updated"
          ],
          "type": "string"
        },
        "webhookId": {
          "description": "Webhook ID (required for unsubscribe)",
          "type": "string"
        }
      },
      "required": [
        "action",
        "callbackUrl",
        "topic"
      ],
      "type": "object"
    },
    "name": "manage-webhook"
  }
]