我为 Shopify 和 Stripe 的写操作构建了 MCP 服务器——没人填补的空白

发布: (2026年3月18日 GMT+8 09:44)
3 分钟阅读
原文: Dev.to

Source: Dev.to

它的功能

npx mcp-ecom-hub

一个完整类型化的 MCP 服务器,覆盖了其他工具没有的功能。

Shopify — 写操作

  • shopify_update_product — 更新标题、价格、库存
  • shopify_bulk_update_prices — 一次性更新多个变体的价格
  • shopify_fulfill_order — 将订单标记为已完成
  • shopify_cancel_order — 一次调用完成取消并退款
  • shopify_create_discount — 生成折扣码

Shopify — 读操作

  • shopify_get_orders — 带过滤条件(状态、日期、客户)
  • shopify_get_products — 完整的产品 + 变体信息
  • shopify_get_analytics — 收入、客单价 (AOV)、转化率
  • shopify_get_customers — 客户列表 + 生命周期价值 (LTV)

Stripe

  • stripe_get_revenue — MRR、ARR、按周期细分
  • stripe_list_subscriptions — 活跃订阅
  • stripe_cancel_subscription — 包含比例分摊处理
  • stripe_create_coupon — 折扣码
  • stripe_get_payouts — 支付历史
  • stripe_refund_payment — 发起退款

多店铺

  • hub_list_stores — 所有已配置的店铺
  • hub_get_overview — 跨店铺收入概览

它填补的空白

Featuremcp‑ecom‑hubShopify MCP (official)pipeboard
Shopify write ops
Bulk price update
Stripe integrated
Subscription mgmt
Multi‑store
Self‑hosted
Open source

安装配置

{
  "mcpServers": {
    "ecom-hub": {
      "command": "npx",
      "args": ["-y", "mcp-ecom-hub"],
      "env": {
        "MCP_ECOM_CONFIG": "/path/to/stores.json"
      }
    }
  }
}

配置文件 (stores.json)

{
  "stores": [
    {
      "id": "mystore",
      "name": "My Store",
      "shopify": {
        "domain": "mystore.myshopify.com",
        "accessToken": "shpat_xxx"
      },
      "stripe": {
        "secretKey": "sk_live_xxx"
      }
    }
  ],
  "defaultStore": "mystore"
}

安全第一

破坏性操作(取消、退款)需要明确确认:

User: Cancel order #1234 and refund the customer
Agent: I'll cancel order #1234 ($89.00) and issue a full refund. Confirm? [yes/no]
User: yes
Agent: ✅ Order cancelled. Refund of $89.00 issued — arrives in 5‑10 days.

避免意外取消。

多店铺

运营一家拥有多个客户的代理机构?一份配置,全部店铺:

User: Show me revenue across all stores this week
Agent:
  - Store A: €2,340 (12 orders, AOV €195)
  - Store B: €890 (8 orders, AOV €111)
  - Total: €3,230

链接

开源,MIT 许可证。为管理多个电商客户的代理机构而构建。欢迎提交 PR——尤其是对 WooCommerce 的支持(下一个目标)。

0 浏览
Back to Blog

相关文章

阅读更多 »