S

Shopify店铺管理平台

@amir-bengherbi/shopify-mcp-server
Hosted
0 Stars 539 次浏览 amir-bengherbi 更新于 2026-08-23

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

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "shopify": {
      "args": [
        "-y",
        "shopify-mcp-server"
      ],
      "command": "npx",
      "env": {
        "MYSHOPIFY_DOMAIN": "\u003cYOUR_SHOP\u003e.myshopify.com",
        "SHOPIFY_ACCESS_TOKEN": "\u003cYOUR_ACCESS_TOKEN\u003e"
      }
    }
  }
}

该服务需要配置环境变量:MYSHOPIFY_DOMAIN、SHOPIFY_ACCESS_TOKEN

可用工具 (15 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get-products 2 个参数 需填 1 项

Get all products or search by title

必填参数:limit

get-products-by-collection 2 个参数 需填 1 项

Get products from a specific collection

必填参数:collectionId

get-products-by-ids 1 个参数 需填 1 项

Get products by their IDs

必填参数:productIds

get-variants-by-ids 1 个参数 需填 1 项

Get product variants by their IDs

必填参数:variantIds

get-customers 2 个参数

Get shopify customers with pagination support

该工具无需必填参数,直接调用即可

tag-customer 2 个参数 需填 2 项

Add tags to a customer

必填参数:customerId、tags

get-orders 5 个参数

Get shopify orders with advanced filtering and sorting

该工具无需必填参数,直接调用即可

get-order 1 个参数 需填 1 项

Get a single order by ID

必填参数:orderId

create-discount 7 个参数 需填 6 项

Create a basic discount code

必填参数:title、code、valueType、value、startsAt、appliesOncePerCustomer

create-draft-order 4 个参数 需填 3 项

Create a draft order

必填参数:lineItems、email、shippingAddress

complete-draft-order 2 个参数 需填 2 项

Complete a draft order

必填参数:draftOrderId、variantId

get-collections 2 个参数

Get all collections

该工具无需必填参数,直接调用即可

get-shop

Get shop details

该工具无需必填参数,直接调用即可

get-shop-details

Get extended shop details including shipping countries

该工具无需必填参数,直接调用即可

manage-webhook 4 个参数 需填 3 项

Subscribe, find, or unsubscribe webhooks

必填参数:action、callbackUrl、topic

服务介绍

Shopify MCP 服务器

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

功能

  • 产品管理:搜索和检索产品信息
  • 客户管理:加载客户数据并管理客户标签
  • 订单管理:高级订单查询和过滤
  • 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

社区


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

相关 MCP 服务