# Mailgun

> Manage Mailgun messaging, domains, webhooks, and analytics from an AI agent.

[Canonical HTML page](https://top-mcps.com/mcp/mailgun) · [server.json](https://top-mcps.com/mcp/mailgun.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

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

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
# export MAILGUN_API_KEY=your_mailgun_key
# export MAILGUN_API_REGION=us
claude mcp add mailgun -- npx -y @mailgun/mcp-server
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

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

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "mailgun": {
      "command": "npx",
      "args": [
        "-y",
        "@mailgun/mcp-server"
      ],
      "env": {
        "MAILGUN_API_KEY": "${MAILGUN_API_KEY}",
        "MAILGUN_API_REGION": "${MAILGUN_API_REGION}"
      }
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

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

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

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

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": [
            "-y",
            "@mailgun/mcp-server"
          ],
          "env": {
            "MAILGUN_API_KEY": "${MAILGUN_API_KEY}",
            "MAILGUN_API_REGION": "${MAILGUN_API_REGION}"
          }
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.mailgun]
command = "npx"
args = [
  "-y",
  "@mailgun/mcp-server",
]
env = { MAILGUN_API_KEY = "${MAILGUN_API_KEY}", MAILGUN_API_REGION = "${MAILGUN_API_REGION}" }
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "mailgun": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@mailgun/mcp-server"
        ]
      },
      "env": {
        "MAILGUN_API_KEY": "${MAILGUN_API_KEY}",
        "MAILGUN_API_REGION": "${MAILGUN_API_REGION}"
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

Mailgun doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Mailgun
- **Transport:** stdio
- **Auth model:** API key
- **Required secrets:** MAILGUN_API_KEY, MAILGUN_API_REGION
- **Supported clients:** Claude, Cursor, Any MCP-compatible client, Mailgun accounts
- **License:** Apache-2.0
- **Language:** TypeScript
- **Latest version:** latest
- **Last verified:** 2026-05-27
- **GitHub stars:** 57 (fetched 2026-06-02T11:55:52.245Z)
- **Score:** 79/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/mailgun/mailgun-mcp-server

## Quick answer

**What it does.** Surfaces Mailgun operations as MCP tools: send/retrieve/resend messages, manage domains and DNS, configure webhooks, define routes, manage mailing lists and templates, query analytics and suppressions.

**Best for:**
- Operational Mailgun ops (routes, suppressions, IPs)
- DNS and domain verification
- Delivery analytics queries
- Mailing list and template CRUD
- Webhook management

**Not for:**
- Greenfield projects (modern API ergonomics — try Resend)
- Volumes high enough to hit per-second rate limits via agent
- Vendor-neutral workflows

## Description

The official Mailgun MCP exposes the full Mailgun surface — messaging, domains, webhooks, routes, mailing lists, templates, analytics, suppressions, IP pools. API-key auth, Apache-2.0, with stdio transport.

## Why it matters

Mailgun is the long-time canonical transactional email provider. The official MCP lets an agent handle the operational surface (DNS, suppressions, route changes) that is usually painful via the dashboard.

## Key features

- 50+ tools across 10 surfaces
- US and EU region support via `MAILGUN_API_REGION`
- API-key auth, never exposed to model
- Apache-2.0, vendor-maintained
- Bounce classification + delivery diagnostics

## FAQ

### How is auth scoped?

API key via `MAILGUN_API_KEY`. Never exposed to the model — used server-side only.

### US or EU region?

Set `MAILGUN_API_REGION` to `us` (default) or `eu` to hit the right datacenter.

### Is it official?

Yes — maintained by Mailgun at github.com/mailgun/mailgun-mcp-server under Apache-2.0.

## Changelog

- **2026-05-27** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-06-01** — Initial directory listing.
