Mailgun MCP Server
OfficialMailgun MCP 服务器
概述
一个用于 Mailgun 的 模型上下文协议 (MCP) 服务器,为 AI 智能体提供了一个实用的、面向工作流的接口,用于发送电子邮件、诊断投递能力以及管理账户操作。
注意: 此 MCP 服务器在您的本地机器上运行。Mailgun 目前不提供此服务器的托管版本。
功能
消息 — 发送电子邮件、检索已存储的消息、重新发送消息
域名 — 查看域名详情、验证 DNS 配置、管理跟踪设置(点击、打开、退订)
Webhook — 列出、创建、更新和删除事件 Webhook
路由 — 查看和更新入站电子邮件路由规则
邮件列表 — 创建和管理邮件列表及其成员
模板 — 创建和管理带有版本控制的电子邮件模板
分析 — 查询发送指标、使用指标和日志
统计 — 按域名、标签、提供商、设备和国家/地区查看汇总统计信息
抑制列表 — 查看退信、退订、投诉和允许列表条目
IP 和 IP 池 — 查看 IP 分配和专用 IP 池配置
退信分类 — 分析退信类型和投递问题
Related MCP server: Enhanced Gmail MCP Server
先决条件
Node.js (v20.12 或更高版本)
Mailgun 账户和 API 密钥
快速入门
配置
将以下内容添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"mailgun": {
"command": "npx",
"args": ["-y", "@mailgun/mcp-server"],
"env": {
"MAILGUN_API_KEY": "YOUR-mailgun-api-key",
"MAILGUN_API_REGION": "us"
}
}
}
}环境变量
变量 | 必需 | 默认值 | 描述 |
| 是 | — | 您的 Mailgun API 密钥 |
| 否 |
| API 区域: |
客户端特定配置路径
Claude Desktop (macOS):
~/Library/Application Support/Claude/claude_desktop_config.jsonClaude Desktop (Windows):
%APPDATA%/Claude/claude_desktop_config.jsonClaude Code: 运行
claude mcp add或编辑~/.claude.json
示例提示词
发送电子邮件
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"!注意:某些 MCP 客户端需要付费计划才能调用发送数据的工具。如果发送静默失败,请检查您的客户端计划。
获取并可视化发送统计信息
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?排除 DNS 故障
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.开发
要从源代码运行,请克隆存储库并直接使用 node:
git clone https://github.com/mailgun/mailgun-mcp-server.git
cd mailgun-mcp-server
npm install
npm test在您的 MCP 客户端配置中,将 npx 命令替换为:
"command": "node",
"args": ["/path/to/mailgun-mcp-server/src/mailgun-mcp.js"]安全注意事项
API 密钥隔离
您的 Mailgun API 密钥作为环境变量传递,绝不会暴露给 AI 模型本身 — 它仅由 MCP 服务器进程用于验证请求。服务器不会记录 API 密钥、请求参数或响应数据。
本地执行
服务器在您的本地机器上运行。与 Mailgun API 的所有通信均通过强制执行 TLS 证书验证的 HTTPS 进行。除 Mailgun API 外,不会向第三方服务发送任何数据。
API 密钥权限
使用仅限于您所需操作权限的专用 Mailgun API 密钥。服务器公开读取和更新操作,但不公开任何删除操作,这限制了意外操作的影响范围。
速率限制
服务器不实现客户端速率限制。来自 AI 的每个工具调用都会直接转换为 Mailgun API 请求。服务器依赖 Mailgun 的服务器端速率限制来防止滥用 — 超过这些限制的请求将向 AI 助手返回错误。
提示词注入
与任何 MCP 服务器一样,精心设计的或对抗性的提示词可能会诱骗 AI 助手调用您未预期的操作 — 例如,修改跟踪设置或读取邮件列表成员。在批准操作之前,请检查 AI 助手的工具调用确认,特别是在不受信任的提示词上下文中。
Webhook URL
Webhook 创建和更新操作接受通过 AI 助手提供的任意 URL。MCP 服务器将这些 URL 传递给 Mailgun API 而无需额外验证。Mailgun 负责验证 Webhook 目标。请确保您的 AI 助手不会将 Webhook URL 设置为意外的内部或敏感地址。
输入验证
所有工具参数均使用 Zod 模式根据 Mailgun OpenAPI 规范进行验证。但是,验证取决于 OpenAPI 规范的准确性,某些边缘情况参数可能会回退到宽松验证。Mailgun API 执行其自己的服务器端验证作为额外的保护层。
调试
MCP 服务器通过 stdio 进行通信。有关故障排除,请参阅 MCP 调试指南。
许可证
Apache 2.0 — 详情请参阅 LICENSE。
贡献
我们欢迎贡献!请随时提交 Pull Request 或开启 Issue。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides a seamless email management interface through Claude, allowing users to search, read, and send emails directly through natural language conversations.4114MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities including sending, reading, organizing, searching, and managing drafts and labels.21GPL 3.0
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude AI to interact with Gmail, supporting email sending, reading, searching, labeling, draft management, and batch operations through natural language commands.2MIT
- AlicenseCqualityBmaintenanceA Model Context Protocol server that enables AI models to send emails via simple tool calls, supporting both plain text and HTML formats with JWT authentication.11813ISC
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mailgun/mailgun-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server