Uses .env files for configuration management, storing sensitive information like API keys and JWT credentials for email functionality.
Supports repository cloning for installation of the email MCP server.
Hosts the email MCP repository, allowing users to clone and access the codebase.
Provides JavaScript-based integration examples for sending emails through the SuperGateway API.
Manages dependencies and provides scripts for setup, development, and running the email service.
Email MCP Server
一个基于Model Context Protocol (MCP) 的邮件服务器,让AI可以发送、读取、搜索、删除和回复邮件。支持SMTP和Gmail API两种方式,兼容QQ邮箱、163邮箱、Gmail等常见邮箱服务。
🚀 功能特性
- ✉️ 发送邮件 - 支持HTML/纯文本格式,附件功能
- 📥 读取邮件 - 从收件箱或指定文件夹读取邮件
- 🔍 搜索邮件 - 按关键词搜索邮件
- 🗑️ 删除邮件 - 删除指定邮件
- ↩️ 回复邮件 - 支持回复和全部回复
📦 安装
或者快速安装:
⚙️ 配置
- 复制环境变量模板:
- 编辑
.env
文件,选择邮件提供商:
选项一:使用QQ邮箱 (推荐)
QQ邮箱设置步骤:
- 登录QQ邮箱 → 设置 → 账户
- 开启SMTP服务
- 生成授权码(不是QQ密码)
- 将授权码填入
SMTP_PASS
选项二:使用163邮箱
选项三:使用Gmail
选项四:使用Gmail API
🔧 使用方法
直接启动
使用SuperGateway调试 (推荐)
服务将在 http://localhost:3200 启动
在Cline中配置
开发模式
🛠️ 可用工具
1. send_email
发送邮件给指定收件人
参数:
to
(必需): 收件人邮箱地址subject
(必需): 邮件主题body
(必需): 邮件内容from
(可选): 发件人邮箱地址html
(可选): 是否为HTML格式attachments
(可选): 附件数组
示例:
2. read_emails
从收件箱或指定文件夹读取邮件
参数:
limit
(可选): 邮件数量限制 (默认: 10)folder
(可选): 邮件文件夹 (默认: "INBOX")unreadOnly
(可选): 只读取未读邮件 (默认: false)
3. search_emails
搜索邮件
参数:
query
(必需): 搜索关键词limit
(可选): 结果数量限制 (默认: 10)folder
(可选): 搜索文件夹 (默认: "INBOX")
4. delete_email
删除邮件
参数:
messageId
(必需): 要删除的邮件ID
5. reply_email
回复邮件
参数:
messageId
(必需): 原邮件IDbody
(必需): 回复内容replyAll
(可选): 是否回复全部 (默认: false)html
(可选): 是否为HTML格式 (默认: false)
🔐 支持的邮箱服务
邮箱服务 | SMTP服务器 | 端口 | 安全连接 | 说明 |
---|---|---|---|---|
QQ邮箱 | smtp.qq.com | 587 | false | 需要开启SMTP服务并获取授权码 |
163邮箱 | smtp.163.com | 994 | true | 需要开启SMTP服务并获取授权码 |
Gmail | smtp.gmail.com | 587 | false | 需要开启两步验证并生成应用密码 |
Outlook | smtp-mail.outlook.com | 587 | false | 需要开启SMTP认证 |
🐛 故障排除
常见问题
- QQ邮箱认证失败
- 确保已开启SMTP服务
- 使用授权码而不是QQ密码
- 检查SMTP设置是否正确
- 163邮箱认证失败
- 确保已开启SMTP服务
- 使用客户端授权密码
- 注意端口使用994并开启SSL
- Gmail认证失败
- 确保启用了"应用密码"
- 开启两步验证
- 检查SMTP设置是否正确
- Gmail API错误
- 确保OAuth令牌有效
- 检查API配额和权限
- TypeScript编译错误
- 运行
npm install
确保依赖安装完整 - 检查Node.js版本 (推荐 v18+)
- 运行
🔗 相关链接
�� 许可证
ISC License
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that enables AI models to send emails via simple tool calls, supporting both plain text and HTML formats with JWT authentication.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to interact with Gmail services, supporting email operations, draft management, and calendar functionality through Google API integration.Last updated -TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables AI models and applications to interact directly with Twitter/X, providing capabilities to create posts, reply to tweets, retrieve user data, and manage account actions.Last updated -874TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities including sending, reading, organizing, searching, and managing drafts and labels.Last updated -PythonGPL 3.0
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to access and manage email through IMAP, supporting browsing, searching, reading, and organizing emails while learning user preferences over time.Last updated -2Python