Stripe + Brevo 集成
Stripe + Brevo
将 Stripe 的支付数据连接到 Brevo 的互动层。每个支付事件, 创建订阅、付款失败、发起退款, 都成为定向消息的触发器。
使用的 MCP 服务器
| 服务器 | 包 | 认证方式 | 用途 |
|---|---|---|---|
| Stripe MCP | @stripe/mcp | API 密钥 | 支付、订阅、客户、发票、产品、知识库 |
| Brevo MCP | mcp.brevo.com/v1/brevo/mcp | Token | 联系人、邮件、短信、WhatsApp、营销活动、事件追踪 |
配置步骤
第一步:连接两个 MCP 服务器
{ "mcpServers": { "stripe": { "command": "npx", "args": ["-y", "@stripe/mcp"], "env": { "STRIPE_SECRET_KEY": "sk_live_your-stripe-key" } }, "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" } } }}第二步:验证
> 显示本周创建的 Stripe 订阅> 列出我的 Brevo 邮件模板用例一:支付事件营销活动代理
将 Stripe 事件映射到 Brevo 互动:
---name: stripe-payment-campaignsdescription: Trigger Brevo campaigns from Stripe payment eventsversion: 1.0.0temperature: 0.2tools: - stripe - brevo_contacts - brevo_email_campaign_management - brevo_templates - brevo_sms_campaignstriggers: - event: payment_intent.succeeded - event: invoice.payment_failed - event: customer.subscription.created - event: customer.subscription.deleted - event: charge.refunded---
# Payment Event Campaign Agent
Listen for Stripe payment events and trigger the appropriateBrevo engagement campaign.
## Event-to-Campaign Mapping
| Stripe Event | Brevo Action | Timing ||-------------|-------------|--------|| `payment_intent.succeeded` | Send receipt + thank you email | Immediate || `invoice.payment_failed` | Send payment failed email + SMS | Immediate || `invoice.payment_failed` (2nd attempt) | Send urgent SMS with update link | +24h || `customer.subscription.created` | Welcome sequence (3 emails over 7 days) | Immediate || `customer.subscription.updated` | Plan change confirmation email | Immediate || `customer.subscription.deleted` | Cancellation survey + win-back sequence | Immediate + 7 days || `charge.refunded` | Refund confirmation + feedback request | Immediate || `invoice.upcoming` | Renewal reminder with usage summary | 3 days before |
## Failed Payment Recovery
Critical revenue recovery flow:
1. **Attempt 1 fails**: Email with "Update payment method" CTA2. **+24 hours**: SMS with direct link to billing portal3. **+72 hours**: Email from founder: "We don't want to lose you"4. **+7 days (final)**: Last chance email with grace period deadline
## Rules- ALWAYS sync Stripe customer email to Brevo before sending- NEVER expose full payment details in emails (last 4 digits only)- Track events: stripe_payment_email_sent, stripe_recovery_success- For failed payments, stop sequence immediately if payment succeeds用例二:订阅生命周期代理
管理从注册到续费的完整订阅旅程:
---name: stripe-subscription-lifecycledescription: Manage subscription engagement from signup through renewalversion: 1.0.0temperature: 0.3tools: - stripe - brevo_contacts - brevo_email_campaign_management - brevo_segments - brevo_templatestriggers: - schedule: "0 8 * * *"---
# Subscription Lifecycle Agent
Daily check of subscription states to drive engagement:
## Daily Tasks
1. **New subscriptions (last 24h)** - Create/update Brevo contact with plan details - Add to plan-specific segment - Trigger onboarding sequence
2. **Renewals coming (next 7 days)** - Send renewal reminder with usage summary - For annual plans: send "year in review" email
3. **Trials expiring (next 3 days)** - Send trial-to-paid conversion email - SMS reminder on last day
4. **Recently churned (last 7 days)** - Add to win-back segment - Schedule win-back sequence (day 7, 14, 30)
## Brevo Attributes from Stripe
| Stripe Data | Brevo Attribute ||------------|-----------------|| subscription.plan.name | PLAN_NAME || subscription.current_period_end | RENEWAL_DATE || subscription.status | SUBSCRIPTION_STATUS || customer.currency | CURRENCY || invoice.amount_paid (sum) | LIFETIME_REVENUE || subscription.created | SUBSCRIPTION_START |
## Rules- ALWAYS use customer's currency when displaying amounts- Segment by plan tier for differentiated messaging- Track MRR impact of each campaign for ROI reporting示例:实时协调
您:"我看到今天有 5 笔付款失败了。检查哪些是订阅客户 并启动恢复序列。"
Claude:正在检查 Stripe 中今天的付款失败情况...[使用 Stripe MCP 列出近期失败的发票]
找到 5 笔付款失败:- 3 个是订阅客户(月付计划)- 2 个是一次性付款
对于 3 个订阅客户:[使用 brevo_contacts 验证联系人存在][使用 brevo_email_campaign_management 发送付款失败邮件][使用 brevo_sms_campaigns 安排 +24 小时后的 SMS 跟进]
已为 3 个客户启动恢复序列:- [email protected], Pro 套餐($49/月), 邮件已发送- [email protected], Business 套餐($99/月), 邮件已发送- [email protected], Pro 套餐($49/月), 邮件已发送- 如未解决,明日 SMS 跟进已安排后续步骤
- Shopify + Brevo, 电商集成
- HubSpot + Brevo, CRM 集成
- 自定义 API + Brevo, 构建自己的连接器