mailgun
Implementation of Model Context Protocol server for Mailgun APIs
claude mcp add --transport stdio mailgun-mailgun-mcp-server node /path/to/mailgun-mcp-server/src/mailgun-mcp.js \ --env MAILGUN_API_KEY="YOUR_MAILGUN_API_KEY" \ --env MAILGUN_API_REGION="us"
How to use
This MCP server enables AI clients to interact with Mailgun through the Model Context Protocol. It exposes tooling to manage messaging, domains, webhooks, routing, mailing lists, templates, analytics, stats, suppressions, IPs & IP pools, and bounce classification. With the server running locally, you can issue MCP-enabled tool calls that map to Mailgun API actions such as sending emails, listing domains, creating webhooks, and querying delivery statistics. The server handles authentication with your Mailgun API key and enforces TLS for communications with Mailgun. Use the provided environment variables to configure your API credentials and region, then call the appropriate MCP client commands to perform operations.
To use the server from an MCP client, ensure your client points to the local server and passes the necessary environment configuration. A typical setup involves starting the server process with Node.js and then configuring your MCP client to invoke the server via the defined command and arguments. You can interact with the server using your client’s MCP tool prompts, for example to send emails, manage domains, or fetch analytics data. The server supports a wide range of capabilities as listed in the README, including messaging, domains, webhooks, routes, mailing lists, templates, analytics, stats, suppressions, IPs & IP pools, and bounce classification. In client prompts, you’ll typically specify the desired operation and provide any required identifiers or parameters, and the MCP server will translate those into Mailgun API requests and return structured results.
How to install
Prerequisites:
- Node.js v18 or higher
- Access to a Mailgun account with an API key
- Clone the repository and install dependencies:
git clone https://github.com/mailgun/mailgun-mcp-server.git
cd mailgun-mcp-server
npm install
- Configure environment variables:
- Create a local environment file or export variables in your shell:
export MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
export MAILGUN_API_REGION=us # or eu
- Run the MCP server locally:
node /path/to/mailgun-mcp-server/src/mailgun-mcp.js
- (Optional) If you prefer the npx approach using the published MCP package, you can run:
npx -y @mailgun/mcp-server
- In your MCP client configuration, point to the local server and provide the required environment values (example below).
Additional notes
Notes and tips:
- Ensure MAILGUN_API_KEY has permissions only for the operations you intend to use. The server exposes read and update operations; delete actions are restricted to minimize risk.
- If you run the server behind a firewall, ensure the client can reach localhost or the configured host/port as appropriate for your environment.
- The MAILGUN_API_REGION can be set to us or eu depending on your Mailgun account region. If you encounter region-related errors, verify that the region matches your Mailgun account configuration.
- When testing prompts, enable tool-call confirmations in your MCP client to avoid unintended actions.
- For debugging, refer to the MCP Debugging Guide linked in the README and check that your environment variables are loaded correctly before making API requests.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.