imap-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., "@imap-mcpsync unread emails from my iCloud inbox to my vault"
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.
imap-mcp
Connect any mailbox to your second brain.
An MCP server that reads mail over IMAP — iCloud, Gmail, Outlook, Fastmail,
university or company mail, anything that speaks the protocol — and turns it
into markdown notes you can search, plus RawItem records the Mycelium
runtime ingests directly.
MIT licensed. Runs on macOS, Linux, and Windows.
Why IMAP
Every mail provider speaks IMAP. One connector covers all of them, which matters when a room full of people each bring a different mailbox.
Where a provider already has a proper OAuth connector, prefer it —
google-workspace-mcp
for Gmail, microsoft-365-mcp
for Outlook. OAuth gives scoped, revocable access; an IMAP app password does
not. This server is for the mailboxes those two cannot reach: iCloud, which
publishes no OAuth grant for Mail at all, and every smaller or self-hosted
provider.
Related MCP server: imap-2-mcp
Supported providers
Provider | Host | Notes |
|
| Needs 2FA on the Apple ID |
|
| Prefer the OAuth connector; needs 2-Step Verification |
|
| Prefer the OAuth connector; many tenants disable IMAP |
|
| App passwords can be scoped to IMAP only |
| you set | University, company, self-hosted |
Ask the server itself with imap_list_providers — it returns each provider's
host and the exact page where you mint a password.
Setup
See SETUP.md. Three steps, and you mint the password yourself.
Tools
Tool | Access | Purpose |
| read | providers + where to get a password |
| read | is it reachable, does the credential work |
| read | exact folder names |
| read | compact summaries, no bodies |
| read | one full message |
| write | notes into your vault |
| read |
|
| read | why a message was or wasn't ingested |
Eight actions, under the ~15 threshold where a search+execute surface starts paying for itself, so it's one tool per action.
Safety
Your mailbox is never modified. Sessions open with EXAMINE (read-only)
and every fetch uses BODY.PEEK[]. A plain FETCH BODY[] sets the \Seen
flag as a side effect, so a "read-only" sync would quietly mark your unread
mail as read. The only tool that writes anything writes notes into your
vault.
Your password never leaves your machine. It lives in the OS keychain, is
never written to a config file, never logged, and never returned by a tool.
IMAP LOGIN failures echo the failed command back — which contains the
password — so auth errors are replaced wholesale rather than passed through.
Email is treated as untrusted input. Every message body is wrapped in an
UNTRUSTED_EMAIL_BODY fence, and a body that forges the closing marker to
break out of its own fence is neutralised. Mail is data to summarise, never
instructions to follow. This matters more than it sounds: anyone can send you
an email, so an unfenced body is a stranger writing directly into your
assistant's context.
Nothing is skipped silently. If the server renumbers a mailbox
(UIDVALIDITY changed), the sync cursor is discarded and the response says
uidvalidity_reset: true — a stale cursor would otherwise point at unrelated
messages and skip real mail forever. Filtered messages carry the rule that
dropped them, and imap_explain_filter explains any single one.
Every write says where it went. Results carry vault_root and
root_source, so mail landing in the wrong folder is visible in the first
response rather than discovered months later.
Filter
Smart defaults keep what matters and drop the noise. Folder names differ by
provider and by language, so they come from the provider profile rather than
being hardcoded — Gmail nests under [Gmail]/, Outlook says Junk Email, a
Spanish-locale account says Enviados.
Keep | Drop |
mail you sent | spam / junk / trash folders |
threads you replied to ( | newsletters ( |
flagged mail ( |
|
Explicit block beats explicit allow; both beat smart defaults. Turn defaults
off entirely with apply_smart_filter=False.
Two consumers, one core
imap_client.py is the only module that speaks IMAP.
Second brain —
imap_sync_to_vaultwritesExternal Inputs/<Provider>/<mailbox>/YYYY-MM-DD-<slug>.mdMycelium runtime —
imap_export_for_runtimeemits records matching the runtime'sRawItemfield-for-field, so the server-side adapter wraps this rather than reimplementing it
Tests
uv run pytest -q65 tests, no network required. The security guards (fence escaping, path containment, credential non-leakage) have each been mutation-tested: the guard removed, the matching test confirmed failing, the guard restored.
Not yet verified: no live smoke test has run against a real mailbox on any provider. Every test uses synthetic fixtures, which proves the parsing and filtering logic but not that a live server accepts these exact commands.
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.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvider-agnostic email MCP server that connects any IMAP mailbox to AI assistants, enabling email management through natural language.8AGPL 3.0
- FlicenseNot gradedqualityCmaintenanceEnables AI clients to search IMAP mailboxes with live access and a full-text index covering email bodies and attachments (PDF, DOCX, XLSX, text).
- AlicenseNot gradedqualityBmaintenanceConnects multiple IMAP and SMTP mailboxes to MCP clients like ChatGPT without exposing credentials, enabling email search and thread retrieval via natural language.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceIMAP/SMTP email for AI agents -- read, send, organize folders, and manage attachments across multiple accounts, with auto-discovery.MIT
Related MCP Connectors
Give an AI agent its own inbox — receive email as a webhook, send over a verified domain.
Email for AI agents — send, receive as a webhook, manage domains, templates, routing.
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/adelaidasofia/imap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server