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.
Click on "Install 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 MCPsend an email to john@example.com about tomorrow's meeting agenda"
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 Server
一个基于Model Context Protocol (MCP) 的邮件服务器,让AI可以发送、读取、搜索、删除和回复邮件。支持SMTP和Gmail API两种方式,兼容QQ邮箱、163邮箱、Gmail等常见邮箱服务。
🚀 功能特性
✉️ 发送邮件 - 支持HTML/纯文本格式,附件功能
📥 读取邮件 - 从收件箱或指定文件夹读取邮件
🔍 搜索邮件 - 按关键词搜索邮件
🗑️ 删除邮件 - 删除指定邮件
↩️ 回复邮件 - 支持回复和全部回复
Related MCP server: Mailgun MCP Server
📦 安装
npm install
npm run build或者快速安装:
npm run quick-setup⚙️ 配置
复制环境变量模板:
cp env.example .env编辑
.env文件,选择邮件提供商:
选项一:使用QQ邮箱 (推荐)
EMAIL_PROVIDER=smtp
SMTP_HOST=smtp.qq.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-email@qq.com
SMTP_PASS=your-authorization-code
DEFAULT_FROM_EMAIL=your-email@qq.comQQ邮箱设置步骤:
登录QQ邮箱 → 设置 → 账户
开启SMTP服务
生成授权码(不是QQ密码)
将授权码填入
SMTP_PASS
选项二:使用163邮箱
EMAIL_PROVIDER=smtp
SMTP_HOST=smtp.163.com
SMTP_PORT=994
SMTP_SECURE=true
SMTP_USER=your-email@163.com
SMTP_PASS=your-authorization-code
DEFAULT_FROM_EMAIL=your-email@163.com选项三:使用Gmail
EMAIL_PROVIDER=smtp
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
DEFAULT_FROM_EMAIL=your-email@gmail.com选项四:使用Gmail API
EMAIL_PROVIDER=gmail
GMAIL_CLIENT_ID=your-gmail-client-id
GMAIL_CLIENT_SECRET=your-gmail-client-secret
GMAIL_REFRESH_TOKEN=your-gmail-refresh-token
DEFAULT_FROM_EMAIL=your-email@gmail.com🔧 使用方法
直接启动
npm run start使用SuperGateway调试 (推荐)
npm run start-gateway服务将在 http://localhost:3200 启动
在Cline中配置
{
"mcpServers": {
"email-mcp": {
"url": "http://localhost:3200/sse",
"type": "sse",
"disabled": false,
"autoApprove": [
"send_email",
"read_emails",
"search_emails",
"delete_email",
"reply_email"
]
}
}
}开发模式
npm run dev🛠️ 可用工具
1. send_email
发送邮件给指定收件人
参数:
to(必需): 收件人邮箱地址subject(必需): 邮件主题body(必需): 邮件内容from(可选): 发件人邮箱地址html(可选): 是否为HTML格式attachments(可选): 附件数组
示例:
{
"to": "recipient@qq.com",
"subject": "来自AI的问候",
"body": "这是一封由AI助手发送的测试邮件。",
"html": false
}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