M
Mailgun MCP
by @lesleslie
MCP server by lesleslie
Created 10/11/2025
Updated 2 months ago
README
Repository documentation and setup instructions
Mailgun MCP Server
This project implements a comprehensive MCP server for the Mailgun API using FastMCP.
Features
The server provides access to the full Mailgun API including:
- Email Management: Send emails with attachments, tags, and scheduled delivery
- Domain Management: List, create, update, delete, and verify domains
- Event Tracking: Get email events (opens, clicks, deliveries, etc.)
- Statistics: Get email statistics and metrics
- Suppression Lists: Manage bounces, complaints, and unsubscribes
- Route Management: Create and manage routing rules
- Template Management: Create and manage email templates
- Webhook Management: Configure webhooks for event notifications
Usage
-
Set environment variables:
export MAILGUN_API_KEY="YOUR_API_KEY" export MAILGUN_DOMAIN="YOUR_DOMAIN" -
Run the server:
uvicorn mailgun_mcp.main:app --reload -
Send a test email:
Use the Mailgun API to send an email via an HTTP POST request with proper authentication. For detailed instructions, see the Mailgun API documentation.
Available Tools
The MCP server exposes the following tools:
Email Management
send_message: Send an email message via Mailgun API with support for:- Basic email fields (from, to, subject, text)
- Optional fields (cc, bcc, html)
- Attachments
- Tags
- Scheduled delivery
Domain Management
get_domains: Get a list of domains from Mailgunget_domain: Get information about a specific domain from Mailguncreate_domain: Create a new domain in Mailgundelete_domain: Delete a domain from Mailgunverify_domain: Trigger verification of a domain in Mailgun
Events & Logs
get_events: Get email events (opens, clicks, deliveries, etc.) from Mailgun
Statistics
get_stats: Get email statistics from Mailgun
Suppression Management
get_bounces: Get email bounces from Mailgunadd_bounce: Add an email address to the bounce list in Mailgundelete_bounce: Remove an email address from the bounce list in Mailgunget_complaints: Get email complaints from Mailgunadd_complaint: Add an email address to the complaints list in Mailgundelete_complaint: Remove an email address from the complaints list in Mailgunget_unsubscribes: Get unsubscribed email addresses from Mailgunadd_unsubscribe: Add an email address to the unsubscribes list in Mailgundelete_unsubscribe: Remove an email address from the unsubscribes list in Mailgun
Route Management
get_routes: Get routes from Mailgunget_route: Get a specific route from Mailguncreate_route: Create a new route in Mailgunupdate_route: Update an existing route in Mailgundelete_route: Delete a route from Mailgun
Template Management
get_templates: Get a list of templates from Mailgunget_template: Get information about a specific template from Mailguncreate_template: Create a new template in Mailgunupdate_template: Update an existing template in Mailgundelete_template: Delete a template from Mailgun
Webhook Management
get_webhooks: Get all webhooks from Mailgunget_webhook: Get a specific webhook from Mailguncreate_webhook: Create or update a webhook in Mailgundelete_webhook: Delete a webhook from Mailgun
Quick Setup
Installation guide for this server
Installation Command (package not published)
git clone https://github.com/lesleslie/mailgun-mcp
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.
Cursor configuration (mcp.json)
{
"mcpServers": {
"lesleslie-mailgun-mcp": {
"command": "git",
"args": [
"clone",
"https://github.com/lesleslie/mailgun-mcp"
]
}
}
}
Author Servers
Other servers by lesleslie