imap-mcp
imap-mcp
IMAP client MCP. Read mail from a Dovecot / Synology MailPlus mailbox, and optionally fire webhooks when new matching messages arrive — replaces fragile Gmail OAuth for automation triggers.
Tools
Tool | Description |
| Unread message summaries |
| Raw IMAP SEARCH |
| Full message (headers + text + html) |
| Set |
| Move to another folder |
| All folders |
| IMAP ping + watcher rules + fire count |
Environment
Variable | Required | Description |
| ✓ | Server (e.g. |
| Default | |
|
| |
| ✓ | Synology account name, not email |
| ✓ | |
| Default | |
| Inline JSON array of watch rules | |
| Path to JSON file (default | |
| Default | |
| MCP server port (default |
Watch rules
[
{
"name": "garmin-livetrack",
"mailbox": "INBOX",
"criteria": "FROM \"noreply@garmin.com\" SUBJECT \"LiveTrack\" UNSEEN",
"webhook_url": "http://host.docker.internal:5678/webhook/livetrack-mail",
"mark_read": true,
"move_to": null
}
]On startup the watcher "primes" each rule with existing matching UIDs, so
only new mail after boot fires. Every POLL_INTERVAL_SECS it re-runs
each rule's criteria and POSTs matching messages (full body) to webhook_url
as { "rule": "...", "mailbox": "...", "message": {...} }. After a
successful POST it either moves the message to move_to, or marks it read
if mark_read.