Shopify + Brevo 集成
Shopify + Brevo
通过 MCP 将 Shopify 的商业数据连接到 Brevo 的互动平台。同步客户、触发购后序列、恢复弃置购物车并运行忠诚度营销活动, 全部由 Claude 中的 AI 代理协调完成。
使用的 MCP 服务器
| 服务器 | 包/URL | 用途 |
|---|---|---|
| Shopify Dev MCP | npx -y @shopify/dev-mcp@latest | 搜索 Shopify API 文档、内省 GraphQL 模式、验证查询 |
| Shopify Storefront MCP | 应用专属设置 | 产品目录、购物车操作、客户数据、订单追踪 |
| Brevo MCP | mcp.brevo.com/v1/brevo/mcp | 联系人、邮件营销活动、短信、WhatsApp、事件追踪 |
Tip
Shopify Dev MCP 用于开发阶段, 帮助 Claude 理解 Shopify 的 API。Storefront MCP 用于访问生产数据。开发期间通常两者都会用到,之后生产环境只需 Storefront MCP + Brevo MCP。
配置步骤
第一步:连接两个 MCP 服务器
添加到您的 Claude Desktop 或 Claude Code 配置文件:
{ "mcpServers": { "brevo": { "command": "npx", "args": [ "mcp-remote", "https://mcp.brevo.com/v1/brevo/mcp", "--header", "Authorization: Bearer ${BREVO_MCP_TOKEN}" ], "env": { "BREVO_MCP_TOKEN": "your-brevo-mcp-token" } }, "shopify-dev-mcp": { "command": "npx", "args": ["-y", "@shopify/dev-mcp@latest"] } }}第二步:验证连接
向 Claude 提问:
> Shopify 有哪些可用于读取客户数据的 API?> 我在 Brevo 中有多少个联系人?Claude 应为第一个问题使用 Shopify Dev MCP,为第二个问题使用 Brevo MCP。
用例一:客户同步代理
将 Shopify 客户与完整购买历史同步到 Brevo 联系人:
---name: shopify-customer-syncdescription: Sync Shopify customers to Brevo contacts with purchase dataversion: 1.0.0temperature: 0.1tools: - shopify-dev-mcp - brevo_contacts - brevo_attributes - brevo_liststriggers: - schedule: "0 */6 * * *" - event: customer_created - event: order_completed---
# Shopify Customer Sync Agent
Synchronize customer data from Shopify to Brevo contacts.
## Strategy
1. Query Shopify for customers updated since last sync2. For each customer, create or update Brevo contact with: - Email, name, phone - Total orders, total spend (as Brevo attributes) - Last order date - Tags and segments3. Add customers to appropriate Brevo lists based on behavior: - New customers → "Welcome Series" list - Repeat buyers → "Loyal Customers" list - High-value (>$500 LTV) → "VIP" list
## Field Mapping
| Shopify Field | Brevo Attribute ||--------------|-----------------|| email | EMAIL || first_name | FIRSTNAME || last_name | LASTNAME || phone | SMS || orders_count | ORDER_COUNT || total_spent | TOTAL_SPENT || last_order_date | LAST_ORDER || tags | SHOPIFY_TAGS || accepts_marketing | OPT_IN |
## Rules- ONLY sync customers who have accepted marketing- NEVER overwrite Brevo data if Shopify field is empty- ALWAYS validate phone numbers to E.164 format before sync- Track sync events for debugging: shopify_sync_success, shopify_sync_error用例二:购后营销活动代理
基于订单数据触发个性化购后序列:
---name: shopify-post-purchasedescription: Orchestrate post-purchase email sequences based on Shopify order dataversion: 1.0.0temperature: 0.3tools: - shopify-dev-mcp - brevo_contacts - brevo_email_campaign_management - brevo_templates - brevo_sms_campaignstriggers: - event: order_completed---
# Post-Purchase Agent
When a Shopify order is completed, design and trigger theappropriate follow-up sequence in Brevo.
## Sequence Logic
### First-Time Buyers1. Immediate: Order confirmation (transactional)2. Day 3: Welcome email with brand story3. Day 7: Product care tips / how-to guide4. Day 14: Review request5. Day 30: Cross-sell based on purchased category
### Repeat Buyers1. Immediate: Order confirmation2. Day 3: Loyalty points notification3. Day 14: "Restock" reminder if consumable product4. Day 21: Exclusive early access to new products
### VIP Orders (>$200)1. Immediate: Premium order confirmation2. Day 1: Personal thank-you from founder (email)3. Day 3: SMS with tracking + care tips4. Day 7: Invitation to VIP program
## Rules- ALWAYS check order status before sending, skip if cancelled/refunded- NEVER send marketing to customers who haven't opted in- Personalize with: product name, order number, customer first name- Use Brevo template variables for dynamic content用例三:弃置购物车恢复
将 Shopify 购物车数据与 Brevo 消息传递结合:
---name: shopify-cart-recoverydescription: Recover Shopify abandoned carts via Brevo email and SMSversion: 2.0.0temperature: 0.2tools: - shopify-dev-mcp - brevo_contacts - brevo_email_campaign_management - brevo_templates - brevo_sms_campaignstriggers: - event: cart_abandoned conditions: - cart_value: "> 40" - time_since_activity: "> 1h"---
# Cart Recovery Agent
Monitor Shopify abandoned carts and execute recoverysequences through Brevo.
## Recovery Sequence
1. **+1 hour**: Reminder email with cart contents and images2. **+24 hours**: If no open → SMS with short link to cart3. **+48 hours**: If no recovery → Email with 10% discount code4. **+72 hours**: If cart > $150 and no recovery → WhatsApp with personal message
## Cart Data to Include- Product images and names (from Shopify)- Cart total with currency formatting- Direct checkout link- Discount code (generated dynamically for step 3)
## Rules- NEVER send to customers who already completed checkout- ALWAYS check cart status before each step- Maximum 4 touchpoints per abandoned cart- Respect opt-out preferences per channel示例:自然语言协调
连接两个 MCP 服务器后,可以实时进行协调:
您:"检查我的 Shopify 商店,找出过去 7 天内下过订单但还不在 Brevo 中的客户,并添加他们。"
Claude:正在检查 Shopify 中的近期客户...[使用 shopify-dev-mcp 了解 Customers API][查询 Shopify 过去 7 天内的订单]
找到过去 7 天的 43 名客户。正在与 Brevo 联系人进行比对...[使用 brevo_contacts 搜索每个邮箱]
23 名客户尚未在 Brevo 中。正在添加...[使用 brevo_contacts 创建 23 个新联系人][使用 brevo_lists 将首次购买者添加到"Welcome Series"][使用 brevo_lists 将重复购买者添加到"Loyal Customers"]
完成:- 在 Brevo 中创建了 23 个新联系人- 15 个添加到"Welcome Series"列表(首次购买者)- 8 个添加到"Loyal Customers"列表(重复购买者)- 所有联系人已同步订单数量和总消费金额后续步骤
- Brevo MCP 服务器, Brevo MCP 模块完整列表
- 代理规范, 自定义代理行为
- HubSpot + Brevo, CRM 集成
- Stripe + Brevo, 支付事件集成