Mail Mcp

# Mail MCP Skill

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Mail Mcp" with this command: npx skills add AdJIa/mail-mcp

Mail MCP Skill

帮助用户使用邮件 MCP 服务,自动检查和安装 mail-mcp。

触发词

  • 发邮件
  • 收邮件
  • 查邮件
  • 邮箱
  • email
  • mail
  • SMTP
  • IMAP
  • 附件

功能

  1. 自动安装: 检查 mail-mcp 是否已安装,未安装则自动从 GitHub 安装
  2. 发送邮件: 支持纯文本、HTML、附件
  3. 搜索邮件: 按 folder、条件搜索邮件
  4. 管理文件夹: 列出、创建、删除、重命名文件夹
  5. 邮件操作: 标记已读/未读、星标、移动、复制、删除

安装检查

方式一:pip 安装(推荐)

pip install git+https://github.com/AdJIa/mail-mcp-server.git

方式二:本地安装

git clone https://github.com/AdJIa/mail-mcp-server.git
cd mail-mcp-server
pip install -e .

验证安装

which mail-mcp
# 应输出: /home/xxx/.local/bin/mail-mcp

配置

mcporter 配置

~/.mcporter/mcporter.json 中添加:

{
  "mcpServers": {
    "mail-mcp": {
      "command": "mail-mcp",
      "env": {
        "IMAP_HOST": "your-imap-server.com",
        "IMAP_PORT": "993",
        "EMAIL_USER": "your-email@example.com",
        "EMAIL_PASSWORD": "your-password",
        "IMAP_SSL": "true",
        "SMTP_HOST": "your-smtp-server.com",
        "SMTP_PORT": "465",
        "SMTP_SSL": "true"
      }
    }
  }
}

环境变量说明

变量说明示例
IMAP_HOSTIMAP 服务器地址mail.qiye.aliyun.com
IMAP_PORTIMAP 端口993
EMAIL_USER邮箱账号user@example.com
EMAIL_PASSWORD邮箱密码password
IMAP_SSL启用 SSLtrue
SMTP_HOSTSMTP 服务器地址smtp.qiye.aliyun.com
SMTP_PORTSMTP 端口465
SMTP_SSL启用 SSLtrue
SMTP_STARTTLS启用 STARTTLS (端口 587)false

常见邮箱配置

邮箱IMAPSMTP备注
Gmailimap.gmail.com:993smtp.gmail.com:465需要 App Password
阿里云企业邮箱mail.qiye.aliyun.com:993smtp.qiye.aliyun.com:465
腾讯企业邮箱imap.exmail.qq.com:993smtp.exmail.qq.com:465
QQ邮箱imap.qq.com:993smtp.qq.com:465需要授权码
Outlookoutlook.office365.com:993smtp.office365.com:587STARTTLS

使用示例

mcporter 调用

# 列出文件夹
mcporter call mail-mcp.list_folders

# 搜索邮件
mcporter call mail-mcp.search_emails --args '{"folder": "INBOX", "limit": 10}'

# 发送邮件
mcporter call mail-mcp.send_email --args '{
  "to": ["recipient@example.com"],
  "subject": "测试邮件",
  "body_text": "这是邮件内容"
}'

# 发送带附件的邮件
mcporter call mail-mcp.send_email --args '{
  "to": ["recipient@example.com"],
  "subject": "带附件的邮件",
  "body_text": "请查收附件",
  "attachments": [{
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "data_base64": "JVBERi0xLjQK..."
  }]
}'

发送附件示例

import base64

# 读取文件并编码
with open("report.pdf", "rb") as f:
    data_base64 = base64.b64encode(f.read()).decode()

# 使用 data_base64 作为 attachments[].data_base64

MCP 工具列表

工具功能
list_folders列出所有文件夹
create_folder创建文件夹
delete_folder删除文件夹
rename_folder重命名文件夹
search_emails搜索邮件
get_email获取邮件详情
mark_read标记已读
mark_unread标记未读
mark_flagged添加星标
unmark_flagged移除星标
move_email移动邮件
copy_email复制邮件
delete_email删除邮件
get_current_date获取当前时间
send_email发送邮件
send_reply回复邮件
send_forward转发邮件

错误处理

所有工具返回结构化响应,错误格式:

{
  "error": "错误描述"
}

注意事项

  1. Gmail 需要使用 App Password
  2. QQ邮箱需要在设置中开启 IMAP/SMTP 并获取授权码
  3. 附件通过 base64 编码传输
  4. 建议使用 SSL 加密连接

项目地址

https://github.com/AdJIa/mail-mcp-server

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Joke Api

Access diverse jokes by category, language, and type with filters for safe content using the free JokeAPI without requiring registration or an API key.

Registry SourceRecently Updated
General

Stripe Manager

Error: --action required. Use when you need stripe manager capabilities. Triggers on: stripe manager, key, customer-id, amount, currency, desc.

Registry SourceRecently Updated
General

Doc Summarize Pro

Enhanced document summarizer. Smart summary, bullet extraction, executive summary, chapter breakdown, multi-doc comparison, translate+summarize, action item...

Registry SourceRecently Updated
General

GI API Design FastAPI

Design and implement RESTful API endpoints following FastAPI best practices. Use when creating new API routes, designing request/response schemas, or when th...

Registry SourceRecently Updated