การเชื่อมต่อ API แบบกำหนดเองกับ Brevo
API แบบกำหนดเอง + Brevo
ไม่ใช่ทุกแพลตฟอร์มที่มีเซิร์ฟเวอร์ MCP สำหรับ WooCommerce, BigCommerce, Magento, CRM ที่พัฒนาขึ้นเอง หรือระบบใดก็ตามที่มี REST API คุณสามารถสร้างเอเจนต์ตัวเชื่อมเพื่อเชื่อมข้อมูลของคุณเข้ากับ Brevo ได้
สองแนวทาง
แนวทางที่ 1: เซิร์ฟเวอร์ MCP จากชุมชน
ตรวจสอบว่ามีเซิร์ฟเวอร์ MCP จากชุมชนสำหรับแพลตฟอร์มของคุณอยู่แล้วหรือไม่
| แพลตฟอร์ม | MCP จากชุมชน | สถานะ |
|---|---|---|
| WooCommerce | woocommerce-mcp-server | ดูแลโดยชุมชน |
| BigCommerce | ดูที่ ไดเรกทอรีเซิร์ฟเวอร์ MCP | แตกต่างกันไป |
| Magento | ดูที่ ไดเรกทอรีเซิร์ฟเวอร์ MCP | แตกต่างกันไป |
| Salesforce | มีให้เลือกหลายตัว | ชุมชนคึกคัก |
| Zendesk | ใช้งานได้ผ่าน Composio/Zapier | ใช้งานอยู่ |
หากมีเซิร์ฟเวอร์จากชุมชนอยู่แล้ว ให้ใช้งานเหมือนกับเซิร์ฟเวอร์อย่างเป็นทางการ โดยเพิ่มเข้าไปในไฟล์ตั้งค่า Claude ของคุณควบคู่กับ Brevo MCP
แนวทางที่ 2: เอเจนต์ที่ใช้เครื่องมือ HTTP
สำหรับแพลตฟอร์มที่ไม่มีเซิร์ฟเวอร์ MCP ให้สร้างเอเจนต์ที่ใช้ความสามารถ HTTP ในตัวของ Claude เรียก REST API โดยตรง แล้วเขียนข้อมูลไปยัง Brevo ผ่าน MCP
การสร้างเอเจนต์ตัวเชื่อมของคุณเอง
ขั้นตอนที่ 1: ทำความเข้าใจ API ต้นทาง
จดบันทึก endpoint สำคัญที่เอเจนต์ของคุณต้องใช้
# Example: WooCommerce REST APIsource_api: base_url: "https://your-store.com/wp-json/wc/v3" auth: Basic (consumer_key:consumer_secret) endpoints: - GET /customers # List customers - GET /customers/{id} # Get customer details - GET /orders # List orders - GET /orders/{id} # Get order details - GET /products # List products - GET /coupons # List couponsขั้นตอนที่ 2: กำหนดเอเจนต์
---name: woocommerce-brevo-syncdescription: Sync WooCommerce customers and orders to Brevoversion: 1.0.0temperature: 0.1tools: - brevo_contacts - brevo_attributes - brevo_lists - brevo_email_campaign_managementtriggers: - schedule: "0 */6 * * *" - webhook: /agents/woocommerce/sync method: POST---
# WooCommerce → Brevo Sync Agent
Connect WooCommerce store data to Brevo for engagement campaigns.
## Source API
- **Base URL**: https://your-store.com/wp-json/wc/v3- **Authentication**: Basic Auth with consumer key/secret- **Key endpoints**: /customers, /orders, /products
## Sync Strategy
### Customer Sync1. GET /customers?modified_after={last_sync_time}2. For each customer: - Map WooCommerce fields to Brevo attributes - Create or update Brevo contact - Add to appropriate list based on order history
### Order Event Sync1. GET /orders?after={last_sync_time}&status=completed2. For each order: - Track "order_completed" event in Brevo - Update contact attributes (order_count, total_spent) - Trigger post-purchase campaign if applicable
## Field Mapping
| WooCommerce | Brevo Attribute ||-------------|-----------------|| email | EMAIL || first_name | FIRSTNAME || last_name | LASTNAME || billing.phone | SMS || orders_count | ORDER_COUNT || total_spent | TOTAL_SPENT || date_created | CUSTOMER_SINCE || role | CUSTOMER_TYPE |
## API Call Pattern
For each sync operation, the agent should:1. Call WooCommerce REST API to fetch data2. Transform the response to Brevo's expected format3. Call Brevo MCP tools to create/update contacts4. Log sync results for monitoring
## Rules- Respect WooCommerce API rate limits (default: 25 req/10 seconds)- ONLY sync customers with valid email addresses- Implement incremental sync using modified_after parameter- Store last sync timestamp for next runขั้นตอนที่ 3: ตั้งค่า Brevo MCP
เชื่อมต่อเฉพาะโมดูลของ Brevo ที่เอเจนต์ของคุณต้องใช้เท่านั้น
{ "mcpServers": { "brevo_contacts": { "url": "https://mcp.brevo.com/v1/brevo_contacts/mcp", "headers": { "Authorization": "Bearer your-brevo-token" } }, "brevo_email": { "url": "https://mcp.brevo.com/v1/brevo_email_campaign_management/mcp", "headers": { "Authorization": "Bearer your-brevo-token" } }, "brevo_lists": { "url": "https://mcp.brevo.com/v1/brevo_lists/mcp", "headers": { "Authorization": "Bearer your-brevo-token" } } }}ขั้นตอนที่ 4: รันเอเจนต์
You: "Sync all WooCommerce customers from the last week to Brevo and add new customers to the Welcome Series list."
Claude: I'll sync your WooCommerce customers to Brevo.
Fetching customers modified in the last 7 days from WooCommerce...[Makes HTTP GET to your-store.com/wp-json/wc/v3/customers?modified_after=...]
Found 67 customers. Syncing to Brevo...[Uses brevo_contacts to create/update contacts][Uses brevo_lists to add 23 new customers to "Welcome Series"]
Sync complete:- 67 customers processed- 44 existing contacts updated- 23 new contacts created → added to Welcome Series- 0 skipped (all had valid emails)เทมเพลต: ตัวเชื่อม REST API แบบทั่วไป
ใช้เทมเพลตนี้กับ REST API ใดก็ได้
---name: {platform}-brevo-connectordescription: Sync {platform} data to Brevo for engagementversion: 1.0.0temperature: 0.1tools: - brevo_contacts - brevo_attributes - brevo_liststriggers: - schedule: "0 */6 * * *"---
# {Platform} → Brevo Connector
## Source API Configuration- **Base URL**: {api_base_url}- **Auth**: {auth_method} ({details})- **Rate Limit**: {rate_limit}
## Data to Sync
### Contacts- Source endpoint: {endpoint}- Brevo mapping: {field_map}- Sync frequency: Every 6 hours- Incremental: Use modified_after / updated_since parameter
### Events- Source endpoint: {endpoint}- Brevo event name: {event_name}- Trigger: When {condition}
## Sync Logic1. Fetch changed records from source since last sync2. Transform to Brevo format3. Upsert contacts via brevo_contacts4. Track events for campaign triggers5. Log results and update sync cursor
## Error Handling- Retry failed API calls 3 times with exponential backoff- Skip individual records that fail validation- Report errors in sync summary- NEVER stop entire sync for single record failureเมื่อใดจึงควรสร้างเซิร์ฟเวอร์ MCP เต็มรูปแบบ
หากคุณพบว่าต้องเชื่อมต่อแพลตฟอร์มเดิมซ้ำ ๆ อยู่บ่อยครั้ง ควรพิจารณาสร้างเซิร์ฟเวอร์ MCP อย่างจริงจัง
| ใช้แค่เอเจนต์ก็พอ | ควรสร้างเซิร์ฟเวอร์ MCP |
|---|---|
| ซิงค์ครั้งเดียวหรือนาน ๆ ครั้ง | ซิงค์บนระบบจริงทุกวัน |
| ทดลองสร้างการเชื่อมต่อ | ใช้ร่วมกันทั้งทีมหรือทั้งองค์กร |
| อ่านข้อมูลอย่างง่าย | การทำงานหลายขั้นตอนที่ซับซ้อน |
| ต้องใช้ API endpoint น้อยกว่า 5 จุด | ต้องรองรับ API ครบทุกส่วน |
หากต้องการสร้างเซิร์ฟเวอร์ MCP ของคุณเอง ดูที่ ข้อกำหนดของ MCP และ Integration Builder ของ Tajo สำหรับการสร้างเซิร์ฟเวอร์จากสเปก OpenAPI
ขั้นตอนถัดไป
- ภาพรวมชั้นการเชื่อมต่อ, การเชื่อมต่อทั้งหมดที่มีให้ใช้งาน
- Shopify + Brevo, ตัวอย่าง MCP อย่างเป็นทางการ
- ข้อกำหนดของเอเจนต์, รูปแบบ markdown ของเอเจนต์
- Brevo MCP Server, โมดูลของ Brevo ที่มีให้ใช้งาน