mailbox-mcp
mailbox
一个本地开发邮件接收器:为整台机器运行一个 SMTP 服务器和一个 HTTP API,让每个项目都指向它。邮件永远不会离开你的设备——而是落入一个可检查的收件箱,配有 Web UI、CLI 和面向 AI 代理的 MCP 服务器。
共享一个实例可消除各项目之间的端口冲突:启动一次,即可连接多个。
Install
pnpm add -D @sdk-e/mailbox # or npm i -D / yarn add -D或者临时运行:
npx @sdk-e/mailboxRelated MCP server: qmailing MCP server
Quick start
mailbox # SMTP on :11025, inbox UI on http://localhost:11090从任何应用(nodemailer、Resend 开发模式等)向 smtp://127.0.0.1:11025 发送邮件,然后:
open http://localhost:11090 # or: mailbox-cli openBins
Bin | 用途 |
| 运行接收器(SMTP + HTTP + 收件箱 UI) |
|
|
| MCP 服务器( |
CLI examples
mailbox-cli list
mailbox-cli read 3
mailbox-cli wait "verification code" --timeout 10 # blocks until a new matching message arrives
mailbox-cli clearwait 只匹配它启动之后到达的消息——在触发发送之前启动它。
Library use
import { startMailbox } from "@sdk-e/mailbox";
const mailbox = await startMailbox({ smtpPort: 0, httpPort: 0 }); // 0 = ephemeral
console.log(mailbox.smtpPort, mailbox.url);
await mailbox.close();非常适合需要隔离的一次性收件箱的集成测试。
HTTP API(稳定的传输协议)
路由 | 方法 | 响应 |
| GET |
|
| GET | 数组 |
| GET | 上述消息加上 |
| DELETE |
|
| GET | 收件箱 UI |
Configuration
环境变量(如果存在,会加载工作目录中的 .env.local,然后是 .env):
变量 | 默认值 | 用途 |
|
| SMTP 监听端口 |
|
| HTTP API/UI 端口 |
| 由端口推导 | CLI/MCP 用于访问接收器的基本 URL |
|
| 绑定接口(默认回环) |
在本地将应用的邮件程序指向 smtp://127.0.0.1:$MAIL_SMTP_PORT;在生产环境中继续使用你的真实提供商。当 NODE_ENV=production 时,服务器拒绝启动。
Why high ports?
1025/1080(经典的 MailHog 风格默认值)经常冲突。mailbox 默认使用 11025/11090,这样多个 SDK-E 项目可以共享一个实例,而不会相互干扰或影响其他本地工具。
Development
pnpm install
pnpm verify # format, lint, typecheck, test, build参见 CONTRIBUTING.md。
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Give an AI agent its own email address: send, reply, read, and wait for mail.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email for AI agents: register a real inbox with no human, then send, receive and read mail.
Your agent's own email address: read, search, send, reply, draft and wait for mail.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to read, send, and manage emails via POP3 and SMTP with TLS support.6-
- AlicenseAqualityCmaintenanceEnables AI agents to manage email mailboxes, send and receive emails, and handle webhooks via qmailing.1253 npm1MIT
- FlicenseBqualityDmaintenanceEnables AI agents to send and receive emails via POP3 and SMTP, with tools for polling, reading, deleting, and sending emails.51-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.MIT