Mailgun MCP server
Mailgun's official open-source MCP server lets agents send email and inspect deliverability, domains, suppressions, analytics, and more.
Mailgun MCP is the official server from Mailgun that gives AI agents a workflow-oriented interface to the Mailgun email API. Its tools are generated from Mailgun's OpenAPI spec and cover sending and resending messages, managing domains and DNS verification, tracking settings, webhooks, dedicated IPs and IP pools, tags and per-tag stats, account and domain totals, provider/device/country aggregates, analytics metrics and logs, suppression lists (bounces, unsubscribes, complaints, and allowlists), inbound routes, mailing lists and members, templates and versions, bounce classification, account limits, plus address validation, inbox placement, and email preview. That makes it a fit for deliverability copilots and ops agents that send transactional mail and diagnose why it is or isn't landing.
The canonical install is the published npm package, run with npx -y @mailgun/mcp-server over stdio. Authenticate with a MAILGUN_API_KEY and an optional MAILGUN_API_REGION (us or eu). By design the server is read-only with one exception, sending email, so an agent can freely explore account data without risking production. A MAILGUN_MCP_TAGS setting filters tools by product area (send, validate, optimize, inspect).
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Available tools
| Tool | Description |
|---|---|
| post-v3-domain-name-messages | Send an email. |
| get-v3-domains-domain-name-messages-storage-key | Retrieve a stored email. |
| post-v3-domains-domain-name-messages-storage-key | Resend an email. |
| get-v4-domains | Get domains. |
| get-v4-domains-name | Get domain details. |
| put-v4-domains-name-verify | Verify Domain. |
| get-v3-domains-name-sending-queues | Get messages queue status. |
| get-v3-domains-name-tracking | Get tracking settings. |
| put-v3-domains-name-tracking-click | Update click tracking settings. |
| put-v3-domains-name-tracking-open | Update open tracking settings. |
| put-v3-domains-name-tracking-unsubscribe | Update unsubscribe tracking settings. |
| get-v3-domains-domain-webhooks | Get domain webhooks. |
| post-v3-domains-domain-webhooks | Create a domain webhook. |
| get-v3-domains-domain-name-webhooks-webhook-name | Get domain webhooks by type. |
| put-v3-domains-domain-name-webhooks-webhook-name | Update domain webhook. |
| get-v5-accounts-subaccounts-ip-pools-all | List DIPPs delegated to subaccounts. |
| get-v3-ips | List account IPs. |
| get-v3-ips-ip | Get details about account IP. |
| get-v3-ips-ip-domains | Get all domains of an account where a specific IP is assigned. |
| get-v3-ip-pools | List dedicated IP pools of the account. |
| get-v3-ip-pools-pool-id | Get DIPP details. |
| get-v3-ip-pools-pool-id-domains | Get domains linked to DIPP. |
| get-v3-domain-tags | List all tags. |
| get-v3-domain-tag | Get a tag. |
| get-v3-domain-tag-stats-aggregates | Get aggregate stat types by tag. |
| get-v3-domain-tag-stats | Get stats by tag. |
| get-v3-domains-domain-tag-devices | List of supported devices. |
| get-v3-domains-domain-tag-providers | List of supported providers. |
| get-v3-domains-domain-tag-countries | List of supported country codes. |
| get-v3-domains-domain-limits-tag | Get tag limits. |
| get-v3-stats-total | Totals for entire account. |
| get-v3-domain-stats-total | Totals for entire domain. |
| get-v3-stats-total-domains | Totals for account domains for a single time resolution. |
| get-v3-stats-filter | Filtered/grouped totals for entire account. |
| get-v3-domain-aggregates-providers | Aggregate counts by ESP. |
| get-v3-domain-aggregates-devices | Aggregate counts by devices triggering events. |
| get-v3-domain-aggregates-countries | Aggregate counts by country. |
| post-v1-analytics-metrics | Query account metrics. |
| post-v1-analytics-usage-metrics | Query account usage metrics. |
| post-v1-analytics-logs | List logs. |
| get-v3-domainid-bounces-address | Lookup bounce record. |
| get-v3-domainid-bounces | List all bounces. |
| get-v3-domainid-unsubscribes-address | Lookup unsubscribe record. |
| get-v3-domainid-unsubscribes | List all unsubscribes. |
| get-v3-domainid-complaints-address | Lookup complaint record. |
| get-v3-domainid-complaints | List all complaints. |
| get-v3-domainid-whitelists-value | Lookup allowlist record. |
| get-v3-domainid-whitelists | List allowlist records for domain. |
| get-v3-routes | Get all routes. |
| get-v3-routes-id | Get a route. |
| put-v3-routes-id | Update a route. |
| get-v3-lists | Get mailing lists. |
| post-v3-lists | Create a mailing list. |
| get-v3-lists-address | Get a mailing list by address. |
| put-v3-lists-address | Update a mailing list. |
| get-lists-string-list_address-members | Get mailing lists members. |
| post-lists-string-list_address-members | Create a mailing list member. |
| get-lists-list_address-members-member_address | Get a member. |
| put-lists-list_address-members-member_address | Update a mailing list member. |
| get-v3-domain-name-templates | Get templates. |
| post-v3-domain-name-templates | Create a template. |
| get-v3-domain-name-templates-template-name | Get template. |
| put-v3-domain-name-templates-template-name | Update template. |
| get-v3-domain-name-templates-template-name-versions | Get all template versions. |
| post-v3-domain-name-templates-template-name-versions | Create a template version. |
| get-v3-domain-name-templates-template-name-versions-v | Get a version. |
| put-v3-domain-name-templates-template-name-versions-v | Update a version. |
| get-v1-bounce-classification-stats | List statistics, ordered by total bounces. |
| post-v2-bounce-classification-metrics | List statistic v2. |
| get-v5-accounts-limit-custom-monthly | Get current custom sending limit. |
| validate_email | Validate Address V4. |
| get_inbox_placement_result | Get Result Details. |
| get_preview_result | Get Test Results. |
Required configuration
- MAILGUN_API_KEYRequired
Your Mailgun API key.
- MAILGUN_API_REGIONOptional
API region: 'us' (default) or 'eu'.
- MAILGUN_MCP_TAGSOptional
Optional comma-separated tag filter: send, validate, optimize, inspect.
What you can do with it
Send and verify transactional email
An agent sends a message through a verified domain and confirms tracking and DNS settings are configured, so transactional mail goes out correctly the first time.
Diagnose deliverability
A deliverability copilot reads bounces, complaints, and unsubscribes, checks provider and device aggregates, and queries analytics logs to explain why a campaign underperformed.
FAQ
- Is it free?
- The MCP server is free and open source under Mailgun. You use it within your existing Mailgun plan and its API limits.
- Does it support remote/OAuth?
- No. Mailgun MCP runs locally over stdio via npx -y @mailgun/mcp-server and authenticates with a Mailgun API key plus an optional region. There is no hosted OAuth endpoint.
- Can it accidentally change my account?
- By design the server is read-only with a single exception: it can send (create) email. This lets agents explore account data freely without risking production changes.
- Why do the tool names look like API paths?
- Most tools are generated from Mailgun's OpenAPI spec, so their names are derived from the HTTP method and route (for example, post-v3-domain-name-messages sends an email). A few curated tools have friendly names like validate_email.