Mailgun MCP Server
@mailgun
Implementation of Model Context Protocol server for Mailgun APIs
Overview
What is Mailgun MCP Server?
A Model Context Protocol server for Mailgun that gives AI agents a practical, workflow-oriented interface to send email, diagnose deliverability, and manage account operations. It runs locally on your machine—Mailgun does not offer a hosted version.
How to use Mailgun MCP Server?
Add the server entry to your MCP client configuration using the npx command with your Mailgun API key and optional region. Optionally scope the registered tools to one or more product tags (send, validate, optimize, inspect) via the --tags CLI flag or MAILGUN_MCP_TAGS environment variable.
Key features of Mailgun MCP Server
- Send, retrieve, and resend email messages
- View and manage sending domains and tracking settings
- Create, update, and delete webhooks
- Manage inbound email routing rules
- Create mailing lists and manage their members
- Create and version email templates
- Query sending metrics, usage metrics, and logs
- View aggregate statistics by domain, tag, provider, device, and country
- View bounces, unsubscribes, complaints, and allowlist entries
- Manage IP assignments and dedicated IP pool configuration
Use cases of Mailgun MCP Server
- Send automated or AI-generated emails through a Mailgun domain
- Diagnose deliverability issues by checking bounce classifications and DNS verification
- Manage email templates, mailing lists, and inbound routing rules via natural language
- Analyze sending volume, delivery rates, and engagement broken down by region or device
- Review suppressions (unsubscribes, complaints) and tracking settings across domains
FAQ from Mailgun MCP Server
What prerequisites are needed?
Node.js v20.12 or higher and a Mailgun account with an API key.
How is the API key secured?
The API key is passed as an environment variable and is never exposed to the AI model. The server runs locally and all communication with the Mailgun API uses HTTPS with TLS certificate validation. The server does not log API keys, request parameters, or response data.
Can I limit which tools the server exposes?
Yes. Use the --tags flag or MAILGUN_MCP_TAGS environment variable with a comma-separated list of tag values (send, validate, optimize, inspect). Tags use OR semantics—a tool is registered if any of its tags matches the active set.
Does the server delete any data?
No. The server exposes read and update operations but does not expose any delete operations, which limits the blast radius of unintended actions.
What transport does the server use?
The MCP server communicates over stdio.