# Mailgun MCP Server [Official] [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/mailgun/mailgun-mcp-server  
**GitHub Stars:** 65  
**npm Downloads (last month):** 11523  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mailgun-mcp-server

## Description
Mailgun's official MCP server. Lets AI assistants send email and work with the Mailgun API: domains, events, logs, stats, suppressions, templates and email validation. Runs over stdio with npx -y @mailgun/mcp-server and a MAILGUN_API_KEY.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mailgun-mcp-server": {
    "command": "npx",
    "args": ["-y","@mailgun/mcp-server"],
    "env": {
      "MAILGUN_API_KEY": "",
      "MAILGUN_API_REGION": "",
      "MAILGUN_API_HOSTNAME": "",
      "MAILGUN_MCP_TAGS": ""
    }
  }
}
```

**Requires environment variables:** `MAILGUN_API_KEY`, `MAILGUN_API_REGION`, `MAILGUN_API_HOSTNAME`, `MAILGUN_MCP_TAGS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Mailgun MCP Server does

Mailgun MCP Server connects MCP-compatible AI clients to the Mailgun API. Its tools cover both email operations and account administration, including sending, retrieving, and resending messages; inspecting domains and DNS verification; managing tracking settings; and working with event webhooks, inbound routes, mailing lists, and email templates.

The server also supports operational and deliverability workflows. Agents can query sending and usage metrics, inspect event logs, review aggregate statistics by domain or other dimensions, examine bounces, unsubscribes, complaints, and allowlist entries, and analyze bounce classifications. Additional tools validate email addresses, retrieve inbox-placement test results, and inspect email rendering results across clients. IP assignments, dedicated IP pools, and account sending limits are also available.

Delete operations are not exposed. The available operations are limited to reads and updates, along with actions such as sending messages and validating addresses.

## How it works

At startup, the server reads a bundled Mailgun OpenAPI specification and turns an allowlisted set of endpoints into MCP tools. Zod schemas generated from that specification describe each tool’s inputs. Tools carry product tags such as `send`, `validate`, `optimize`, and `inspect`, as well as toolset and read-only metadata.

The default mode loads the full tool collection. Tag filtering can restrict startup to selected products or `send.<group>` toolsets. Dynamic mode loads a smaller core collection and provides tools that let the model request additional toolsets when needed, reducing the number of definitions initially sent to the model.

## Setup and configuration

Node.js 20.12 or newer, a Mailgun account, and a Mailgun API key are required. The npm package runs over stdio and can generally be launched on demand with:

```bash
npx -y @mailgun/mcp-server
```

Set `MAILGUN_API_KEY` to the key from Mailgun’s API security settings. `MAILGUN_API_REGION` selects the `us` or `eu` API region and defaults to `us`. `MAILGUN_API_HOSTNAME` can override the hostname derived from the region. For tool loading, set `MAILGUN_MCP_TAGS` to a comma-separated list, a supported tag or toolset, or `dynamic`; a `--tags` command-line argument takes precedence.

The server can be configured in Claude Desktop, Claude Code, Cursor, Codex, VS Code with GitHub Copilot, Windsurf, and Gemini CLI. EU-hosted Mailgun accounts should use `MAILGUN_API_REGION=eu` unless an explicit API hostname is configured.

## Tools and capabilities

Representative capability groups include:

- Send, retrieve, and resend Mailgun messages.
- List domains, inspect DNS records, recheck verification, and manage tracking options.
- Query metrics, usage data, event logs, aggregate statistics, and bounce classifications.
- Manage webhooks, inbound routes, mailing lists, templates, and template versions.
- Review suppressions, IP assignments, IP pools, and monthly account limits.
- Validate addresses and retrieve Optimize inbox-placement or Inspect rendering results.

## Limitations and notes

The server runs locally on the user’s machine and communicates through stdio; Mailgun does not provide a hosted version of it. Access depends on the permissions and validity of the configured Mailgun API key. Tool loading can be narrowed with tags, which is useful when an assistant only needs a specific Mailgun workflow. No delete endpoint is exposed through the MCP interface.

_Full upstream README: https://allmcps.com/mcp/mailgun-mcp-server/readme_

