{"_id":"email-mcp-pro","_rev":"4-f41b3e66974be83c465674a6b0f08a2f","name":"email-mcp-pro","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"email-mcp-pro","version":"1.0.0","keywords":["mcp","model-context-protocol","email","smtp","imap","imapflow","imap-id","rfc-2971","163-mail","netease-mail","qq-mail","gmail","outlook","enterprise-email","email-client","email-server","auto-config","nodejs","claude-desktop"],"author":{"name":"xushihao"},"license":"MIT","_id":"email-mcp-pro@1.0.0","maintainers":[{"name":"batsama","email":"609373067@qq.com"}],"homepage":"https://github.com/batsama/email-mcp-pro#readme","bugs":{"url":"https://github.com/batsama/email-mcp-pro/issues"},"bin":{"email-mcp-pro":"index.js","universal-email-mcp":"index.js"},"dist":{"shasum":"7b4a745c425e1bafa4f3932b708058b554e90bd3","tarball":"https://registry.npmjs.org/email-mcp-pro/-/email-mcp-pro-1.0.0.tgz","fileCount":5,"integrity":"sha512-zetnpqwf3Nie/Va+doK6+vYZ7ONlxLYN6cOzVC0DvFeSsfHWMH+Jz5AliCbIM/cFBYOGDwpn5vhOj/C4UgymBg==","signatures":[{"sig":"MEUCIF0Mb1zILtcITK9Z2I97NnZDJxx0arzrIDO5J3VkyvIUAiEA1HbfHGBq47Js5xzRbSEMZpMlxmUasgJjpfXnhwrnu6g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57683},"main":"index.js","type":"module","engines":{"node":">=16.0.0"},"gitHead":"9b3cde113ce8f48c30c508fa6e0e23909a6efb59","scripts":{"dev":"node --watch index.js","test":"node test-imapflow.js","start":"node index.js","publish-check":"node scripts/publish-check.js","prepublishOnly":"npm run publish-check"},"_npmUser":{"name":"batsama","email":"609373067@qq.com"},"overrides":{"minimist":"^1.2.8"},"deprecated":"此版本存在 bug：get_email_content 读取邮件详情失败。请升级到 1.0.1 或更高版本。","repository":{"url":"git+https://github.com/batsama/email-mcp-pro.git","type":"git"},"_npmVersion":"10.9.8","description":"通用邮箱 MCP 服务器 - 基于 imapflow 重写 IMAP 实现，支持 IMAP ID 命令(RFC 2971)，完美兼容网易邮箱(163/126/yeah)，支持 QQ、Gmail、Outlook、企业邮箱等","directories":{},"_nodeVersion":"22.23.2","dependencies":{"dotenv":"^17.4.2","poplib":"^0.1.7","imapflow":"^2.0.5","mailparser":"^3.9.8","nodemailer":"^8.0.7","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.6.0","@types/nodemailer":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/email-mcp-pro_1.0.0_1789478678366_0.9189890423579765","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"email-mcp-pro","version":"1.0.1","keywords":["mcp","model-context-protocol","email","smtp","imap","imapflow","imap-id","rfc-2971","163-mail","netease-mail","qq-mail","gmail","outlook","enterprise-email","email-client","email-server","auto-config","nodejs","claude-desktop"],"author":{"name":"xushihao"},"license":"MIT","_id":"email-mcp-pro@1.0.1","maintainers":[{"name":"batsama","email":"609373067@qq.com"}],"homepage":"https://github.com/batsama/email-mcp-pro#readme","bugs":{"url":"https://github.com/batsama/email-mcp-pro/issues"},"bin":{"email-mcp-pro":"index.js","universal-email-mcp":"index.js"},"dist":{"shasum":"3d1433651b566d0cda116c3051ceebdf309a5a21","tarball":"https://registry.npmjs.org/email-mcp-pro/-/email-mcp-pro-1.0.1.tgz","fileCount":5,"integrity":"sha512-hmNso0mq+ogOb7vqliplpaFKkzMIv8c9TqHOdE2zya934ql5xo4a9SatcV5jLUx0ePSp9DcKhLgz0i0FhLtivg==","signatures":[{"sig":"MEUCIHAGFH1ZiR85H1Dhci0V84K2LQlNGgZPf48acn49zyUCAiEA6Gfdu/MgWWsLH0qvnj10qw1KIVDp0dbvvXkBeZik2fM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIAFz2lHY3JuRgqBXMrpVM58tXWk7EaS3xc+i/GFtCOYnAiB3svP2FUBlS0G3CKx4OjASlwYrayRNc8NeZPETUqXyMg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57805},"main":"index.js","type":"module","engines":{"node":">=16.0.0"},"gitHead":"7b1eba063cb4449308b02106fd4e19007ca6b020","scripts":{"dev":"node --watch index.js","test":"node test-imapflow.js","start":"node index.js","publish-check":"node scripts/publish-check.js","prepublishOnly":"npm run publish-check"},"_npmUser":{"name":"batsama","email":"609373067@qq.com"},"overrides":{"minimist":"^1.2.8"},"repository":{"url":"git+https://github.com/batsama/email-mcp-pro.git","type":"git"},"_npmVersion":"10.9.8","description":"通用邮箱 MCP 服务器 - 基于 imapflow 重写 IMAP 实现，支持 IMAP ID 命令(RFC 2971)，完美兼容网易邮箱(163/126/yeah)，支持 QQ、Gmail、Outlook、企业邮箱等","directories":{},"_nodeVersion":"22.23.2","dependencies":{"dotenv":"^17.4.2","poplib":"^0.1.7","imapflow":"^2.0.5","mailparser":"^3.9.8","nodemailer":"^8.0.7","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.6.0","@types/nodemailer":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/email-mcp-pro_1.0.1_1789532747767_0.49567135158089126","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"email-mcp-pro@1.0.2","bin":{"email-mcp-pro":"index.js","universal-email-mcp":"index.js"},"bugs":{"url":"https://github.com/batsama/email-mcp-pro/issues"},"dist":{"shasum":"15a7c809d6662535200449d42bf366febfef7a92","tarball":"https://registry.npmjs.org/email-mcp-pro/-/email-mcp-pro-1.0.2.tgz","fileCount":5,"integrity":"sha512-NQNE+nT1ymOiMDhVDf6x4GwPEN+2n0MhE9nS1K93qIwk2BrlIFIk1pYUI0sAQjDvinknrvs2RcxWz4jc76o8jg==","signatures":[{"sig":"MEQCIE4TKNsKrm/QhEHKTLkZFMfZsk3hIB0aMPR/Ohr98vr6AiAzkKQk4zC08wT6N5yC7gYi8X2i1p/4qxM47o2jk/sZ9w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCd4ImE57TP27zvrpvA789Ziw8ICd4j1Qo/Z8++Rr8A4QIgMOaPQ32b18BdoTbudIHcockXAPJHFNjS3f0pKbMGcjQ="}],"unpackedSize":58073},"main":"index.js","name":"email-mcp-pro","type":"module","author":{"name":"xushihao"},"engines":{"node":">=16.0.0"},"gitHead":"f37d447dfa9af35d0b35bb72e71a467e6e7af385","license":"MIT","scripts":{"dev":"node --watch index.js","test":"node test-imapflow.js","start":"node index.js","publish-check":"node scripts/publish-check.js","prepublishOnly":"npm run publish-check"},"version":"1.0.2","_npmUser":{"name":"batsama","email":"609373067@qq.com"},"homepage":"https://github.com/batsama/email-mcp-pro#readme","keywords":["mcp","model-context-protocol","email","smtp","imap","imapflow","imap-id","rfc-2971","163-mail","netease-mail","qq-mail","gmail","outlook","enterprise-email","email-client","email-server","auto-config","nodejs","claude-desktop"],"overrides":{"minimist":"^1.2.8"},"repository":{"url":"git+https://github.com/batsama/email-mcp-pro.git","type":"git"},"_npmVersion":"10.9.8","description":"通用邮箱 MCP 服务器 - 基于 imapflow 重写 IMAP 实现，支持 IMAP ID 命令(RFC 2971)，完美兼容网易邮箱(163/126/yeah)，支持 QQ、Gmail、Outlook、企业邮箱等","directories":{},"maintainers":[{"name":"batsama","email":"609373067@qq.com"}],"_nodeVersion":"22.23.2","dependencies":{"dotenv":"^17.4.2","poplib":"^0.1.7","imapflow":"^2.0.5","mailparser":"^3.9.8","nodemailer":"^8.0.7","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.6.0","@types/nodemailer":"^8.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/email-mcp-pro_1.0.2_1790165479745_0.054682435448009326"}}},"time":{"created":"2026-09-15T13:24:38.166Z","modified":"2026-09-23T12:11:20.184Z","1.0.0":"2026-09-15T13:24:38.507Z","1.0.1":"2026-09-16T04:25:47.859Z","1.0.2":"2026-09-23T12:11:19.836Z"},"bugs":{"url":"https://github.com/batsama/email-mcp-pro/issues"},"author":{"name":"xushihao"},"license":"MIT","homepage":"https://github.com/batsama/email-mcp-pro#readme","keywords":["mcp","model-context-protocol","email","smtp","imap","imapflow","imap-id","rfc-2971","163-mail","netease-mail","qq-mail","gmail","outlook","enterprise-email","email-client","email-server","auto-config","nodejs","claude-desktop"],"repository":{"url":"git+https://github.com/batsama/email-mcp-pro.git","type":"git"},"description":"通用邮箱 MCP 服务器 - 基于 imapflow 重写 IMAP 实现，支持 IMAP ID 命令(RFC 2971)，完美兼容网易邮箱(163/126/yeah)，支持 QQ、Gmail、Outlook、企业邮箱等","maintainers":[{"name":"batsama","email":"609373067@qq.com"}],"readme":"# 📧 email-mcp-pro\n\n通用邮箱 MCP 服务器 — 基于 [imapflow](https://github.com/postalsys/imapflow) 重写 IMAP 实现，支持 **IMAP ID 命令 (RFC 2971)**，完美兼容网易邮箱系列。\n\n> ✨ **核心改进**：原版 `email-mcp` 使用老的 `node-imap` 库，不支持 IMAP ID 命令，导致网易邮箱 (163/126/yeah) 读取邮件内容时报 `EXAMINE Unsafe Login` 错误。本版本改用 `imapflow`，在连接时自动发送 ID 命令声明客户端身份，彻底解决该问题。\n\n## ✨ 功能特性\n\n- 📤 **邮件发送**：支持 HTML 和纯文本邮件、多收件人、抄送、密送、附件\n- 📥 **邮件列表**：获取最近 N 天的邮件列表（IMAP / POP3 双协议）\n- 📖 **邮件内容**：读取指定邮件的完整内容（文本、HTML、附件信息）\n- 🔧 **动态配置**：支持运行时配置邮箱服务器，自动识别邮箱类型\n- 🔍 **连接测试**：内置 SMTP / IMAP 服务器连接测试\n- 🛡️ **IMAP ID 命令**：自动发送 RFC 2971 ID 命令，兼容网易邮箱安全策略\n- ⚡ **现代 IMAP 库**：基于 imapflow，Promise/async 风格 API，更稳定可靠\n\n## 📦 支持的邮箱服务商\n\n| 邮箱类型 | SMTP | IMAP | POP3 | 备注 |\n|---------|------|------|------|------|\n| QQ邮箱 | ✅ | ✅ | ✅ | |\n| **网易邮箱 (163/126/yeah)** | ✅ | ✅ | ✅ | **IMAP ID 命令已修复** |\n| Gmail | ✅ | ✅ | ✅ | 需应用专用密码 |\n| Outlook/Hotmail | ✅ | ✅ | ✅ | |\n| 腾讯企业邮箱 | ✅ | ✅ | ✅ | |\n| 阿里云邮箱 | ✅ | ✅ | ✅ | |\n| 新浪邮箱 | ✅ | ✅ | ✅ | |\n| 搜狐邮箱 | ✅ | ✅ | ✅ | |\n\n## 🚀 快速开始\n\n### 方式一：npx 直接运行（推荐）\n\n无需安装，直接通过 npx 运行：\n\n```bash\nnpx email-mcp-pro\n```\n\n在 MCP 客户端配置中使用：\n\n```json\n{\n  \"mcpServers\": {\n    \"email\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"email-mcp-pro\"],\n      \"env\": {\n        \"EMAIL_USER\": \"your-email@163.com\",\n        \"EMAIL_PASSWORD\": \"your-auth-code\",\n        \"EMAIL_TYPE\": \"auto\"\n      }\n    }\n  }\n}\n```\n\n### 方式二：全局安装\n\n```bash\nnpm install -g email-mcp-pro\nemail-mcp-pro\n```\n\n### 方式三：从源码运行\n\n```bash\ngit clone https://github.com/batsama/email-mcp-pro.git\ncd email-mcp-pro\nnpm install\nEMAIL_USER=your-email@163.com EMAIL_PASSWORD=your-auth-code node index.js\n```\n\n## 🔧 配置说明\n\n### 环境变量\n\n| 变量 | 必需 | 说明 |\n|------|------|------|\n| `EMAIL_USER` | ✅ | 邮箱地址 |\n| `EMAIL_PASSWORD` | ✅ | 邮箱密码或客户端授权码 |\n| `EMAIL_TYPE` | 可选 | 邮箱类型：`auto`(默认)、`qq`、`163`、`gmail`、`outlook`、`exmail`、`aliyun`、`sina`、`sohu` |\n\n也可以通过 MCP 工具 `setup_email_account` 在运行时动态配置。\n\n### 网易邮箱配置指南\n\n1. 登录 [163 邮箱](https://mail.163.com)\n2. 进入「设置」→「POP3/SMTP/IMAP」\n3. 开启「IMAP/SMTP服务」和「POP3/SMTP服务」\n4. 生成**客户端授权密码**（注意：不是登录密码）\n5. 使用授权码作为 `EMAIL_PASSWORD`\n\n## 🛠️ MCP 工具说明\n\n### 1. `send_email` — 发送邮件\n\n```json\n{\n  \"to\": [\"recipient@example.com\"],\n  \"subject\": \"测试邮件\",\n  \"text\": \"这是一封测试邮件\",\n  \"html\": \"<h1>测试邮件</h1><p>Hello World</p>\"\n}\n```\n\n### 2. `get_recent_emails` — 获取最近邮件列表\n\n```json\n{\n  \"limit\": 10,\n  \"days\": 3\n}\n```\n\n### 3. `get_email_content` — 获取邮件详情\n\n```json\n{\n  \"uid\": \"1623676463\"\n}\n```\n\n### 4. `setup_email_account` — 设置邮箱账号\n\n```json\n{\n  \"email\": \"user@163.com\",\n  \"password\": \"your-auth-code\",\n  \"provider\": \"163\"\n}\n```\n\n### 5. `test_email_connection` — 测试连接\n\n```json\n{\n  \"testType\": \"both\"\n}\n```\n\n### 6. `list_supported_providers` — 列出支持的邮箱\n\n### 7. `configure_email_server` — 手动配置服务器（高级）\n\n## 🔧 本地测试\n\n```bash\n# 测试 IMAP 连接（含 ID 命令验证）\nEMAIL_USER=your-email@163.com EMAIL_PASSWORD=your-auth-code node test-imapflow.js\n```\n\n## 📝 与原版 email-mcp 的区别\n\n| 特性 | 原版 email-mcp | email-mcp-pro |\n|------|---------------|---------------|\n| IMAP 库 | node-imap (已停止维护) | imapflow (活跃维护) |\n| IMAP ID 命令 (RFC 2971) | ❌ 不支持 | ✅ 自动发送 |\n| 网易邮箱 IMAP 读取邮件 | ❌ `Unsafe Login` 错误 | ✅ 正常工作 |\n| 网易邮箱默认协议 | POP3 (规避方案) | IMAP (原生支持) |\n| API 风格 | 事件驱动 (Callback) | Promise/async |\n| 代码可维护性 | 较低 | 较高 |\n\n## 📄 License\n\nMIT License\n","readmeFilename":"README.md"}