邮件
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"zerolib-email": {
"args": [
"mcp-email-server@latest",
"stdio"
],
"command": "uvx",
"env": {
"MCP_EMAIL_SERVER_ACCOUNT_NAME": "work",
"MCP_EMAIL_SERVER_EMAIL_ADDRESS": "john@example.com",
"MCP_EMAIL_SERVER_FULL_NAME": "John Doe",
"MCP_EMAIL_SERVER_IMAP_HOST": "imap.gmail.com",
"MCP_EMAIL_SERVER_IMAP_PORT": "993",
"MCP_EMAIL_SERVER_PASSWORD": "your_password",
"MCP_EMAIL_SERVER_SMTP_HOST": "smtp.gmail.com",
"MCP_EMAIL_SERVER_SMTP_PORT": "465",
"MCP_EMAIL_SERVER_USER_NAME": "john@example.com"
}
}
}
}
该服务需要配置环境变量:MCP_EMAIL_SERVER_ACCOUNT_NAME、MCP_EMAIL_SERVER_EMAIL_ADDRESS、MCP_EMAIL_SERVER_FULL_NAME、MCP_EMAIL_SERVER_IMAP_HOST、MCP_EMAIL_SERVER_IMAP_PORT、MCP_EMAIL_SERVER_PASSWORD、MCP_EMAIL_SERVER_SMTP_HOST、MCP_EMAIL_SERVER_SMTP_PORT、MCP_EMAIL_SERVER_USER_NAME
可用工具 (7 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
list_available_accounts
List all configured email accounts with masked credentials.
该工具无需必填参数,直接调用即可
add_email_account 1 个参数 需填 1 项
Add a new email account configuration to the settings.
必填参数:email
list_emails_metadata 13 个参数 需填 1 项
List email metadata (email_id, subject, sender, recipients, date) without body content. Returns email_id for use with get_emails_content.
必填参数:account_name
get_emails_content 3 个参数 需填 2 项
Get the full content (including body) of one or more emails by their email_id. Use list_emails_metadata first to get the email_id.
必填参数:account_name、email_ids
send_email 10 个参数 需填 4 项
Send an email using the specified account. Supports replying to emails with proper threading when in_reply_to is provided.
必填参数:account_name、recipients、subject、body
delete_emails 3 个参数 需填 2 项
Delete one or more emails by their email_id. Use list_emails_metadata first to get the email_id.
必填参数:account_name、email_ids
download_attachment 5 个参数 需填 4 项
Download an email attachment and save it to the specified path. This feature must be explicitly enabled in settings (enable_attachment_download=true) due to security considerations.
必填参数:account_name、email_id、attachment_name、save_path
服务介绍
mcp-email-server
通过MCP服务器实现IMAP和SMTP