Email MCP
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
一个基于 MCP Streamable HTTP 的通用邮箱服务。固定提供 5 个工具,支持通过标准 IMAP/SMTP 使用 QQ、163、126、Gmail、Outlook、Yahoo、iCloud、企业邮箱和自建邮箱, 同时保留 Gmail API 模式。
解决的问题
Issue #1 的根因是旧版本只有 send_email 使用 SMTP;读取、搜索、删除和回复全部写死为
Gmail API,因此 163 等邮箱只能发信。当前实现改为:
send_email、reply_email:标准 SMTP(或 Gmail API)。read_emails、search_emails、delete_email:标准 IMAP(或 Gmail API)。工具总数仍为 5,名称保持不变。
每个工具都有可选
account参数,可在命名账号之间逐次调用切换。每个 HTTP 请求也可使用
X-Email-*Header 切换或覆盖连接配置,无需重启服务。
Related MCP server: MCP Email Server
安装与启动
要求 Node.js 18 或更高版本。
从 npm 全局安装:
npm install -g @xingyuchen/email-mcp
email-mcp-server从源码运行:
npm install
cp .env.example .env
npm run build
npm start默认地址:
http://localhost:3200/mcp健康检查:
curl http://localhost:3200/health这是原生 Streamable HTTP MCP,不再需要 SuperGateway,也不是旧的 /sse 协议。
单邮箱配置
163 邮箱
先在 163 邮箱设置中启用 SMTP/IMAP,并使用客户端授权码而不是登录密码:
EMAIL_PROVIDER=imap-smtp
SMTP_HOST=smtp.163.com
SMTP_PORT=465
SMTP_SECURE=true
SMTP_USER=your-email@163.com
SMTP_PASS=your-authorization-code
IMAP_HOST=imap.163.com
IMAP_PORT=993
IMAP_SECURE=true
IMAP_USER=your-email@163.com
IMAP_PASS=your-authorization-code
DEFAULT_FROM_EMAIL=your-email@163.com对于常见邮箱,可只配置账号和授权码,服务器会根据邮箱域名补全主机、端口和 TLS:
EMAIL_PROVIDER=imap-smtp
SMTP_USER=your-email@qq.com
SMTP_PASS=your-authorization-code
DEFAULT_FROM_EMAIL=your-email@qq.com当 IMAP_USER/IMAP_PASS 未设置时,会复用 SMTP 凭据;反向亦然。企业邮箱或自建邮箱
只需显式填写对应的 SMTP_* 和 IMAP_* 地址即可。
Gmail API 兼容模式
EMAIL_PROVIDER=gmail-api
GMAIL_CLIENT_ID=...
GMAIL_CLIENT_SECRET=...
GMAIL_REFRESH_TOKEN=...
DEFAULT_FROM_EMAIL=your-email@gmail.com也可只传有效的 GMAIL_ACCESS_TOKEN。如果使用 Gmail 的标准 IMAP/SMTP,则将
EMAIL_PROVIDER 设为 imap-smtp 并使用应用专用密码。
多邮箱切换(不增加工具)
使用 EMAIL_ACCOUNTS_JSON 定义命名账号:
EMAIL_DEFAULT_ACCOUNT=personal
EMAIL_ACCOUNTS_JSON={"personal":{"provider":"imap-smtp","from":"me@qq.com","smtp":{"user":"me@qq.com","pass":"qq-code"},"imap":{"user":"me@qq.com","pass":"qq-code"}},"work":{"provider":"imap-smtp","from":"me@outlook.com","smtp":{"user":"me@outlook.com","pass":"work-code"},"imap":{"user":"me@outlook.com","pass":"work-code"}}}随后直接在原有工具中选择账号:
{
"account": "work",
"limit": 10,
"folder": "INBOX"
}read_emails 和 search_emails 返回的 messageId 是不包含密码的定位符,其中保留了
命名账号和 IMAP 文件夹信息。把它直接传给 reply_email 或 delete_email 时,通常无需
再次填写 account。
通过请求头配置或切换邮箱
MCP 客户端可以为 Streamable HTTP 连接设置静态 Header:
{
"mcpServers": {
"email": {
"type": "streamable-http",
"url": "http://localhost:3200/mcp",
"headers": {
"Authorization": "Bearer your-mcp-api-key",
"X-Email-Account": "work"
}
}
}
}也可以完全通过 Header 提供连接信息:
{
"X-Email-Provider": "imap-smtp",
"X-Email-From": "me@example.com",
"X-Email-SMTP-Host": "smtp.example.com",
"X-Email-SMTP-Port": "465",
"X-Email-SMTP-Secure": "true",
"X-Email-SMTP-User": "me@example.com",
"X-Email-SMTP-Pass": "app-password",
"X-Email-IMAP-Host": "imap.example.com",
"X-Email-IMAP-Port": "993",
"X-Email-IMAP-Secure": "true",
"X-Email-IMAP-User": "me@example.com",
"X-Email-IMAP-Pass": "app-password"
}还支持 X-Email-Config,值为完整 JSON,或 base64:<base64url-json>。可用字段与
EMAIL_ACCOUNTS_JSON 内单个账号相同。
配置优先级从高到低:
单独的
X-Email-*连接 Header。X-Email-Config。account参数或X-Email-Account选中的命名账号。普通环境变量。
账号选择优先级为:工具 account > X-Email-Account > X-Email-Config.account >
EMAIL_DEFAULT_ACCOUNT。
Header 中可能包含邮箱授权码。跨机器部署时必须使用 HTTPS,并建议设置
MCP_API_KEY;不要在日志中打印请求头。
固定的 5 个工具
工具 | 用途 | 主要协议 |
| 发送纯文本/HTML 邮件及附件 | SMTP / Gmail API |
| 读取文件夹,可只读未读邮件 | IMAP / Gmail API |
| 搜索指定文件夹 | IMAP / Gmail API |
| 删除指定邮件 | IMAP / Gmail API |
| 回复或回复全部 | IMAP + SMTP / Gmail API |
五个工具均支持可选 account 参数。
通用 IMAP 搜索支持普通文本,以及:
from:alice@example.com subject:"quarterly report" since:2026-01-01 before:2026-08-01 is:unread服务配置
环境变量 | 默认值 | 说明 |
|
| HTTP 监听地址 |
|
| HTTP 端口 |
|
| Streamable HTTP 路径 |
| 空 | 可选 Bearer / |
| 空 | 可选 CORS 来源,多个值用逗号分隔 |
验证
npm test共 10 项自动化测试,覆盖配置优先级、163 IMAP 泛化、命名账号切换、请求头覆盖、消息 定位符、搜索语法、标准 IMAP 读/搜/删、SMTP 发/回、Streamable HTTP 初始化和工具数量 不变约束。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides a seamless email management interface through Claude, allowing users to search, read, and send emails directly through natural language conversations.4114MIT
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables LLMs to compose and send emails with attachments, as well as search for files in specified directories that match given patterns.80MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that exposes multiple AI tools over SSE transport with JWT-based secure authentication, allowing for dynamic tool registration and session management.10,1514MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that provides email access via IMAP and SMTP, enabling AI agents to read, search, send, and manage emails. It features specialized tools for folder management, message retrieval, and replying to threads through a standardized HTTP/SSE interface.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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