Advanced configuration

Multi-Service Setup

For comprehensive Brevo integration, configure multiple specific services:

JSON
1{
2 "mcpServers": {
3 "brevo_crm": {
4 "command": "npx",
5 "args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_deals/mcp/YOUR_MCP_TOKEN"]
6 },
7 "brevo_contacts": {
8 "command": "npx",
9 "args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN"]
10 },
11 "brevo_campaigns": {
12 "command": "npx",
13 "args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_email_campaign_management/mcp/YOUR_MCP_TOKEN"]
14 },
15 "brevo_analytics": {
16 "command": "npx",
17 "args": ["-y", "mcp-remote", "https://mcp.brevo.com/v1/brevo_campaign_analytics/mcp/YOUR_MCP_TOKEN"]
18 }
19 }
20}

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

Shell
$# 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

1{
2 "error": {
3 "code": "INVALID_TOKEN",
4 "message": "Token authentication failed",
5 "details": "MCP token is invalid or has expired"
6 }
7}

Error Codes

CodeDescriptionResolution
INVALID_TOKENToken format or token invalidCopy the correct MCP token from your Brevo account
RATE_LIMIT_EXCEEDEDAPI rate limit reachedImplement backoff strategy
INSUFFICIENT_PERMISSIONSToken lacks required permissionsCheck account permissions in Brevo
RESOURCE_NOT_FOUNDRequested resource doesn’t existVerify resource ID
INVALID_PARAMETERSInvalid tool parametersCheck parameter format and requirements
SERVICE_UNAVAILABLEService temporarily unavailableRetry with exponential backoff

Error Handling Best Practices

JavaScript
1try {
2 const result = await client.callTool('get_contacts', {
3 filters: 'equals(FIRSTNAME,"John")'
4 });
5} catch (error) {
6 switch (error.code) {
7 case 'RATE_LIMIT_EXCEEDED':
8 await new Promise(resolve => setTimeout(resolve, 5000));
9 break;
10 case 'INVALID_PARAMETERS':
11 console.error('Invalid parameters:', error.details);
12 break;
13 default:
14 console.error('Unexpected error:', error);
15 }
16}

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

1

Install MCP SDK

Shell
$npm install -g @modelcontextprotocol/sdk
2

Test Connection

Shell
$mcp-client-test https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN
3

Validate Token

cURL
1curl -X GET "https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN/tools" \
2 -H "Authorization: Bearer YOUR_MCP_TOKEN"

Debugging

Enable MCP debugging:

JSON
1{
2 "mcpServers": {
3 "brevo_contacts": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "mcp-remote",
8 "https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN"
9 ],
10 "env": {
11 "MCP_DEBUG": "1"
12 }
13 }
14 }
15}

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