imail-mcp
Allows reading, searching, sending, and organizing iCloud Mail through IMAP and SMTP, including listing folders, searching messages, composing and sending emails, replying, forwarding, moving messages, setting flags, and managing drafts.
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., "@imail-mcpshow me unread emails in my inbox"
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.
imail-mcp
π·πΊ ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ Π½Π° ΡΡΡΡΠΊΠΎΠΌ: README.ru.md
An MCP server that connects Claude (Cowork / Claude Code / Claude Desktop) to your email account so it can read, search, send, and organize your mail β directly from a conversation.
iCloud Mail is the first supported provider. The internals are written against a provider-agnostic interface, so Gmail / Microsoft 365 adapters can be added later without touching a single tool.
Highlights
π₯ Read & search β list folders, search by sender/subject/text/date, read full messages and whole threads, download attachments.
βοΈ Send & reply β compose, reply, reply-all, and forward with correct threading headers set automatically.
ποΈ Organize β move, archive, delete, and mark messages read/unread or flagged.
π Credentials stay local β stored in the macOS Keychain, never in a plaintext file or env var.
π Never sends silently β Claude is instructed to always preview an email and get your explicit approval before anything leaves your outbox.
Related MCP server: mcp-imap-server
Why a one-time setup (and no "Sign in with Apple" button)
Apple does not offer an OAuth / consent flow for third-party access to iCloud Mail. The only supported path is standard IMAP + SMTP with an app-specific password (required because every iCloud account uses 2FA).
So setup is a one-time step: generate that password once, hand it to the server, done. It is verified with a live IMAP login and then stored in your macOS Keychain β not on disk, not in your shell profile.
Platform note: credential storage uses the built-in macOS
securityCLI, so the server currently targets macOS. (A different keystore backend is all that's needed to support Linux/Windows.)
Install & connect
Requires Node.js β₯ 18.
git clone git@github.com:nurked/icloud-mail-mcp.git
cd icloud-mail-mcp
npm install
npm run build
npm run setup # or: node dist/bin/setup.jssetup opens a local page at http://127.0.0.1:4577 (bound to localhost
only β never exposed off your machine). The page:
Links you to Apple's app-specific password page.
Takes your iCloud address + the 16-character password you generate.
Does a live IMAP test login to verify it works.
Saves the credentials to your Keychain.
Generating the app-specific password
Open appleid.apple.com β Sign-In and Security β App-Specific Passwords.
Click Generate an app-specific password, name it
imail-mcp.Copy the 16-character password and paste it into the setup page.
Wire it into Claude
Add the server to your MCP config (Claude Desktop / Cowork / Claude Code
mcpServers):
{
"mcpServers": {
"imail": {
"command": "node",
"args": ["/absolute/path/to/icloud-mail-mcp/dist/index.js"]
}
}
}If you install the package globally (
npm linkornpm i -g), you can use"command": "imail-mcp"with noargsinstead.
Restart Claude and the imail tools become available.
Tools
Tool | What it does |
| List folders with their IMAP paths and special-use roles |
| Search by from / to / subject / text / date / unread (filters AND together) |
| Full headers, text + HTML body, attachment metadata |
| The whole conversation, oldest β newest |
| Save an attachment to a temp file, return its path |
| Build an email for review β does not send |
| Send now (only after your approval) |
| Put it in Drafts for you to send yourself |
| Reply / reply-all, threading headers set from the original |
| Forward to new recipients with a quoted header |
| Move a message to another mailbox |
| Mark read/unread, flag/unflag |
| Move to Archive |
| Move to Trash (expunge if already there) |
Sending is never silent
The server ships an instruction telling Claude to always show you a
compose_preview and get your explicit go-ahead before calling send_email
(or reply / forward). If you'd rather send it yourself, ask Claude to
save_draft instead and the message lands in your Drafts folder.
How it works
Claude ββstdioβββΆ imail-mcp ββIMAP (imap.mail.me.com:993)βββΆ iCloud
β ββSMTP (smtp.mail.me.com:587)βββΆ iCloud
ββ credentials βββ macOS KeychainIMAP (imapflow) handles reading and organizing; SMTP (nodemailer) handles sending; bodies are parsed with mailparser.
The provider connects lazily on the first tool call, so adding the server to Claude doesn't touch your mailbox until you actually use it.
The MCP
stdiotransport owns stdout, so all logging goes to stderr to keep the protocol stream clean.
Project layout
src/
index.ts MCP server + tool definitions
bin/setup.ts `imail-mcp-setup` entry point
auth/
setup-server.ts local connect page + live IMAP verification
keychain.ts macOS Keychain storage (via `security` CLI)
providers/
types.ts provider-agnostic MailProvider contract
icloud.ts iCloud IMAP/SMTP implementationAdding another provider
The tools only ever talk to the MailProvider interface, so a new backend is
one new file:
Implement
MailProvider(seesrc/providers/types.ts) in a new file undersrc/providers/.Select it in
src/index.ts.
The tools stay unchanged.
Troubleshooting
"No iCloud credentials found" β run
npm run setupfirst; the server reads from the Keychain on first tool use."Login failed" during setup β make sure you used an app-specific password, not your normal Apple ID password.
Re-connecting / changing accounts β just run
npm run setupagain; it overwrites the stored credentials (-Uupdate) after a fresh verification.
License
PolyForm Noncommercial License 1.0.0 β this is source-available, not OSI open source.
β Free for any noncommercial purpose β personal use, study, research, hobby projects, and use by nonprofits, schools, and government bodies.
β You may read, modify, and redistribute it; the copyright notice must stay intact, so your work is always credited.
πΌ Commercial use requires a separate license. If you want to use imail-mcp to make money β in a product, a paid service, or inside a for-profit company β contact Investment Fidelity Company at ceo@investmentfidelity.company to arrange a commercial license.
See LICENSE.md for the full terms.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/nurked/icloud-mail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server