MCP server for MoEngage Campaign APIs - access campaign stats, search campaigns via Model Context Protocol
Project description
MoEngage MCP Server
Access MoEngage Campaign APIs through the Model Context Protocol (MCP)
Overview
MoEngage MCP Server is a Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with MoEngage Campaign APIs. Query campaign statistics, search campaigns, and analyze marketing performance using natural language.
Features
- Campaign Statistics - Fetch detailed performance metrics including delivery rates, CTR, impressions, and more
- Email Campaigns - Search and retrieve email campaign configurations and content
- Push Notifications - Access push notification campaign details across platforms
- SMS Campaigns - Retrieve SMS campaign information and connector details
- Multi Data Center Support - Works with all MoEngage data centers (DC01-DC06)
- Secure by Design - Credentials are masked in logs, environment-based configuration
Installation
Quick Install (Recommended)
uvx moengage-mcp-server@latest
Install with pip
pip install moengage-mcp-server
Install from Source
git clone https://github.com/moengage/moengage-mcp-server.git
cd moengage-mcp-server
uv sync
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
MOENGAGE_WORKSPACE_ID |
Yes | - | Your MoEngage Workspace ID |
MOENGAGE_CAMPAIGN_REPORTS_API_KEY |
Yes | - | Campaign Reports API Key |
MOENGAGE_DATA_CENTER |
No | 01 |
Data center code (01-06) |
MOENGAGE_TIMEOUT |
No | 30 |
API timeout in seconds |
MOENGAGE_MAX_RETRIES |
No | 3 |
Max retry attempts |
Finding Your Credentials
- Log in to MoEngage Dashboard
- Navigate to Settings → Account → APIs
- Copy your Workspace ID and Campaign Reports API Key
- Check your dashboard URL to determine your data center (e.g.,
dashboard-02.moengage.com→ DC02)
Quick Start
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"moengage": {
"command": "uvx",
"args": ["moengage-mcp-server@latest"],
"env": {
"MOENGAGE_WORKSPACE_ID": "your-workspace-id",
"MOENGAGE_CAMPAIGN_REPORTS_API_KEY": "your-api-key",
"MOENGAGE_DATA_CENTER": "01"
}
}
}
}
Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"moengage": {
"type": "stdio",
"command": "uvx",
"args": ["moengage-mcp-server@latest"],
"env": {
"MOENGAGE_WORKSPACE_ID": "your-workspace-id",
"MOENGAGE_CAMPAIGN_REPORTS_API_KEY": "your-api-key",
"MOENGAGE_DATA_CENTER": "01"
}
}
}
}
VS Code
Add to .vscode/settings.json:
{
"mcp.servers": {
"moengage": {
"command": "uvx",
"args": ["moengage-mcp-server@latest"],
"env": {
"MOENGAGE_WORKSPACE_ID": "your-workspace-id",
"MOENGAGE_CAMPAIGN_REPORTS_API_KEY": "your-api-key",
"MOENGAGE_DATA_CENTER": "01"
}
}
}
}
Available Tools
get_campaign_stats
Fetch performance statistics for one or more campaigns.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_ids |
list | Yes | List of campaign IDs (max 50) |
start_date |
string | Yes | Start date (YYYY-MM-DD) |
end_date |
string | Yes | End date (YYYY-MM-DD) |
attribution_type |
string | No | VIEW_THROUGH or CLICK_THROUGH (default: VIEW_THROUGH) |
metric_type |
string | No | TOTAL or UNIQUE (default: TOTAL) |
Metrics Returned:
attempted- Total messages attemptedsent- Successfully sent messagesfailed- Failed messagesimpression- Total impressions/opensclick- Total clicksctr- Click-through rate (%)delivery_rate- Delivery rate (%)sent_rate- Sent rate (%)failure_rate- Failure rate (%)
get_email_campaigns
Search and retrieve email campaign details.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
campaign_id |
string | No | Specific campaign ID to fetch |
campaign_name |
string | No | Filter by campaign name |
status |
string | No | Filter by status |
limit |
integer | No | Results per page (1-15, default: 10) |
page |
integer | No | Page number (default: 1) |
include_archived |
boolean | No | Include archived campaigns (default: false) |
Status Values: DRAFT, SCHEDULED, ACTIVE, PAUSED, COMPLETED, STOPPED
get_push_campaigns
Search and retrieve push notification campaign details.
Parameters: Same as get_email_campaigns
get_sms_campaigns
Search and retrieve SMS campaign details.
Parameters: Same as get_email_campaigns
Data Centers
| Code | API Endpoint | Dashboard URL |
|---|---|---|
01 |
api-01.moengage.com |
dashboard.moengage.com |
02 |
api-02.moengage.com |
dashboard-02.moengage.com |
03 |
api-03.moengage.com |
dashboard-03.moengage.com |
04 |
api-04.moengage.com |
dashboard-04.moengage.com |
05 |
api-05.moengage.com |
dashboard-05.moengage.com |
06 |
api-06.moengage.com |
dashboard-06.moengage.com |
Usage Examples
Once configured, you can use natural language with Claude:
Get the performance stats for campaign abc123 for the last 30 days
Show me all active email campaigns
Compare the CTR of campaigns abc123 and def456 for December 2024
Find SMS campaigns with "welcome" in the name
Development
Setup
git clone https://github.com/moengage/moengage-mcp-server.git
cd moengage-mcp-server
uv sync --extra dev
Running Tests
uv run pytest
Code Quality
# Linting
uv run ruff check .
# Type checking
uv run mypy src/
Building
uv build
Project Structure
moengage-mcp-server/
├── src/
│ └── moengage_mcp/
│ ├── __init__.py # Package initialization
│ ├── config.py # Configuration management
│ ├── models.py # Pydantic models
│ ├── client.py # HTTP client for MoEngage API
│ └── server.py # MCP server implementation
├── tests/ # Test files
├── docs/ # Documentation (MkDocs)
├── .env.example # Environment template
├── pyproject.toml # Project configuration
└── README.md # This file
Security
- Environment Variables - Credentials are never hardcoded
- Credential Masking - API keys are automatically masked in logs
- Secure Transport - All API calls use HTTPS
Troubleshooting
Authentication Errors
- Verify your Workspace ID and API Key are correct
- Ensure your API key has Campaign Reports permissions
- Check your data center setting matches your account
Connection Timeout
- Check your internet connection
- Try increasing
MOENGAGE_TIMEOUTvalue - Verify the MoEngage API is accessible from your network
No Data Returned
- Verify the campaign IDs exist in your account
- Check the date range includes campaign activity
- Ensure your API key has access to the requested campaigns
Support
- GitHub Issues - Bug reports and feature requests
- MoEngage Documentation - Official MoEngage API docs
- MCP Specification - Model Context Protocol documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moengage_mcp_server-0.1.2.tar.gz.
File metadata
- Download URL: moengage_mcp_server-0.1.2.tar.gz
- Upload date:
- Size: 69.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d0537fd3dd8ab5a15deb3aa30500f01ee3024995fb6263038f5ec7aeffedb8b
|
|
| MD5 |
0442ac9678e029cf50e2246654b4f15a
|
|
| BLAKE2b-256 |
2f9cc8d47b3f201cf9493ded69605a5d7f5b6c3bf0aff5421fbf90ba298425eb
|
File details
Details for the file moengage_mcp_server-0.1.2-py3-none-any.whl.
File metadata
- Download URL: moengage_mcp_server-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a361cd034cd500c23d8ae0fa574cb8375fec7a576140ee92a209c5a8956073c9
|
|
| MD5 |
3b54d4b12ff93e3f73ef4e017a2946ec
|
|
| BLAKE2b-256 |
ae9d92c19a7901422bb7a345254d809acd18d2928546a1e9a0fc195edab88089
|