关于 OpenMail
OpenMail 是面向 AI Agent 的托管邮件 MCP 服务,支持 OAuth 登录,也支持无头客户端使用 API 密钥。它支持创建收件箱及处理邮件,包括读取需要回复的邮件并在原线程中答复。
主要功能
- 01创建 Agent 邮箱
- 02读取需要回复的邮件
- 03在现有邮件线程中回复
- 04发送邮件并管理域名
- 05通过 OAuth 或 API 密钥连接
适用场景
- 01为 Agent 配置专用收件箱
- 02查看需要回复的来信
- 03在保留邮件线程的情况下回复
- 04使用收件箱范围密钥连接无头 Agent
MCP 相关
OpenMail 提供托管的 Streamable HTTP MCP 端点,用于邮件操作。它支持 OAuth 和 API 密钥认证,并提供只读及收件箱范围的端点选项。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.openmail.sh/mcpclaude mcp add --transport http sh-openmail-openmail https://mcp.openmail.sh/mcp{"mcpServers":{"sh-openmail-openmail":{"type":"http","url":"https://mcp.openmail.sh/mcp"}}}在 Cursor 中打开{"servers":{"sh-openmail-openmail":{"type":"http","url":"https://mcp.openmail.sh/mcp"}}}在 VS Code 中打开{"mcpServers":{"sh-openmail-openmail":{"type":"http","url":"https://mcp.openmail.sh/mcp"}}}{"mcpServers":{"sh-openmail-openmail":{"serverUrl":"https://mcp.openmail.sh/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
OpenMail MCP
托管的 Streamable HTTP MCP,地址为 https://mcp.openmail.sh/mcp。面向 AI Agent 的电子邮件收件箱:一个收件箱,阅读需要回复的邮件,并在原邮件对话中回复。
没有本地 stdio 目录——仅支持 stdio 的客户端应使用 mcp-remote。
连接
Claude(OAuth): 粘贴 https://mcp.openmail.sh/mcp
Cursor(OAuth): 添加到 Cursor,或添加下方 URL,且不添加 headers。也作为插件列在 cursor.directory 上(.cursor-plugin/plugin.json + mcp.json)。
Claude Code: 运行 claude mcp add --transport http openmail https://mcp.openmail.sh/mcp,或安装为插件(先运行 claude plugin marketplace add openmailsh/mcp,再运行 claude plugin install openmail@openmailsh-mcp):该插件将服务与 skills/ 中的 openmail 技能打包在一起,教 Agent 何时使用电子邮件,以及如何处理邮件对话。
VS Code / 任何注册表客户端: 在 MCP Registry 中列为 sh.openmail/openmail。
Cursor 或无头 Agent(API key):
{
"mcpServers": {
"openmail": {
"url": "https://mcp.openmail.sh/mcp",
"headers": { "Authorization": "Bearer om_YOUR_KEY" }
}
}
}
建议使用限定到单个收件箱的密钥。只读:/mcp/readonly。单个收件箱:/mcp/inbox/{id}。
密钥和对话记录:通过 OAuth(Claude、Cursor 登录)时,setup_agent_email 和 mint_inbox_key 不会返回令牌——会话已通过身份验证,返回的任何内容都会显示在聊天中。它们会引导你前往控制台,在浏览器中一次性显示新密钥。通过 API key(无头 Agent)时,令牌会在工具结果中返回;请将其移到 Agent 的环境变量中。
仅支持 stdio 的客户端: npx -y mcp-remote https://mcp.openmail.sh/mcp
环境变量
| 名称 | 用途 |
|---|---|
OPENMAIL_API_URL | API 源站(https://api.openmail.sh) |
MCP_RESOURCE_URL | OAuth 资源(https://mcp.openmail.sh) |
MCP_JWT_SECRET | 与 API 相同的密钥。生产环境中必需;非生产环境中回退到 NEXTAUTH_SECRET |
CONSOLE_ORIGIN | 同意页面主机 |
PORT | 监听端口 |
POSTHOG_API_KEY | 启用 PostHog MCP Analytics(每次调用记录一次 $mcp_tool_call)。未设置 = 关闭 |
MCP_ANALYTICS_DEBUG | 设置后,记录每个捕获的分析事件 |
参见 .env.example。
本地运行
pnpm install
pnpm test
pnpm dev
贡献
提交 issue 或 PR。推送前运行 pnpm typecheck && pnpm test。
MIT © OpenMail
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。