Mail MCP
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., "@Mail MCPShow my inbox messages."
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.
Mail MCP (Python + modelcontextprotocol)
这是一个邮件助手 MCP 服务骨架,基于 Python 和官方 MCP Python SDK(mcp 包)。
当前版本先实现:
MCP 服务入口
本地邮箱数据存储(JSON)
常见邮件助手基础工具(列目录、读邮件、搜索、写草稿、发草稿)
1. 环境准备
要求:
Python 3.10+
安装:
python -m venv .venv
.venv\\Scripts\\activate
pip install -U pip
pip install -e .Related MCP server: Gmail AutoAuth MCP Server
2. 启动服务
mail-mcp或者:
python -m mail_mcp.server服务进程本身默认使用 HTTP(streamable-http),推荐通过反向代理提供 HTTPS。
默认地址:
Host:
127.0.0.1Port:
8000MCP Path:
/mcp后端 URL:
http://127.0.0.1:8000/mcp
你也可以通过环境变量覆盖:
Windows CMD:
set MCP_HOST=0.0.0.0
set MCP_PORT=9000
set MCP_PATH=/mcp
mail-mcpWindows PowerShell:
$env:MCP_HOST = "0.0.0.0"
$env:MCP_PORT = "9000"
$env:MCP_PATH = "/mcp"
mail-mcp2.1 通过反向代理提供 HTTPS(推荐)
思路:
mail-mcp只监听内网 HTTP(如127.0.0.1:8000)Nginx/Caddy 对外暴露 443,负责证书和 TLS
Nginx 示例:
server {
listen 443 ssl;
server_name mcp.example.com;
ssl_certificate /etc/letsencrypt/live/mcp.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mcp.example.com/privkey.pem;
location /mcp {
proxy_pass http://127.0.0.1:8000/mcp;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}Caddy 示例:
mcp.example.com {
reverse_proxy 127.0.0.1:8000
}对外连接地址示例:
https://mcp.example.com/mcp
3. 已提供的工具(Tools)
ping()健康检查
mailbox_list_folders()列出文件夹(
inbox/drafts/sent)
mailbox_list_messages(folder="inbox", limit=20)列出邮件摘要
mailbox_get_message(message_id)按 ID 获取邮件详情
mailbox_search(query, folder="inbox", limit=20)关键字搜索邮件
mailbox_compose(to, subject, body, cc=None, bcc=None)生成草稿
mailbox_send_draft(draft_id)发送草稿并移到
sent
4. 数据文件
本地数据在:
data/mailbox.json
首次启动会自动初始化示例数据。
5. 基本操作方法(开发流程)
启动 MCP 服务(
mail-mcp)在 MCP Host 中连接该服务
本地直连:
http://127.0.0.1:8000/mcp经反向代理:
https://mcp.example.com/mcp
调用
mailbox_list_folders查看目录调用
mailbox_list_messages查看inbox调用
mailbox_get_message查看指定邮件正文调用
mailbox_compose写邮件草稿调用
mailbox_send_draft完成发送
6. 下一步扩展建议
抽象
MailStore为接口,增加真实邮件提供商适配层:Microsoft Graph(Outlook)
Gmail API
IMAP/SMTP
增加身份认证与令牌管理
增加邮件标签、附件、线程会话支持
增加安全策略(敏感词、越权校验、审计日志)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/jiabin-24/mail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server