跳转到主要内容

MCP

在 Claude 中使用 Mailera

通过一条命令将 Mailera 的 MCP 服务器添加到 Claude Code,或通过 mcp-remote 桥接添加到 Claude Desktop。Claude 即可在已连接的邮箱中读取、搜索和回复邮件。

Claude 官方文档

开始之前

  1. 创建免费工作区,并连接至少一个邮箱。
  2. 前往“设置 → API key”,创建 API key 并选择权限。入门只需 read 权限。
  3. 创建后请立即复制 API key,Mailera 仅显示一次完整内容。

配置

Claude Code

  1. 在项目目录中打开终端,将下方命令中的 API key 替换为您自己的,然后运行。
  2. 在 Claude Code 中输入 /mcp:mailera 应显示已连接状态,并列出工具。

将 mh_live_xxx 替换为您的 API key。

Terminal
claude mcp add --transport http mailera https://mailera.app/api/public/v1/mcp \  --header "Authorization: Bearer mh_live_xxx"

Claude Desktop

  1. 安装 Node.js 18 或更高版本,mcp-remote 桥接通过 npx 运行。
  2. 在 Claude Desktop 中打开 Settings → Developer → Edit Config,将 mailera 配置块粘贴到 mcpServers 中并保存。
  3. 完全退出并重新打开 Claude Desktop。点击聊天面板中的工具按钮,即可看到 Mailera 的工具。

将 mh_live_xxx 替换为您的 API key。

claude_desktop_config.json
{  "mcpServers": {    "mailera": {      "command": "npx",      "args": [        "-y",        "mcp-remote",        "https://mailera.app/api/public/v1/mcp",        "--header",        "Authorization:${AUTH_HEADER}"      ],      "env": {        "AUTH_HEADER": "Bearer mh_live_xxx"      }    }  }}

claude.ai 和 Claude Desktop 中的 Connectors(自定义连接器)尚不支持 Mailera:它们仅支持使用 OAuth 或无需身份验证的服务器,而 Mailera 使用 API key。

检查连接

向智能体提问:“列出我的 Mailera 邮箱”。智能体会调用 list_mailboxes,返回邮箱列表及同步状态。然后试试:“查找来自 noreply@… 的最新邮件,并提取 OTP”。

工具列表与安全指南

常见错误

401 unauthorized
API key 无效、已被撤销,或缺少 Bearer。请求头必须为 Authorization: Bearer mh_live_…
找不到 send_email 或 rescue_spam
API key 缺少所需权限(send、move)。Mailera 仅显示与其权限匹配的工具,请创建具有所需权限的新 API key。
智能体找不到任何邮箱
API key 的访问范围被限制在没有邮箱的分组内,或工作区尚未连接任何邮箱。
429 rate_limited
此 API key 已超出每分钟 300 次请求的限制。请等待 Retry-After 指定的秒数后重试。

在 Claude 中使用 Mailera

前往“设置 → API key”,创建 API key 并选择权限。入门只需 read 权限。