S

Shopify店铺管理平台

通过GraphQL API启用与Shopify商店数据的交互,支持产品、客户和订单管理,并具有全面的错误处理功能。

ecommerce-and-retail

523 查看 · 2026-07-07 更新

简介

通过GraphQL API启用与Shopify商店数据的交互,支持产品、客户和订单管理,并具有全面的错误处理功能。

简介

通过GraphQL API启用与Shopify商店数据的交互,支持产品、客户和订单管理,并具有全面的错误处理功能。

Shopify MCP 服务器

用于 Shopify API 的 MCP 服务器,通过 GraphQL API 实现与商店数据的交互。此服务器提供了管理产品、客户、订单等功能的工具。

Shopify Server MCP server

功能

  • 产品管理:搜索和检索产品信息
  • 客户管理:加载客户数据并管理客户标签
  • 订单管理:高级订单查询和过滤
  • GraphQL 集成:直接与 Shopify 的 GraphQL Admin API 集成
  • 全面的错误处理:对 API 和认证问题提供清晰的错误消息

工具

# Shopify MCP 服务器 用于 Shopify API 的 MCP 服务器,通过 GraphQL API 实现与商店数据的交互。此服务器提供了管理产品、客户、订单等功能的工具。 <a href="https://glama.ai/mcp/servers/bemvhpy885"><img width="380" height="200" src="https://glama.ai/mcp/servers/bemvhpy885/badge" alt="Shopify Server MCP server" /></a> ## 功能 * **产品管理**:搜索和检索产品信息 * **客户管理**:加载客户数据并管理客户标签 * **订单管理**:高级订单查询和过滤 * **GraphQL 集成**:直接与 Shopify 的 GraphQL Admin API 集成 * **全面的错误处理**:对 API 和认证问题提供清晰的错误消息 ## 工具
  1. get-products

    • Get all products or search 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
  2. get-products-by-collection

    • Get 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
  3. get-products-by-ids

    • Get products by their IDs
    • Inputs:
      • productIds (array of strings): Array of product IDs to retrieve
    • Returns: Formatted product details for the specified products
  4. get-variants-by-ids

    • Get product variants by their IDs
    • Inputs:
      • variantIds (array of strings): Array of variant IDs to retrieve
    • Returns: Detailed variant information including product details
  5. get-customers

    • Get 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
  6. tag-customer

    • Add 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
  7. get-orders

    • Get 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
  8. get-order

    • Get a single order by ID
    • Inputs:
      • orderId (string): ID of the order to retrieve
    • Returns: Detailed order information
  9. create-discount

    • Create 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
  10. 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
  11. 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
  12. 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
  13. get-shop

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

    • Get extended shop details including shipping countries
    • Inputs: None
    • Returns: Extended shop information including shipping countries
  15. 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

设置

Shopify 访问令牌

要使用此 MCP 服务器,您需要在您的 Shopify 商店中创建一个自定义应用:

  1. 从您的 Shopify 管理后台进入 设置 > 应用程序和销售渠道
  2. 点击 开发应用(您可能需要先启用开发者预览)
  3. 点击 创建一个应用
  4. 为您的应用设置一个名称(例如:“Shopify MCP 服务器”)
  5. 点击 配置 Admin API 权限范围
  6. 选择以下权限范围:
    • read_products, write_products
    • read_customers, write_customers
    • read_orders, write_orders
  7. 点击 保存
  8. 点击 安装应用
  9. 点击 安装 以授予该应用访问您的商店数据的权限
  10. 安装后,您将看到您的 Admin API 访问令牌
  11. 复制此令牌 - 您将在配置时需要用到它

注意:请安全地存储您的访问令牌。它提供了对您商店数据的访问权限,不应被分享或提交到版本控制中。 有关如何创建 Shopify 应用的更多详细信息,请参阅这里

与 Claude Desktop 结合使用

在您的 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" } } } }

开发

  1. 克隆仓库
  2. 安装依赖项:
npm install
  1. 创建 .env 文件:
SHOPIFY_ACCESS_TOKEN=your_access_token MYSHOPIFY_DOMAIN=your-store.myshopify.com
  1. 构建项目:
npm run build
  1. 运行测试:
npm test

依赖项

  • @modelcontextprotocol/sdk - MCP 协议实现
  • graphql-request - 用于 Shopify API 的 GraphQL 客户端
  • zod - 运行时类型验证

贡献

欢迎贡献!请首先阅读我们的贡献指南

许可证

MIT

社区


使用 ❤️ 和 模型上下文协议 构建

工具列表

  • get-products: Get all products or search by title

  • get-products-by-collection: Get products from a specific collection

  • get-products-by-ids: Get products by their IDs

  • get-variants-by-ids: Get product variants by their IDs

  • get-customers: Get shopify customers with pagination support

  • tag-customer: Add tags to a customer

  • get-orders: Get shopify orders with advanced filtering and sorting

  • get-order: Get a single order by ID

  • create-discount: Create a basic discount code

  • create-draft-order: Create a draft order

  • complete-draft-order: Complete a draft order

  • get-collections: Get all collections

  • get-shop: Get shop details

  • get-shop-details: Get extended shop details including shipping countries

  • manage-webhook: Subscribe, find, or unsubscribe webhooks

服务配置

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

来源