@fuyouai/email-mcp
Official# @fuyouai/email-mcp
通过 **MCP** 读写邮箱:收信用 **IMAP**,发信用 **SMTP**。默认参数适配腾讯企业邮箱(`exmail.qq.com`)。
## 工具
| Tool | 说明 |
|------|------|
| `list_folders` | 列出文件夹 |
| `list_messages` | 列出邮件摘要 |
| `search_messages` | 按条件搜索 |
| `get_message` | 读取单封正文与附件信息 |
| `send_message` | 发送邮件(环境变量 `SMTP_ENABLED=false` 时不注册) |
## 要求
- Node.js 18+
- 邮箱已开启 IMAP;发信需开启 SMTP
- 腾讯企业邮开启安全登录时,使用**客户端专用密码**([IMAP 说明](http://service.rtxmail.net/help/234.html))
## 在 Cursor 中使用
```bash
npx -y @fuyouai/email-mcp
```
`mcp.json` 示例(把账号与密码换成你自己的;密码不要提交到仓库):
```json
{
"mcpServers": {
"email": {
"command": "npx",
"args": ["-y", "@fuyouai/email-mcp"],
"env": {
"IMAP": "imap.exmail.qq.com:993",
"MAIL_USER": "you@yourcompany.com",
"MAIL_PASSWORD": "客户端专用密码",
"IMAP_SECURE": "true",
"SMTP": "smtp.exmail.qq.com:465",
"SMTP_SECURE": "true",
"SMTP_ENABLED": "true"
}
}
}
}
```
安装到全局后,可执行 CLI:`email-mcp`。
## 环境变量
| 变量 | 说明 | 默认 |
|------|------|------|
| `IMAP` | 收信 `host:port` | `imap.exmail.qq.com:993` |
| `MAIL_USER` | 登录邮箱(收/发共用) | 必填 |
| `MAIL_PASSWORD` | 密码或客户端专用密码 | 必填 |
| `IMAP_SECURE` | IMAP 使用 TLS | `true` |
| `MAX_BODY_CHARS` | 读信正文最大长度 | `8000` |
| `SMTP` | 发信 `host:port` | `smtp.exmail.qq.com:465` |
| `SMTP_SECURE` | SMTP 使用 TLS | `true` |
| `SMTP_ENABLED` | 是否注册发信工具 | `true` |
| `SMTP_USER` / `SMTP_PASSWORD` | 发信账号与收信不同时填写 | 默认同 `MAIL_*` |
| `SMTP_FROM` | 发件人显示地址 | 默认同发信登录账号 |
海外机房可将 `IMAP` / `SMTP` 改为 `hwimap.exmail.qq.com:993`、`hwsmtp.exmail.qq.com:465`。
## `send_message` 参数示例
```json
{
"to": "colleague@company.com",
"subject": "会议提醒",
"text": "明天下午 3 点开会。"
}
```
多个收件人:`"to": "a@x.com, b@x.com"` 或 `"to": ["a@x.com", "b@x.com"]`。`text` 与 `html` 至少填一项。
TDQS
Scored across 5 tools
Each tool has a distinct purpose: listing folders, listing messages, searching messages, fetching a single message, and sending. Even though list_messages and search_messages both return messages, their usage is clearly differentiated by the description (folder browsing vs. condition-based search).
All tool names follow the consistent verb_noun pattern: list_folders, list_messages, search_messages, get_message, send_message. There are no mixed conventions or vague verbs, making the API predictable.
With exactly 5 tools, the server is well-scoped for basic email operations. It covers the core actions (list, search, read, send) without unnecessary bloat or an overly thin surface.
The toolset covers reading and sending email, but lacks common email management operations such as deleting, moving, or marking messages as read/unread. This is a notable gap for a full email workflow, though an agent can still accomplish basic tasks.