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

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

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

  1. Install MCP SDK:
npm install -g @modelcontextprotocol/sdk
  1. Test Connection:
mcp-client-test https://mcp.brevo.com/v1/brevo_contacts/mcp/YOUR_MCP_TOKEN
  1. 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