Mailgun MCP Server▌
by mailgun
Mailgun MCP Server lets AI assistants send emails via the Mailgun API and view email delivery analytics for seamless AI
A Model Context Protocol server implementation that enables AI assistants like Claude Desktop to interact with Mailgun email services, allowing users to send emails and visualize email delivery statistics through natural language.
Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.
best for
- / Email marketing teams automating campaigns
- / Developers integrating email functionality
- / Support teams analyzing delivery issues
capabilities
- / Send emails through Mailgun
- / Retrieve and resend stored messages
- / Query email delivery analytics and metrics
- / Manage domains and DNS verification
- / Create and update email webhooks
- / Manage mailing lists and templates
what it does
Connects AI assistants to Mailgun email services for sending emails and analyzing delivery statistics through natural language commands.
about
Mailgun MCP Server is an official MCP server published by mailgun that provides AI assistants with tools and capabilities via the Model Context Protocol. Mailgun MCP Server lets AI assistants send emails via the Mailgun API and view email delivery analytics for seamless AI It is categorized under communication, analytics data.
how to install
You can install Mailgun MCP Server in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
Apache-2.0
Mailgun MCP Server is released under the Apache-2.0 license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
Mailgun MCP Server
Overview
A Model Context Protocol (MCP) server for Mailgun, enabling MCP-compatible AI clients to interact with the Mailgun email service.
Note: This MCP server runs locally on your machine. Mailgun does not currently offer a hosted version of this server.
Capabilities
- Messaging — Send emails, retrieve stored messages, resend messages
- Domains — View domain details, verify DNS configuration, manage tracking settings (click, open, unsubscribe)
- Webhooks — List, create, update, and delete event webhooks
- Routes — View and update inbound email routing rules
- Mailing Lists — Create and manage mailing lists and their members
- Templates — Create and manage email templates with versioning
- Analytics — Query sending metrics, usage metrics, and logs
- Stats — View aggregate statistics by domain, tag, provider, device, and country
- Suppressions — View bounces, unsubscribes, complaints, and allowlist entries
- IPs & IP Pools — View IP assignments and dedicated IP pool configuration
- Bounce Classification — Analyze bounce types and delivery issues
Prerequisites
- Node.js (v18 or higher)
- Mailgun account and API key
Quick Start
Configuration
Add the following to your MCP client configuration:
{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key",
"MAILGUN_API_REGION": "us"
}
}
}
}
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
MAILGUN_API_KEY | Yes | — | Your Mailgun API key |
MAILGUN_API_REGION | No | us | API region: us or eu |
Client-Specific Config Paths
- Claude Desktop (macOS):
~/Library/Application Support/Claude/claude_desktop_config.json - Claude Desktop (Windows):
%APPDATA%/Claude/claude_desktop_config.json - Claude Code: Run
claude mcp addor edit~/.claude.json
Sample Prompts
Send an Email
Can you send an email to EMAIL_HERE with a funny email body that makes it sound
like it's from the IT Desk from Office Space? Please use the sending domain
DOMAIN_HERE, and make the email from "postmaster@DOMAIN_HERE"!
Note: some MCP clients require a paid plan to invoke tools that send data. If sending fails silently, check your client's plan.
Fetch and Visualize Sending Statistics
Would you be able to make a chart with email delivery statistics for the past week?
Manage Templates
Create a welcome email template for new signups on my domain DOMAIN_HERE.
Include a personalized greeting and a call-to-action button.
Investigate Deliverability
Can you check the bounce classification stats for my account and tell me
what the most common bounce reasons are?
Troubleshoot DNS
Check the DNS verification status for my domain DOMAIN_HERE and tell me
if anything needs fixing.
Review Suppressions
Are there any unsubscribes or complaints for DOMAIN_HERE? Summarize the
top offenders.
Manage Routing Rules
List all my inbound routes and explain what each one does.
Create a Mailing List
Create a mailing list called announcements@DOMAIN_HERE and add these
members: [email protected], [email protected].
Compare Domains
Compare my sending volume and delivery rates across all my domains for
the past month.
Engagement by Region
Break down my email engagement by country and device for DOMAIN_HERE.
Review Tracking Settings
List all my domains and show which ones have tracking enabled for clicks
and opens.
Development
To run from source, clone the repository and use node directly:
git clone https://github.com/mailgun/mailgun-mcp-server.git
cd mailgun-mcp-server
npm install
npm test
In your MCP client config, replace the npx command with:
"command": "node",
"args": ["/path/to/mailgun-mcp-server/src/mailgun-mcp.js"]
Security Considerations
API key isolation
Your Mailgun API key is passed as an environment variable and is never exposed to the AI model itself — it is only used by the MCP server process to authenticate requests. The server does not log API keys, request parameters, or response data.
Local execution
The server runs locally on your machine. All communication with the Mailgun API is over HTTPS with TLS certificate validation enforced. No data is sent to third-party services beyond the Mailgun API.
API key permissions
Use a dedicated Mailgun API key with permissions scoped to only the operations you need. The server exposes read and update operations but does not expose any delete operations, which limits the blast radius of unintended actions.
Rate limiting
The server does not implement client-side rate limiting. Each tool call from the AI translates directly into a Mailgun API request. The server relies on Mailgun's server-side rate limits to prevent abuse — requests that exceed those limits will return an error to the AI assistant.
Prompt injection
As with any MCP server, a crafted or adversarial prompt could trick the AI assistant into calling operations you did not intend — for example, modifying tracking settings or reading mailing list members. Review your AI assistant's tool-call confirmations before approving actions, especially in untrusted prompt contexts.
Webhook URLs
Webhook create and update operations accept arbitrary URLs provided through the AI assistant. The MCP server passes these URLs to the Mailgun API without additional validation. Mailgun is responsible for validating webhook destinations. Ensure your AI assistant does not set webhook URLs to unintended internal or sensitive addresses.
Input validation
All tool parameters are validated against the Mailgun OpenAPI specification using Zod schemas. However, validation depends on the accuracy of the OpenAPI spec, and some edge-case parameters may fall back to permissive validation. The Mailgun API performs its own server-side validation as an additional layer of protection.
Debugging
The MCP server communicates over stdio. Refer to the MCP Debugging Guide for troubleshooting.
License
Apache 2.0 — see LICENSE for details.
Contributing
We welcome contributions! Please feel free to submit a Pull Request or open an Issue.
FAQ
- What is the Mailgun MCP Server MCP server?
- Mailgun MCP Server is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for Mailgun MCP Server?
- This profile displays 60 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.5 out of 5—verify behavior in your own environment before production use.
Use Cases▌
Extended AI Capabilities
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Context Enhancement
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Workflow Automation
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Implementation Guide▌
Prerequisites
- ›Claude Desktop 0.7.0+ or Cursor IDE with MCP support
- ›Basic understanding of MCP architecture and capabilities
- ›Access credentials for integrated services (if required)
- ›Willingness to experiment and iterate on configuration
Time Estimate
15-60 minutes depending on server complexity
Installation Steps
- 1.Install MCP server: npm install -g [package-name] or via GitHub
- 2.Add server configuration to ~/.claude/mcp.json
- 3.Provide required credentials and configuration
- 4.Restart Claude Desktop to load new server
- 5.Test basic functionality with simple prompts
- 6.Explore capabilities and experiment with use cases
- 7.Document successful patterns for reuse
Troubleshooting
- ⚠MCP server not loading: Check config syntax, verify installation
- ⚠Connection errors: Check network, firewall, credentials
- ⚠Feature not working: Read server docs, check required parameters
- ⚠Performance issues: Monitor resource usage, check for network latency
- ⚠Conflicts with other servers: Check port assignments, namespace collisions
Best Practices▌
✓ Do
- +Read server documentation thoroughly before setup
- +Start with simple use cases to validate functionality
- +Test in non-production environment first
- +Monitor resource usage and performance
- +Keep servers updated for bug fixes and new features
- +Document configuration for team members
- +Use environment variables for sensitive configuration
✗ Don't
- −Don't grant overly permissive access to MCP servers
- −Don't skip reading security considerations in docs
- −Don't expose sensitive data without proper controls
- −Don't run untrusted MCP servers without code review
- −Don't ignore error messages—investigate root cause
💡 Pro Tips
- ★Combine multiple MCP servers for powerful workflows
- ★Create custom MCP servers for your specific needs
- ★Share successful configurations with team
- ★Use MCP inspector for debugging
- ★Join MCP community for tips and troubleshooting
Technical Details▌
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
- Model Context Protocol (MCP)
- JSON-RPC 2.0
- stdio or HTTP transport
Compatibility
- Claude Desktop
- Cursor IDE
- Custom MCP clients
When to Use This▌
✓ Use When
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid When
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.
Integration▌
- →Tool composition: Chain multiple MCP tools in workflows
- →Context augmentation: Provide AI with relevant external data
- →Action delegation: Let AI execute tasks on external systems
- →Bidirectional sync: Keep AI context and external systems in sync
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
List & Promote Your MCP Server
Share your MCP server with the developer community
Ratings
4.5★★★★★60 reviews- ★★★★★Aarav Choi· Dec 24, 2024
Mailgun MCP Server reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Noor Srinivasan· Dec 20, 2024
We wired Mailgun MCP Server into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Ama Huang· Dec 12, 2024
Mailgun MCP Server reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Chaitanya Patil· Dec 4, 2024
Mailgun MCP Server has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Piyush G· Nov 23, 2024
Mailgun MCP Server reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Diego Chen· Nov 15, 2024
Mailgun MCP Server has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Nikhil Chen· Nov 11, 2024
Mailgun MCP Server is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Liam Ghosh· Nov 3, 2024
Mailgun MCP Server has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Liam Martinez· Oct 22, 2024
Mailgun MCP Server is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Shikha Mishra· Oct 14, 2024
We wired Mailgun MCP Server into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
showing 1-10 of 60