Skip to main content

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)

Python 3.10+ PyPI version


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

  1. Log in to MoEngage Dashboard
  2. Navigate to SettingsAccountAPIs
  3. Copy your Workspace ID and Campaign Reports API Key
  4. 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 attempted
  • sent - Successfully sent messages
  • failed - Failed messages
  • impression - Total impressions/opens
  • click - Total clicks
  • ctr - 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_TIMEOUT value
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moengage_mcp_server-0.1.1.tar.gz (69.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moengage_mcp_server-0.1.1-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file moengage_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: moengage_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 69.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for moengage_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 033b41f39dd61ea592e26dcc913d74cd18d7bee0fe7afa2d6f1329844241d55c
MD5 4e1cd188b1f2df1a7c054c164ea72103
BLAKE2b-256 be0c73dbe5cbbcc6f23439ba5082007f2a01fd87ccab99ec554539d3b2edf224

See more details on using hashes here.

File details

Details for the file moengage_mcp_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for moengage_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7817a4e6a1566bdda0901abf26642bc32a70364cd222a5848799e956471b85
MD5 8ad0599d52a229f17418d64ef49497d8
BLAKE2b-256 d4e8681708913e9581184e148e7d0d2026e3b7d04164170434d54b0ad24083f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page