
An AI receptionist platform with an MCP server for accessing business calls, contacts and appointments from AI assistants.

A local stdio Model Context Protocol server that gives AI agents a workflow-oriented interface to Mailgun for sending email, diagnosing deliverability, and managing account operations.
Mailgun MCP Server is cataloged as an MCP server attributed to mailgun. A local stdio Model Context Protocol server that gives AI agents a workflow-oriented interface to Mailgun for sending email, diagnosing deliverability, and managing account operations. It is categorized under communication social. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Apache 2.0. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Mailgun MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
No. The server runs locally on your machine and communicates over stdio, and Mailgun does not currently offer a hosted version.
No. Tools are limited to read and update operations, and no delete operations are exposed.
By default it loads every tool at startup, but with dynamic tags it loads a small core set plus tools the model uses to load more toolsets on demand; tag filtering loads a fixed set of tools instead.
README.md · 37e4eb36c0b4 · Fetched 2026-11-13 08:59:20 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A Model Context Protocol (MCP) server for Mailgun that gives AI agents a practical, workflow-oriented interface to send email, diagnose deliverability, and manage account operations.
[!NOTE] This MCP server runs locally on your machine and communicates over stdio. Mailgun does not currently offer a hosted version of this server.
validate)optimize)inspect)The labels above (validate, optimize, inspect) are the product tags used by tag filtering. Every other capability is registered under the send tag, which is split into send.<group> toolsets.
[!NOTE] Tools are limited to read and update operations — no delete operations are exposed, which keeps the blast radius of an unintended action small. See Security Considerations.
The server is OpenAPI driven. At startup it parses a bundled Mailgun OpenAPI spec and registers a curated allowlist of endpoints as MCP tools, generating each tool's input schema (via Zod) from the spec. Every tool is annotated with a Mailgun product tag (send, validate, optimize, or inspect), the toolset it belongs to, and whether it only reads data.
By default the server loads every tool at startup. With --tags dynamic, it loads a small core set of tools plus three tools the model uses to load more toolsets on demand, which keeps the tool definitions sent to the model small. Tag filtering loads a fixed set of tools at startup instead, so a given workflow can expose exactly the products it needs.
The server is published to npm as @mailgun/mcp-server and runs over stdio. Most clients can launch it on demand with npx, so there's nothing to install globally. In each snippet below, replace YOUR-mailgun-api-key with a key from your Mailgun API security settings.
[!TIP] If your account is hosted in Mailgun's EU region, add
"MAILGUN_API_REGION": "eu"to theenvblock (or-e MAILGUN_API_REGION=euon the CLI). It defaults tous.
claude mcp add mailgun -e MAILGUN_API_KEY=YOUR-mailgun-api-key -- npx -y @mailgun/mcp-server
Then run /mcp in Claude Code to confirm the mailgun server is connected.
Open Settings → Developer → Edit Config, or edit the file directly:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key",
"MAILGUN_API_REGION": "us"
}
}
}
}
Open the command palette and choose Cursor Settings → MCP → Add new global MCP server, then add:
{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key"
}
}
}
}
codex mcp add mailgun \
--env MAILGUN_API_KEY=YOUR-mailgun-api-key \
-- npx -y @mailgun/mcp-server
Add the following to your settings.json:
{
"mcp": {
"servers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key"
}
}
}
}
}
{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key"
}
}
}
}
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key"
}
}
}
}
| Variable | Required | Default | Description |
|---|---|---|---|
MAILGUN_API_KEY | Yes | — | Your Mailgun API key |
MAILGUN_API_REGION | No | us | API region: us or eu |
MAILGUN_API_HOSTNAME | No | (derived from region) | Override the API hostname (e.g. api.eu.mailgun.net). Takes precedence over the region. |
MAILGUN_MCP_TAGS | No | (all) | Comma-separated tags or toolsets to load, or dynamic for core tools with more loaded on demand. Equivalent to --tags. The CLI flag takes precedence. |
Pass flags after the package name in your client's args (e.g. ["-y", "@mailgun/mcp-server", "--tags", "validate,inspect"]).
| Flag | Description |
|---|---|
--tags <list> | Comma-separated tags or toolsets to load (default: all). Valid: all, dynamic, core, send, validate, optimize, inspect, and the send.<group> toolsets. |
--list-tags | Print every valid --tags value with a description and exit. |
--help, -h | Show usage and exit. |
With --tags dynamic (or MAILGUN_MCP_TAGS=dynamic), the server starts with these core tools:
| Tool | Purpose |
|---|---|
post-v3-domain-messages | Send an email |
get-v4-domains | List domains |
get-v4-domains-name | Domain details and DNS records |
put-v4-domains-name-verify | Re-check a domain's DNS records |
get-v3-domains-name-tracking | Tracking settings |
get_metrics_summary | Summary of key sending metrics |
post-v1-analytics-metrics | Query account metrics |
post-v1-analytics-logs | Query event logs |
post-v2-bounce-classification-metrics | Bounce classification metrics |
get-v3-domain-bounces | List bounces |
get-v3-domain-bounces-address | Look up a bounce record |
get-v3-domain-unsubscribes | List unsubscribes |
get-v3-domain-complaints | List complaints |
get-v3-domain-templates | List templates |
validate_email | Validate an email address |
Every tool belongs to a toolset. The model loads the rest of a toolset when a task needs it:
| Toolset | Tools | Contents |
|---|---|---|
send.messages | 3 | Send email; retrieve and resend stored messages |
send.domains | 8 | Domains, DNS verification, sending queues, tracking settings |
send.webhooks | 4 | Domain webhooks |
send.account | 8 | Account IPs, dedicated IP pools, custom sending limits |
send.message_tags | 8 | Message tags, stats by tag, tag limits |
send.analytics | 12 | Stats and aggregates, analytics metrics and logs, bounce classification |
send.suppressions | 8 | Bounces, unsubscribes, complaints, allowlist |
send.routes | 3 | Inbound routes |
send.lists | 8 | Mailing lists and members |
send.templates | 8 | Templates and template versions |
validate | 1 | Email address validation |
optimize | 1 | Inbox placement test results |
inspect | 1 | Email preview test results |
The model loads toolsets with three extra tools:
mailgun_list_toolsets lists every toolset and its tools, marking which are loaded and which change data. Given a tool name, it returns that tool's input schema instead.mailgun_enable_toolset loads one or more toolsets. The server then notifies the client that its tool list changed (notifications/tools/list_changed), and the new tools appear alongside the core ones. The response lists the new tools without their input schemas, which come with the updated tool list.mailgun_call_tool runs a read-only tool by name, whether or not its toolset is loaded. It's a fallback for clients that don't refresh their tool list after a change. It refuses core tools and tools that change data, so those always run as their own tool call.Loaded toolsets last until the client disconnects. On-demand loading needs a client that refreshes its tool list when the server reports a change; Claude Code does. In clients that don't, newly loaded tools won't appear: read-only tools still work through mailgun_call_tool, and tools that change data need the default (all tools) or --tags, for example --tags core,send.templates.
Setting --tags or MAILGUN_MCP_TAGS to anything other than dynamic loads exactly the matching tools at startup, without the loading tools. Use it to narrow the tools shown to the model (for example, only validation tools for a workflow that doesn't send email).
Valid values (run --list-tags for descriptions):
all — every tool (the default)dynamic — the core tools, with other toolsets loaded on demand. Use it on its own; combining it with other values fails at startup.core — only the core tools listed abovesend, validate, optimize, inspect — every tool for that product (send covers every send.<group> toolset)send.templatesFiltering uses OR semantics: a tool is loaded if it matches any value in the list. For example, core,send.templates loads the core tools plus every template tool.
Via CLI flag — pass --tags in your MCP client config's args:
{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server", "--tags", "validate,inspect"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key"
}
}
}
}
Via environment variable — set MAILGUN_MCP_TAGS (CLI flag wins if both are present):
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key",
"MAILGUN_MCP_TAGS": "validate,inspect"
}
[!TIP] Run the binary with
--list-tagsto print every valid value, or--helpfor full usage. Unknown values are rejected at startup with a clear error message.
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.
Would you be able to make a chart with email delivery statistics for the past week?
Create a welcome email template for new signups on my domain DOMAIN_HERE.
Include a personalized greeting and a call-to-action button.
Can you check the bounce classification stats for my account and tell me
what the most common bounce reasons are?
Check the DNS verification status for my domain DOMAIN_HERE and tell me
if anything needs fixing.
Are there any unsubscribes or complaints for DOMAIN_HERE? Summarize the
top offenders.
List all my inbound routes and explain what each one does.
Create a mailing list called announcements@DOMAIN_HERE and add these
members: alice@example.com, bob@example.com.
Compare my sending volume and delivery rates across all my domains for
the past month.
Break down my email engagement by country and device for DOMAIN_HERE.
List all my domains and show which ones have tracking enabled for clicks
and opens.
Validate the email address EMAIL_HERE and tell me whether it's safe to send to.
Pull the inbox placement results for seed test RESULT_ID_HERE and summarize
where my message landed (inbox, spam, or missing) by provider.
Get the email preview results for test TEST_ID_HERE and tell me if the email
renders correctly across clients.
The server is written in TypeScript. Clone, install, build, and test:
git clone https://github.com/mailgun/mailgun-mcp-server.git
cd mailgun-mcp-server
npm install
npm run build
npm test
npm run build compiles src/ to dist/ and copies the bundled OpenAPI spec. Point your MCP client at the built entry instead of npx (use an absolute path):
{
"mcpServers": {
"mailgun": {
"command": "node",
"args": ["/absolute/path/to/mailgun-mcp-server/dist/mailgun-mcp.js"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key"
}
}
}
}
MCP servers are long-lived stdio processes that don't hot-reload, so the loop is: rebuild on save, then reconnect the client to pick up changes.
Run npm run build once so dist/openapi.yaml is in place.
Keep the TypeScript compiler running to rebuild dist/ on every save:
npx tsc --watch
Point a separate MCP client (or MCP Inspector, below) at dist/mailgun-mcp.js. After a change, restart the MCP client session to load the new build.
The MCP Inspector lets you exercise tools without a full client. Build first, then launch it against the built server:
npm run build
MAILGUN_API_KEY=YOUR-mailgun-api-key npx @modelcontextprotocol/inspector node dist/mailgun-mcp.js
Open the Inspector UI, click Connect, then use List Tools to verify the server is working. To test a filtered toolset, append flags after the server path:
MAILGUN_API_KEY=YOUR-mailgun-api-key npx @modelcontextprotocol/inspector node dist/mailgun-mcp.js --tags validate,inspect
npm install installs a git pre-commit hook (via husky) that runs oxlint --fix and oxfmt on staged TypeScript/JavaScript files and runs npm run check:versions. Fixable issues are auto-fixed and re-staged; commits that introduce unfixable lint errors or version-sync mismatches are rejected. If you already had a local clone before this change, run npm install once to install the hook.
Endpoints are grouped by toolset in endpointGroups. A plain string entry takes its product tag from its toolset (send.templates → send) and is treated as read-only only if it's a GET. Use the object form of EndpointEntry to set a tool name, mark a tool as core (loaded at startup in dynamic mode), or mark a POST that only queries data as readOnly: true.
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.
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.
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.
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.
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.
Every tool carries the MCP readOnlyHint annotation, so clients can tell tools that only read data from tools that change it (for example when asking for approval). mailgun_list_toolsets and mailgun_call_tool are read-only. mailgun_enable_toolset changes which tools the session sees, so it isn't marked read-only, but it never changes anything in Mailgun. mailgun_call_tool runs only read-only tools that aren't in the core set, so approving it can never send email or change account settings. Tools that change data always run as their own tool call.
Loading toolsets on demand reduces what the model sees; it isn't an access control, because the model can load any toolset. To limit which tools the server exposes at all, use --tags.
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.
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.
The MCP server communicates over stdio. Refer to the MCP Debugging Guide for troubleshooting.
Apache 2.0 — see LICENSE for details.
We welcome contributions! Please feel free to submit a Pull Request or open an Issue.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Mailgun MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mailgun-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

An AI receptionist platform with an MCP server for accessing business calls, contacts and appointments from AI assistants.
Pidgeon provides an MCP server and an email inbox API that gives AI agents their own addresses for sending, awaiting, and replying to email.

A Telegram CLI with background sync that can run an optional MCP server for a personal account using MTProto, not the bot API.