MA

Mailjet MCP Server for AI Driven Email APIs

Enable AI agents to manage Mailjet via an MCP server, accessing contacts, campaigns, segmentation, stats and workflows through standardized API tools.

Quick Install
npx -y @mailgun/mailjet-mcp-server

Overview

This MCP (Model Context Protocol) server exposes Mailjet APIs as standardized “tools” so AI agents that implement MCP (for example, Claude Desktop) can query and act on Mailjet resources. The server translates MCP tool calls into Mailjet REST requests, letting agents access contacts, lists/segments, campaigns, sending statistics, workflows and related objects without needing direct API wiring inside the agent.

For developers, the server is a lightweight Node.js process that communicates with the agent over stdio and is configured with your Mailjet API credentials. Running the server locally makes it easy to prototype agent-led workflows (reporting, audience management, automated campaign actions) while relying on Mailjet for execution and data.

Repository: https://github.com/mailgun/mailjet-mcp-server

Features

  • Exposes Mailjet functionality via MCP tool-style endpoints
  • Support for contacts, lists, segmentation, campaigns, sending statistics, and workflows
  • Small Node.js server that communicates over stdio (compatible with MCP clients like Claude Desktop)
  • Environment-driven configuration for credentials and region
  • Local test suite to validate behavior during development

Installation / Configuration

Prerequisites: Node.js (LTS) and a package manager like pnpm or npm.

Clone and install:

git clone https://github.com/mailgun/mailjet-mcp-server.git
cd mailjet-mcp-server
pnpm install

Start the MCP server directly:

# From project root
node src/mailjet-mcp.js

Configure your MCP-compatible agent (example: Claude Desktop). Add or update the MCP server entry pointing to the script and provide the Mailjet API key through environment variables.

Example Claude Desktop configuration (paths vary by OS):

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

Add this block (adjust path to mailjet-mcp.js):

{
  "mcpServers": {
    "mailjet": {
      "command": "node",
      "args": ["/PATH/TO/mailjet-mcp-server/src/mailjet-mcp.js"],
      "env": {
        "MAILJET_API_KEY": "YOUR_api_key:YOUR_secret_key"
      }
    }
  }
}

Environment variables

VariableRequiredPurpose
MAILJET_API_KEYYesMailjet API key and secret formatted as key:secret
MAILJET_API_REGIONNoOptional region selector (e.g., “eu”) to target EU endpoints

Run tests:

NODE_ENV=test pnpm test

Available Resources

The MCP server exposes a set of tools that map to Mailjet resources and actions. Typical available resources include:

  • Contacts and contact lists
  • Segments (audience rules)
  • Campaigns (create, update, list)
  • Sending and delivery statistics (aggregated metrics)
  • Workflows and automation status

Each tool follows the MCP tools specification, returning structured JSON and supporting query parameters that the AI agent can populate (for example, date ranges for stats, or filters for contacts).

Note: The exact tool names and supported parameters are communicated to the agent at MCP handshake time. Inspect the server source to see the current tool schema if you need custom behavior.

Use Cases

  • Identify high-value audiences

    • Example: “Which contact list has the most active subscribers in the last 90 days?”
    • The agent can query list sizes and engagement metrics, then return the top list.
  • Generate time-series reports

    • Example: “Create a chart of daily delivery and open rates for the last 7 days.”
    • The agent fetches sending stats via the MCP tool and can format results for visualization.
  • Manage segmentation and targeting

    • Example: “Create a segment of users who opened any email in the past 30 days and live in California.”
    • The agent can call the segmentation tool to create or evaluate segments.
  • Automate campaign operations

    • Example: “Schedule a re-engagement campaign to subscribers inactive for 60+ days.”
    • The agent can create a campaign draft, set recipients via a segment, and schedule sending.
  • Troubleshoot deliverability trends

    • Example: “Show bounce and spam report trends for the last month.”
    • The agent aggregates statistics and highlights anomalies for operator review.

Debugging and Development Tips

  • The MCP server uses stdio for communication; when integrating with agents, enable debug logging on the agent side or inspect stdio streams.
  • For rapid iteration, run the server locally and use the test suite (NODE_ENV=test pnpm test) to validate changes.
  • To change Mailjet endpoint region, set MAILJET_API_REGION before starting the server.

License and Contribution

This project is available under the Apache License 2.0. Contributions and pull requests are welcome via the GitHub repository: https://github.com/mailgun/mailjet-mcp-server