The MCP Email Service is a multi-account IMAP/SMTP email management system with local caching and AI integration capabilities.
Email Operations: List, view, search, send, reply to, and forward emails with attachment support. Mark emails as read/unread, delete (to trash or permanently), flag/star, and move between folders—all with single or batch operations. Filter by unread status, folders, date ranges, sender/recipient, and pagination.
Account & Folder Management: Manage multiple email providers (Gmail, Outlook, QQ Mail, 163 Mail, custom IMAP). List configured accounts, folders/labels, unread counts per folder, and test IMAP/SMTP server connections.
Attachments & Headers: Download email attachments and fetch email headers without downloading full message content.
Synchronization & Caching: Sync emails to local database for offline access and faster operations. Control sync scheduling (start/stop, force sync), monitor sync health and history, configure sync intervals and cleanup policies, and view connection pool statistics for IMAP connection reuse.
Contact Analysis: Analyze communication patterns, contact frequency, and timeline history using cached data.
System Information: Access service version information, git commit details, and recent synchronization activity logs.
AI Integration: Structured JSON outputs for AI agents and OpenClaw skill integration for automated workflows.
Enables management of Gmail accounts including reading, searching, sending, and organizing emails, with support for attachments, folders, and contact analysis.
Provides workflow automation for email monitoring with AI-powered filtering and multi-platform notifications through n8n workflow templates.
Powers AI-based email filtering, translation, summarization, and intelligent monitoring to identify important emails and generate automated responses.
Sends rich formatted email notifications and alerts to Slack channels with block-based formatting for monitored emails.
Delivers styled email notifications to WeChat Work with color coding for AI-monitored important emails.
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., "@MCP Email Serviceshow me unread emails from the last 24 hours"
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.
Mailbox CLI
CLI-first email management for multi-account IMAP/SMTP with a local sync cache.
Primary interface: the mailbox CLI (Node.js implementation). This repo ships
prebuilt platform binaries via npm (no Python required for end users).
Supported Providers
163 Mail (mail.163.com / mail.126.com)
QQ Mail (mail.qq.com)
Gmail (mail.google.com)
Outlook/Hotmail
Custom IMAP servers
Install
npm (recommended)
npm install -g @leeguoo/mailbox-cli
mailbox --helpThe npm package ships prebuilt binaries per platform (no Python required).
From source (development)
pnpm install
pnpm test
# build a local platform binary into mailbox-cli/packages/<platform>/bin/mailbox
pnpm build:binaryConfigure accounts
mkdir -p ~/.config/mailbox
cp examples/accounts.example.json ~/.config/mailbox/auth.jsonConfig locations:
Credentials:
~/.config/mailbox/auth.jsonOther settings:
~/.config/mailbox/config.toml
Common commands
# CLI help
mailbox --help
# list accounts
mailbox account list --json
# list unread emails (cache by default)
mailbox email list --unread-only --limit 20 --json
# show one email
mailbox email show 123456 --account-id my_account_id --json
# mark read (use --dry-run to validate first)
mailbox email mark 123456 --read --account-id my_account_id --folder INBOX --dry-run --json
mailbox email mark 123456 --read --account-id my_account_id --folder INBOX --confirm --json
# delete
mailbox email delete 123456 --account-id my_account_id --folder INBOX --confirm --jsonCache + sync
Cache DB default:
~/.local/share/mailbox/email_sync.dbListing uses cache by default where possible. Add
--liveto force IMAP.
mailbox sync status --json
mailbox sync force --json
mailbox sync init
mailbox sync daemonAI usage guide
If you're integrating this CLI into an AI agent, start here:
docs/AI_SKILL_MAILBOX_CLI.md
OpenClaw integration
This repo includes an OpenClaw skill at skills/mailbox/SKILL.md.
OpenClaw loads skills from:
<workspace>/skills~/.openclaw/skills
Quick link helper (symlink into ~/.openclaw/skills):
./scripts/link_openclaw_skill.shForce replace an existing link:
./scripts/link_openclaw_skill.sh --forceTo use this repo without copying files, add the repo skills directory to
skills.load.extraDirs in ~/.openclaw/openclaw.json:
{
"skills": {
"load": {
"extraDirs": [
"/path/to/mcp-email-service/skills"
]
}
}
}OpenClaw handles channel delivery and scheduling; mailbox returns structured JSON outputs and optional text summaries.
Verify OpenClaw picked up the skill:
openclaw skills list --eligible
openclaw skills checkContract
docs/CLI_JSON_CONTRACT.md