Skip to main content
Glama

Email MCP

Email MCP Server

一个基于Model Context Protocol (MCP) 的邮件服务器,让AI可以发送、读取、搜索、删除和回复邮件。支持SMTP和Gmail API两种方式,兼容QQ邮箱、163邮箱、Gmail等常见邮箱服务。

🚀 功能特性

  • ✉️ 发送邮件 - 支持HTML/纯文本格式,附件功能
  • 📥 读取邮件 - 从收件箱或指定文件夹读取邮件
  • 🔍 搜索邮件 - 按关键词搜索邮件
  • 🗑️ 删除邮件 - 删除指定邮件
  • ↩️ 回复邮件 - 支持回复和全部回复

📦 安装

npm install npm run build

或者快速安装:

npm run quick-setup

⚙️ 配置

  1. 复制环境变量模板:
cp env.example .env
  1. 编辑 .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.com

QQ邮箱设置步骤:

  1. 登录QQ邮箱 → 设置 → 账户
  2. 开启SMTP服务
  3. 生成授权码(不是QQ密码)
  4. 将授权码填入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 (必需): 原邮件ID
  • body (必需): 回复内容
  • replyAll (可选): 是否回复全部 (默认: false)
  • html (可选): 是否为HTML格式 (默认: false)

🔐 支持的邮箱服务

邮箱服务SMTP服务器端口安全连接说明
QQ邮箱smtp.qq.com587false需要开启SMTP服务并获取授权码
163邮箱smtp.163.com994true需要开启SMTP服务并获取授权码
Gmailsmtp.gmail.com587false需要开启两步验证并生成应用密码
Outlooksmtp-mail.outlook.com587false需要开启SMTP认证

🐛 故障排除

常见问题

  1. QQ邮箱认证失败
    • 确保已开启SMTP服务
    • 使用授权码而不是QQ密码
    • 检查SMTP设置是否正确
  2. 163邮箱认证失败
    • 确保已开启SMTP服务
    • 使用客户端授权密码
    • 注意端口使用994并开启SSL
  3. Gmail认证失败
    • 确保启用了"应用密码"
    • 开启两步验证
    • 检查SMTP设置是否正确
  4. Gmail API错误
    • 确保OAuth令牌有效
    • 检查API配额和权限
  5. TypeScript编译错误
    • 运行 npm install 确保依赖安装完整
    • 检查Node.js版本 (推荐 v18+)

🔗 相关链接

�� 许可证

ISC License

-
security - not tested
F
license - not found
-
quality - not tested

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.

  1. 🚀 功能特性
    1. 📦 安装
      1. ⚙️ 配置
        1. 选项一:使用QQ邮箱 (推荐)
        2. 选项二:使用163邮箱
        3. 选项三:使用Gmail
        4. 选项四:使用Gmail API
      2. 🔧 使用方法
        1. 直接启动
        2. 使用SuperGateway调试 (推荐)
        3. 在Cline中配置
        4. 开发模式
      3. 🛠️ 可用工具
        1. send_email
        2. read_emails
        3. search_emails
        4. delete_email
        5. reply_email
      4. 🔐 支持的邮箱服务
        1. 🐛 故障排除
          1. 常见问题
        2. 🔗 相关链接
          1. �� 许可证

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              A 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
            • -
              security
              A
              license
              -
              quality
              A 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 -
              87
              4
              TypeScript
              MIT License
            • -
              security
              A
              license
              -
              quality
              A 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 -
              Python
              GPL 3.0
              • Apple
            • -
              security
              F
              license
              -
              quality
              A 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 -
              2
              Python
              • Linux
              • Apple

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/guangxiangdebizi/email-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server