email-mcp-pro
Allows sending and receiving emails through Gmail, including retrieving recent email lists and reading full email content, with support for attachments.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@email-mcp-pro send an email to john@example.com saying 'See you tomorrow'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📧 email-mcp-pro
通用邮箱 MCP 服务器 — 基于 imapflow 重写 IMAP 实现,支持 IMAP ID 命令 (RFC 2971),完美兼容网易邮箱系列。
✨ 核心改进:原版
email-mcp使用老的node-imap库,不支持 IMAP ID 命令,导致网易邮箱 (163/126/yeah) 读取邮件内容时报EXAMINE Unsafe Login错误。本版本改用imapflow,在连接时自动发送 ID 命令声明客户端身份,彻底解决该问题。
✨ 功能特性
📤 邮件发送:支持 HTML 和纯文本邮件、多收件人、抄送、密送、附件
📥 邮件列表:获取最近 N 天的邮件列表(IMAP / POP3 双协议)
📖 邮件内容:读取指定邮件的完整内容(文本、HTML、附件信息)
🔧 动态配置:支持运行时配置邮箱服务器,自动识别邮箱类型
🔍 连接测试:内置 SMTP / IMAP 服务器连接测试
🛡️ IMAP ID 命令:自动发送 RFC 2971 ID 命令,兼容网易邮箱安全策略
⚡ 现代 IMAP 库:基于 imapflow,Promise/async 风格 API,更稳定可靠
Related MCP server: Email MCP Server
📦 支持的邮箱服务商
邮箱类型 | SMTP | IMAP | POP3 | 备注 |
QQ邮箱 | ✅ | ✅ | ✅ | |
网易邮箱 (163/126/yeah) | ✅ | ✅ | ✅ | IMAP ID 命令已修复 |
Gmail | ✅ | ✅ | ✅ | 需应用专用密码 |
Outlook/Hotmail | ✅ | ✅ | ✅ | |
腾讯企业邮箱 | ✅ | ✅ | ✅ | |
阿里云邮箱 | ✅ | ✅ | ✅ | |
新浪邮箱 | ✅ | ✅ | ✅ | |
搜狐邮箱 | ✅ | ✅ | ✅ |
🚀 快速开始
方式一:npx 直接运行(推荐)
无需安装,直接通过 npx 运行:
npx email-mcp-pro在 MCP 客户端配置中使用:
{
"mcpServers": {
"email": {
"command": "npx",
"args": ["-y", "email-mcp-pro"],
"env": {
"EMAIL_USER": "your-email@163.com",
"EMAIL_PASSWORD": "your-auth-code",
"EMAIL_TYPE": "auto"
}
}
}
}方式二:全局安装
npm install -g email-mcp-pro
email-mcp-pro方式三:从源码运行
git clone https://github.com/batsama/email-mcp-pro.git
cd email-mcp-pro
npm install
EMAIL_USER=your-email@163.com EMAIL_PASSWORD=your-auth-code node index.js🔧 配置说明
环境变量
变量 | 必需 | 说明 |
| ✅ | 邮箱地址 |
| ✅ | 邮箱密码或客户端授权码 |
| 可选 | 邮箱类型: |
也可以通过 MCP 工具 setup_email_account 在运行时动态配置。
网易邮箱配置指南
登录 163 邮箱
进入「设置」→「POP3/SMTP/IMAP」
开启「IMAP/SMTP服务」和「POP3/SMTP服务」
生成客户端授权密码(注意:不是登录密码)
使用授权码作为
EMAIL_PASSWORD
🛠️ MCP 工具说明
1. send_email — 发送邮件
{
"to": ["recipient@example.com"],
"subject": "测试邮件",
"text": "这是一封测试邮件",
"html": "<h1>测试邮件</h1><p>Hello World</p>"
}2. get_recent_emails — 获取最近邮件列表
{
"limit": 10,
"days": 3
}3. get_email_content — 获取邮件详情
{
"uid": "1623676463"
}4. setup_email_account — 设置邮箱账号
{
"email": "user@163.com",
"password": "your-auth-code",
"provider": "163"
}5. test_email_connection — 测试连接
{
"testType": "both"
}6. list_supported_providers — 列出支持的邮箱
7. configure_email_server — 手动配置服务器(高级)
🔧 本地测试
# 测试 IMAP 连接(含 ID 命令验证)
EMAIL_USER=your-email@163.com EMAIL_PASSWORD=your-auth-code node test-imapflow.js📝 与原版 email-mcp 的区别
特性 | 原版 email-mcp | email-mcp-pro |
IMAP 库 | node-imap (已停止维护) | imapflow (活跃维护) |
IMAP ID 命令 (RFC 2971) | ❌ 不支持 | ✅ 自动发送 |
网易邮箱 IMAP 读取邮件 | ❌ | ✅ 正常工作 |
网易邮箱默认协议 | POP3 (规避方案) | IMAP (原生支持) |
API 风格 | 事件驱动 (Callback) | Promise/async |
代码可维护性 | 较低 | 较高 |
📄 License
MIT License
Available Tools
7 toolsconfigure_email_serverB
手动配置邮箱服务器设置(高级用户使用)
Inputs: user (required), password (required), imapHost, imapPort, +4 more.
get_email_contentA
获取指定邮件的详细内容
Inputs: uid (required).
get_recent_emailsC
获取最近三天的邮件列表
Inputs: days, limit.
list_supported_providersA
列出支持的邮箱提供商
Inputs: no named parameters.
send_emailC
发送邮件
Inputs: to (required), text (required), subject (required), cc, +3 more.
setup_email_accountC
设置邮箱账号(自动识别邮箱类型并配置服务器)
Inputs: email (required), password (required), provider.
test_email_connectionC
测试邮箱服务器连接
Inputs: testType.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target distinct actions like sending, retrieving, listing, and testing. setup_email_account and configure_email_server have some overlap, but their automatic vs manual distinction in the descriptions helps clarify their boundaries.
All tool names follow a consistent verb_noun snake_case pattern, such as send_email, get_recent_emails, and list_supported_providers. This makes the tool set predictable and easy to navigate.
Seven tools is a well-scoped size for an email MCP server, covering account setup, connection testing, sending, and retrieval. Each tool serves a clear functional role without unnecessary bloat.
The set covers the core email workflows: account configuration, connectivity testing, sending, and reading recent messages. Minor gaps exist such as no search, attachment handling, or message deletion, but they are workarounds rather than critical dead ends.
Maintenance
Related MCP Connectors
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Search connected email, read and manage messages, draft and send, and manage rules for new mail.
Read, search, reply to and organize Naver Mail with the same tools as the Gmail MCP (IMAP/SMTP).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables sending and receiving emails through SMTP, IMAP, and POP3 protocols with support for attachments, HTML content, and email validation.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI to send, read, search, delete and reply to emails through SMTP or Gmail API, supporting common email services like QQ, 163, Gmail and Outlook with HTML/text formats and attachments.28 npm1ISC
- FlicenseAqualityDmaintenanceEnables sending emails through SMTP with support for multiple recipients, attachments, CC/BCC, and both plain text and HTML formats. Includes preset configurations for common email providers like Gmail, QQ, Outlook, and 163.5-
- FlicenseNot gradedqualityDmaintenanceEnables email management via IMAP/SMTP, supporting list emails, read emails, send emails, and save drafts.-