API مخصصة + تكامل Brevo

API مخصصة + Brevo

ليس لكل منصة خادم MCP. لـ WooCommerce وBigCommerce وMagento وأنظمة CRM الخاصة، أو أي نظام بواجهة REST API, أنشئ وكيل موصّل يربط بياناتك بـ Brevo.

نهجان

النهج الأول: خادم MCP مجتمعي

تحقق من وجود خادم MCP مجتمعي لمنصتك:

المنصةMCP المجتمعيالحالة
WooCommercewoocommerce-mcp-serverتحت صيانة المجتمع
BigCommerceراجع دليل خوادم MCPمتغيرة
Magentoراجع دليل خوادم MCPمتغيرة
Salesforceخيارات متعددة متاحةمجتمع نشط
Zendeskمتاح عبر Composio/Zapierنشط

إذا وجد خادم مجتمعي، استخدمه بنفس طريقة الخوادم الرسمية, أضفه إلى إعدادات Claude جانباً Brevo MCP.

النهج الثاني: وكيل بأدوات HTTP

للمنصات التي لا تملك خوادم MCP، أنشئ وكيلاً يستخدم قدرات HTTP المدمجة في Claude لاستدعاء REST APIs مباشرةً، ثم يكتب إلى Brevo عبر MCP.

بناء وكيل موصّل مخصص

الخطوة 1: فهم API المصدر

وثّق النقاط النهائية الرئيسية التي يحتاجها وكيلك:

# Example: WooCommerce REST API
source_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-sync
description: Sync WooCommerce customers and orders to Brevo
version: 1.0.0
temperature: 0.1
tools:
- brevo_contacts
- brevo_attributes
- brevo_lists
- brevo_email_campaign_management
triggers:
- 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 Sync
1. 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 Sync
1. GET /orders?after={last_sync_time}&status=completed
2. 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 data
2. Transform the response to Brevo's expected format
3. Call Brevo MCP tools to create/update contacts
4. 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: تشغيل الوكيل

أنت: "زامن جميع عملاء WooCommerce من الأسبوع الماضي مع Brevo
وأضف العملاء الجدد إلى قائمة Welcome Series."
Claude: سأزامن عملاء WooCommerce مع Brevo.
جارٍ جلب العملاء المعدّلين في آخر 7 أيام من WooCommerce...
[يرسل HTTP GET إلى your-store.com/wp-json/wc/v3/customers?modified_after=...]
تم العثور على 67 عميلاً. جارٍ المزامنة مع Brevo...
[يستخدم brevo_contacts لإنشاء/تحديث جهات الاتصال]
[يستخدم brevo_lists لإضافة 23 عميلاً جديداً إلى "Welcome Series"]
اكتملت المزامنة:
- 67 عميلاً تمت معالجتهم
- 44 جهة اتصال موجودة تم تحديثها
- 23 جهة اتصال جديدة أُنشئت → أُضيفت إلى Welcome Series
- 0 تم تخطيها (جميعها تمتلك رسائل بريد إلكتروني صالحة)

قالب: موصّل API REST العام

استخدم هذا القالب لأي API REST:

---
name: {platform}-brevo-connector
description: Sync {platform} data to Brevo for engagement
version: 1.0.0
temperature: 0.1
tools:
- brevo_contacts
- brevo_attributes
- brevo_lists
triggers:
- 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 Logic
1. Fetch changed records from source since last sync
2. Transform to Brevo format
3. Upsert contacts via brevo_contacts
4. Track events for campaign triggers
5. 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
مزامنات لمرة واحدة أو نادرةمزامنة إنتاجية يومية
إنشاء نماذج أولية للتكاملمشترك بين الفريق/المؤسسة
عمليات قراءة بسيطةعمليات معقدة متعددة الخطوات
أقل من 5 نقاط نهائية API مطلوبةتغطية كاملة للـ API

لبناء خادم MCP مخصص، راجع مواصفات MCP وIntegration Builder لـ Tajo لتوليد الخوادم من مواصفات OpenAPI.

الخطوات التالية

مساعد AI

مرحباً! اسألني أي شيء عن الوثائق.

ابدأ مجانًا مع Brevo