Advanced Configuration
Multi-Service Setup
For comprehensive Brevo integration, configure multiple specific services:
{
"mcpServers": {
"brevo_crm": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_deals/mcp/YOUR_MCP_TOKEN"]
},
"brevo_contacts": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN"]
},
"brevo_campaigns": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_email_campaign_management/mcp/YOUR_MCP_TOKEN"]
},
"brevo_analytics": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_campaign_analytics/mcp/YOUR_MCP_TOKEN"]
}
}
}
Service Selection Strategy
Recommended: Use specific service endpoints
- Better performance and focused tool sets
- Reduced complexity for AI assistants
- Clearer separation of concerns
- Easier debugging and monitoring
Alternative: Use complete service access
- Single configuration for all features
- May overwhelm AI assistants with tool options
- Higher complexity but complete functionality
Environment Variables
# For containerized deployments
BREVO_MCP_TOKEN=mcp_token_abc123000456ghi789jkl012mno345pqr6780xxxxxxxx
BREVO_MCP_BASE_URL=https://mcp.brevo.com/v1/
BREVO_MCP_CONTACTS_ENDPOINT=brevo_contacts/mcp/
BREVO_MCP_DEALS_ENDPOINT=brevo_deals/mcp/
BREVO_MCP_CAMPAIGNS_ENDPOINT=brevo_email_campaign_management/mcp/
SSE Support
If your application requires an SSE based endpoint you can simply append
/sse
to the base endpoint. We support this !
https://mcp.brevo.com/v1/brevo_deals/mcp/YOUR_MCP_TOKEN/sse
Error Handling
Common Error Responses
{
"error": {
"code": "INVALID_TOKEN",
"message": "Token authentication failed",
"details": "MCP token is invalid or has expired"
}
}
Error Codes
Code | Description | Resolution |
---|---|---|
INVALID_TOKEN | Token format or token invalid | Copy the correct MCP token from your Brevo account |
RATE_LIMIT_EXCEEDED | API rate limit reached | Implement backoff strategy |
INSUFFICIENT_PERMISSIONS | Token lacks required permissions | Check account permissions in Brevo |
RESOURCE_NOT_FOUND | Requested resource doesn't exist | Verify resource ID |
INVALID_PARAMETERS | Invalid tool parameters | Check parameter format and requirements |
SERVICE_UNAVAILABLE | Service temporarily unavailable | Retry with exponential backoff |
Error Handling Best Practices
try {
const result = await client.callTool('get_contacts', {
filters: 'equals(FIRSTNAME,"John")'
});
} catch (error) {
switch (error.code) {
case 'RATE_LIMIT_EXCEEDED':
await new Promise(resolve => setTimeout(resolve, 5000));
break;
case 'INVALID_PARAMETERS':
console.error('Invalid parameters:', error.details);
break;
default:
console.error('Unexpected error:', error);
}
}
Rate Limiting
Limits
- API Calls: Follows standard Brevo API rate limits (varies by plan)
- MCP Connections: 10 concurrent connections per MCP token
- Token Refresh: Tokens are valid for 24 hours
Best Practices
- Implement exponential backoff for rate limit errors
- Cache responses when appropriate
- Use specific service endpoints to reduce tool overhead
- Monitor API usage through Brevo dashboard
Development Environment Setup
Local Testing
- Install MCP SDK:
npm install -g @modelcontextprotocol/sdk
- Test Connection:
mcp-client-test https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN
- Validate Token:
curl -X GET "https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN/tools" \
-H "Authorization: Bearer YOUR_MCP_TOKEN"
Debugging
Enable MCP debugging:
{
"mcpServers": {
"brevo_contacts": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN"
],
"env": {
"MCP_DEBUG": "1"
}
}
}
}
Security Considerations
MCP Token Management
- Rotate MCP tokens regularly through your Brevo account
- Never commit tokens to version control
Token Security
- Store tokens securely (environment variables, secret managers)
- Obtain fresh tokens from your Brevo account as needed
Updated 8 days ago