API مخصصة + تكامل Brevo
API مخصصة + Brevo
ليس لكل منصة خادم MCP. لـ WooCommerce وBigCommerce وMagento وأنظمة CRM الخاصة، أو أي نظام بواجهة REST API, أنشئ وكيل موصّل يربط بياناتك بـ Brevo.
نهجان
النهج الأول: خادم MCP مجتمعي
تحقق من وجود خادم MCP مجتمعي لمنصتك:
| المنصة | MCP المجتمعي | الحالة |
|---|---|---|
| WooCommerce | woocommerce-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 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: تشغيل الوكيل
أنت: "زامن جميع عملاء 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-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 |
|---|---|
| مزامنات لمرة واحدة أو نادرة | مزامنة إنتاجية يومية |
| إنشاء نماذج أولية للتكامل | مشترك بين الفريق/المؤسسة |
| عمليات قراءة بسيطة | عمليات معقدة متعددة الخطوات |
| أقل من 5 نقاط نهائية API مطلوبة | تغطية كاملة للـ API |
لبناء خادم MCP مخصص، راجع مواصفات MCP وIntegration Builder لـ Tajo لتوليد الخوادم من مواصفات OpenAPI.
الخطوات التالية
- نظرة عامة على طبقة التكامل, جميع التكاملات المتاحة
- Shopify + Brevo, مثال على MCP رسمي
- مواصفات الوكيل, تنسيق markdown للوكلاء
- خادم MCP لـ Brevo, وحدات Brevo المتاحة