Migadu MCP for Cloudflare Workers
Provides tools for administering Migadu email hosting, including domains and DNS records/diagnostics, mailboxes, aliases, sending identities, external forwardings, and routing rewrites, with read/write management operations.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Migadu MCP for Cloudflare Workers
将 Michaelzag/migadu-mcp 的邮箱管理能力移植为 TypeScript / Cloudflare Workers 远程 MCP。无 Python、容器、数据库或 Durable Object 依赖。上游参考提交:7b61cb83331003335337dbb40a96e821a33765c0;保留原 MIT 许可,见 LICENSE。
功能与验证状态
35 个邮箱管理工具、1 个域名开通提示;
/mcp使用带 Bearer 认证的无状态 Streamable HTTP。/health只报告进程存活,不证明 Migadu 凭据有效。已验证 TypeScript、协议/API 映射测试和真实 workerd 运行时的出站请求;本地测试使用模拟响应和虚构凭据。
已在私有部署中验证真实 API、临时邮箱创建/修改/删除、双向邮件投递,以及通过 Cloudflare MCP 门户调用。未逐一验证全部工具的写操作,自动回复和身份页脚字段仍需实测。
此仓库仅提供自托管代码和配置示例。部署到自己的 Cloudflare 账户,并使用自己的 Migadu 凭据;仓库不包含共享服务、真实凭据或私人验收记录。
Related MCP server: Remote MCP Server (Authless)
与 Python 上游的接口差异
这是 Workers 移植版,不是原 Python 包的即插即用替换。保留 35 个工具名称;参数改为显式 domain 和单个实体,例如 local_part、mailbox。不再使用隐式默认域名、target 地址解析或批量 items。更新字段集中于 settings,批量工作由 Agent 逐项调用并记录结果。
保留域名开通提示 domain_onboarding;不移植原包的资源 URI、其他两个提示或输出摘要器。返回超过 1 MiB 会明确报错,请改查具体实体。
类型 | 工具 |
域名(8) |
|
邮箱(7) |
|
别名(5) |
|
发信身份(5) |
|
外部转发(5) |
|
路由规则(5) |
|
API 方法和字段按 Migadu 官方文档核对。自动回复和身份页脚字段来自社区项目,官方页面未完整列出,需真实账号验证后再启用这些工具。此服务不读取邮件正文,也不提供 SMTP 发信或 Cloudflare DNS 写入。
本地使用
需要 Node.js 22.12+。安装版本由 lockfile 固定。
npm ci
cp .dev.vars.example .dev.vars
# 在本机编辑 .dev.vars,填入凭据;该文件已被 Git 忽略。
npm run dev本地入口为 http://localhost:8787/mcp。MCP 客户端须发送 Authorization: Bearer <MCP_AUTH_TOKEN>。请求参数遵循 tools/list 返回的 schema。服务端之间的调用通常没有 Origin;带 Origin 的请求仅接受同源或 ALLOWED_ORIGINS 中逗号分隔的精确来源,不开放通配 CORS。
npm run types
npm run typecheck
npm test
npm run buildbuild 只执行 wrangler deploy --dry-run,不会发布。compatibility_date 固定为安装的 workerd 支持的 2026-11-29,不依赖本机时区当天日期。
Cloudflare 部署
部署前确认 wrangler.jsonc 中的 Worker 名称 migadu-mcp 没有与已有服务冲突,以及 Wrangler 选中了正确账户。
只需要三个 Worker Secret:
Secret | 用途 |
| Migadu 管理账户的邮箱 |
| 在 Migadu My Account → API Keys 创建的专用 API Key |
| 门户访问此 Worker 的独立随机令牌,至少 32 字符;不要复用 Migadu API Key |
npx wrangler whoami
npx wrangler secret put MIGADU_EMAIL
npx wrangler secret put MIGADU_API_KEY
npx wrangler secret put MCP_AUTH_TOKEN
npm run deploy按交互提示输入 Secret,不放在命令参数、Git 或聊天中。Worker 不保存邮箱密码;密码设置请求直接转交 Migadu,返回内容会遮盖密码和凭据。未配置凭据时 /mcp 返回 503;无效访问令牌返回 401。
部署完成后使用 Wrangler 输出的地址,例如 https://migadu-mcp.<your-subdomain>.workers.dev/mcp。需要 Bearer 认证;普通浏览器访问不是 MCP 调用。
加入 Cloudflare MCP 门户
按 Cloudflare MCP Portals 文档操作:
在 Zero Trust → Access controls → MCP Portals → MCP servers 新增上游,名称 Migadu、Server ID
migadu,填写实际 Worker/mcpURL。认证选 Bearer,值填
MCP_AUTH_TOKEN。若使用自定义标头,则填Authorization: Bearer <MCP_AUTH_TOKEN>。Migadu API Key 只留在 Worker Secret 中。沿用仅本人访问策略;将 Ready 的上游加入你的现有门户。无需新建门户或单独实现 OAuth,客户端继续通过门户原有登录。
在门户选择所需工具。令牌持有者可以直接调用 Worker 的全部工具;门户的工具过滤不等于 Worker 侧逐工具授权。此版本面向本人管理账号,不是多租户服务。
在客户端重新连接/刷新工具,调用
list_domains、get_domain和get_domain_records做只读验收。随后用明确指定的测试域名和邮箱做写入验收。
Agent 设置域名邮箱的流程
查询现有域名与 DNS,识别是否已有邮箱服务。
create_domain({"domain":"example.com"}),默认使用外部 DNS。get_domain_records({"domain":"example.com"})。通过已有 DNS 管理工具应用返回的验证记录、MX、SPF、DKIM 和 DMARC;需要单独的 DNS 写权限。已有 MX/SPF/DMARC 要先核对,不能盲目覆盖。
get_domain_diagnostics({"domain":"example.com"});DNS 生效后activate_domain({"domain":"example.com"})。虽然 Migadu 激活接口用 GET,这里明确标为写操作。创建邮箱。例如以下调用会发送密码设置邀请邮件,只有用户授权邀请时才执行:
{
"domain": "example.com",
"local_part": "support",
"name": "Customer Support",
"password_method": "invitation",
"password_recovery_email": "owner@example.com"
}通过
get_mailbox确认配置。实际收发需要另做邮件测试,不能仅凭域名激活就宣称收发成功。
别名和 rewrite 目标必须在同一域名;外部目的地用 forwarding。创建 forwarding 可能发送确认邮件。
错误和权限边界
无自动重试。超时或 HTTP 500 可能发生在写入之后,先读取当前状态再决定是否重试。尤其不沿用上游将 DELETE 的 500 当作成功的处理。
API 请求限时 20 秒、MCP 请求体限 64 KiB、上游响应限 1 MiB;错误返回不含上游原始响应体。
日志不打印请求体、密码或认证标头。工具响应标为 no-store,禁止搜索引擎索引。
不支持删除整个域名,因为 Migadu 官方 API 不提供此操作。
Worker 调用按 Cloudflare 账户计费;Migadu 用量按已有套餐计算。请自行确认账户套餐和使用额度。
来源
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-dependency Cloudflare Worker gateway turning websites and REST APIs into MCP tools.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Email on your own domains: add a domain, write its DNS, create mailboxes, read and send mail.
Build, validate and deploy workflows as Cloudflare Workers in your own account, with approval.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables deployment of a customizable MCP server on Cloudflare Workers without authentication. Allows users to define custom tools and connect to clients like Claude Desktop or Cloudflare AI Playground for remote tool execution.-
- FlicenseNot gradedqualityCmaintenanceEnables deployment of MCP servers on Cloudflare Workers without authentication requirements. Allows users to create custom tools accessible via remote MCP clients like Claude Desktop or Cloudflare AI Playground.-
- FlicenseNot gradedqualityDmaintenanceDeploys a remote MCP server on Cloudflare Workers without authentication, enabling tool use via remote MCP clients like Cloudflare AI Playground or Claude Desktop through a proxy.-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables deploying a remote MCP server on Cloudflare Workers without authentication, allowing custom tool definitions and connections to clients like Claude Desktop and Cloudflare AI Playground.-