Key Takeaways

  • Mailgun API access: Yes, all Mailgun plans, starting with Free.
  • Mailgun MCP server: Official, local, Mailgun API key in the MAILGUN_API_KEY environment variable.
  • Mailgun pricing and limits: Each MCP tool call makes a Mailgun API request. The server has no client-side rate limiting; Mailgun's server-side API rate limits apply.
  • Mailgun connects with Claude, Claude Code, Gemini, Cursor, VS Code.

You want an AI agent to send or analyse email without building every API call. Mailgun provides API access on all plans from Free, and its official local MCP server uses an API key while Mailgun bills email volume by plan and overage.

For full seat pricing, plan limits and team workflows beyond developer endpoints, read our Mailgun review or compare category peers in Email Deliverability & Cold Email Infrastructure tools with an API.

What does the Mailgun API include?

Mailgun provides API access on All Mailgun plans, starting with Free using HTTP Basic Auth with username api and an API key.

What you need to knowDetail
Plan that includes itAll Mailgun plans, starting with Free
What it costsFree: $0/month with 100 emails/day. Basic: from $15/month with 10,000 emails/month, then from $1.80 per 1,000 extra emails.
Sign-inHTTP Basic Auth with username api and an API key
Rate limitsDefault rate limits, all per account: Messages: 80,000 API calls per 10 seconds. Logs: 200,000 recipients per second. Domains: 10 domains per second. All other endpoints, unless otherwise noted: 300 requests per second.
OpenAPI fileYes
Official SDKsPython, Ruby, PHP, Java, C#, Node.js, Go
WebhooksYes
DocsAPI documentation

What you can do with it

  • Send email as MIME content or as separate message parts
  • Retrieve stored messages and resend them
  • Query delivery metrics, statistics and event logs
  • Manage sending domains, tracking, templates and inbound routes
  • Receive Mailgun events through account-level or domain-level webhooks

Sources:Mailgun API integrationMailgun API overviewMailgun authenticationMailgun developer toolsMailgun messages APIMailgun webhooks

How does the Mailgun MCP server work?

Mailgun supports an official local MCP server authenticated with Mailgun API key in the MAILGUN_API_KEY environment variable.

What you need to knowDetail
Who makes itOfficial, run by Mailgun
Where it runsRuns on your computer
Address or package@mailgun/mcp-server, run locally over stdio with npx
Sign-inMailgun API key in the MAILGUN_API_KEY environment variable
UsageEach MCP tool call makes a Mailgun API request. The server has no client-side rate limiting; Mailgun's server-side API rate limits apply.
Works withClaudeClaude CodeGeminiCursorVS Code

Before you connect it

  • Use a dedicated API key scoped to the operations the agent needs.
  • The server runs on your machine, communicates only with Mailgun HTTPS APIs, and does not read local files or databases for tool execution.
  • It exposes read and update actions but no delete actions, so review tool-call confirmations because prompts can still cause unwanted updates.

See how sibling tools handle programmatic connections in MCP servers for email deliverability & cold email infrastructure tools.

Sources:Mailgun MCP server documentationMailgun MCP server repositoryMailgun MCP server README

Which MCP tools does Mailgun expose?

The Mailgun MCP server exposes 6 documented MCP tools for connected AI clients.

ToolWhat it doesAccess
post-v3-domain-messagesSend an emailChanges data
get-v4-domainsList sending domainsRead only
put-v4-domains-name-verifyRequest another DNS-record check for a domainChanges data
get_metrics_summaryRead key sending metricsRead only
post-v1-analytics-logsQuery event logsRead only
validate_emailValidate an email addressRead only

How do you connect Mailgun to your AI app?

Mailgun documents direct connection steps for Claude, Claude Code, Cursor, VS Code, Gemini.

Claude

  1. Install Node.js 20.12 or newer and create a Mailgun API key.
  2. In Claude settings, add @mailgun/mcp-server with npx and set MAILGUN_API_KEY in its environment.

Claude Code

  1. Run claude mcp add mailgun -e MAILGUN_API_KEY=YOUR-mailgun-api-key -- npx -y @mailgun/mcp-server.
  2. Run /mcp in Claude Code to confirm the Mailgun server is connected.

Cursor

  1. Open Cursor Settings, MCP, then Add new global MCP server.
  2. Add @mailgun/mcp-server with npx and set MAILGUN_API_KEY in its environment.

VS Code

  1. Add a mailgun server entry to settings.json under mcp.servers.
  2. Set its command to npx, its arguments to -y and @mailgun/mcp-server, and MAILGUN_API_KEY in its environment.

Gemini

  1. Add a mailgun mcpServers entry to ~/.gemini/settings.json.
  2. Set its command to npx, its arguments to -y and @mailgun/mcp-server, and MAILGUN_API_KEY in its environment.

How did we check Mailgun API and MCP access?

Mailgun verification summary: Every fact comes from the vendor's own pricing, documentation and help pages, read on the date shown. Last checked 27 Nov 2026 following how we check figures and our AI agent readiness study.

Sources:Mailgun API integrationMailgun API overviewMailgun authenticationMailgun developer toolsMailgun messages APIMailgun webhooksMailgun MCP server documentationMailgun MCP server repositoryMailgun MCP server README

What are common questions about Mailgun API and MCP?

Does Mailgun offer both an API and an MCP server?

Yes. Mailgun documents a REST API and an official MCP server that runs locally through the @mailgun/mcp-server package.

What does Mailgun API access cost?

API access is available on all Mailgun plans. The Free plan includes 100 emails per day, while Basic starts at $15 per month for 10,000 emails and has email overages from $1.80 per 1,000 emails.

What can the Mailgun MCP server change?

It can send email and perform update actions such as domain DNS checks. Mailgun says the MCP server does not expose delete operations.