npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

email-mcp-pro

v1.0.2

Published

通用邮箱 MCP 服务器 - 基于 imapflow 重写 IMAP 实现,支持 IMAP ID 命令(RFC 2971),完美兼容网易邮箱(163/126/yeah),支持 QQ、Gmail、Outlook、企业邮箱等

Readme

📧 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,更稳定可靠

📦 支持的邮箱服务商

| 邮箱类型 | 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": "[email protected]",
        "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 protected] EMAIL_PASSWORD=your-auth-code node index.js

🔧 配置说明

环境变量

| 变量 | 必需 | 说明 | |------|------|------| | EMAIL_USER | ✅ | 邮箱地址 | | EMAIL_PASSWORD | ✅ | 邮箱密码或客户端授权码 | | EMAIL_TYPE | 可选 | 邮箱类型:auto(默认)、qq、163、gmail、outlook、exmail、aliyun、sina、sohu |

也可以通过 MCP 工具 setup_email_account 在运行时动态配置。

网易邮箱配置指南

  1. 登录 163 邮箱
  2. 进入「设置」→「POP3/SMTP/IMAP」
  3. 开启「IMAP/SMTP服务」和「POP3/SMTP服务」
  4. 生成客户端授权密码(注意:不是登录密码)
  5. 使用授权码作为 EMAIL_PASSWORD

🛠️ MCP 工具说明

1. send_email — 发送邮件

{
  "to": ["[email protected]"],
  "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": "[email protected]",
  "password": "your-auth-code",
  "provider": "163"
}

5. test_email_connection — 测试连接

{
  "testType": "both"
}

6. list_supported_providers — 列出支持的邮箱

7. configure_email_server — 手动配置服务器(高级)

🔧 本地测试

# 测试 IMAP 连接(含 ID 命令验证)
[email protected] 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 读取邮件 | ❌ Unsafe Login 错误 | ✅ 正常工作 | | 网易邮箱默认协议 | POP3 (规避方案) | IMAP (原生支持) | | API 风格 | 事件驱动 (Callback) | Promise/async | | 代码可维护性 | 较低 | 较高 |

📄 License

MIT License