icloud-mail-mcp
Allows Claude to list iCloud Mail folders with message and unread counts, search messages by date range, sender, subject, and unread status, read message headers and plain-text bodies, and archive up to 50 messages to Archive via IMAP.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
icloud-mail-mcp
A small remote MCP server that lets Claude search, read and archive iCloud Mail.
It runs as one Cloudflare Worker, talks IMAP over implicit TLS to
imap.mail.me.com:993, and signs Claude in with OAuth gated by Cloudflare Access.
What it can do
Tool | Does | Changes mail? |
| Folder names with message and unread counts | No |
| One folder, by date range, sender, subject, unread. Newest first, max 50 | No |
| Headers and plain-text body (512 KB raw, 20k chars text). Attachments listed, not returned | No (opens the folder read-only, so nothing is marked read) |
| Moves up to 50 messages to Archive | Yes, a move only |
There is no send, delete, flag or mark-read tool. Archive uses IMAP MOVE
when the server has it. Without MOVE it needs UIDPLUS: ImapFlow then
copies the messages, flags just those as \Deleted in the source folder and
runs UID EXPUNGE on exactly those UIDs, so it can never purge other messages
already marked deleted. With neither, it refuses. iCloud
currently takes the UIDPLUS path. If the server reports a failed move, the
tool returns an error rather than claiming success.
Archive is a separate OAuth scope (mail:archive) that you tick on the consent
page, so you can connect read-only first.
Related MCP server: IMAP MCP Server
How sign-in works
Claude ──OAuth (DCR/CIMD, PKCE)──▶ Worker /authorize ◀── Cloudflare Access (only your email)
│ │ verifies the Access JWT again, then shows a consent page
└──── bearer token ────▶ Worker /mcp ──IMAP over TLS──▶ imap.mail.me.com:993Cloudflare Access protects only
/authorize. Claude's servers must reach/token,/registerand/mcpdirectly, and those are protected by the OAuth tokens instead.The Worker checks the Access JWT itself too (issuer, audience, owner email), so a loosened Access policy still cannot let anyone else in.
Authorization codes go only to
https://claude.aiorhttps://claude.comredirect hosts (ALLOWED_REDIRECT_HOSTS).The app-specific password lives only as a Worker secret. Tokens and grants live hashed and encrypted in KV (by
@cloudflare/workers-oauth-provider).
Layout
src/store.ts: the allowed operations, as an interfacesrc/imap-store.ts: that interface over ImapFlow (search, read, archive)src/tools.ts: MCP tool definitions and input validationsrc/mcp-http.ts: stateless Streamable HTTP handler. Serves the 2026-07-28 MCP protocol through the v2 TypeScript SDK and still answers 2025-era clientssrc/access.ts: Cloudflare Access JWT check and redirect allowlistsrc/consent.ts: the consent pagesrc/imap-client.ts: per-call IMAP session overcloudflare:socketssrc/worker.ts: wires OAuth, Access and MCP togethertest/: 68 tests against synthetic fixtures (no real mail)
Develop
cp wrangler.example.jsonc wrangler.jsonc # git-ignored; fill in your values
npm ci
npm test # vitest, synthetic fixtures only
npm run typecheck
npx wrangler deploy --dry-run --outdir dist # bundle without deployingSetup and deploy steps are in SETUP.md.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Connect Gmail, iCloud Mail, Outlook, Yahoo Mail, Fastmail and other IMAP inboxes to ChatGPT, Claude and compatible AI assistants. Find emails by meaning across languages with semantic search. Ask AI to find customer conversations, summarize deadlines and draft follow-ups. Give a sales rep access to a shared outreach inbox or bring email into a compatible CRM. Share an iCloud custom-domain inbox with teammates without their own Apple ID or iCloud+ plan. Search results may be incomplete or stale; separate permissions control mail actions.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.40819 npm140MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to read, search, send, and manage emails across multiple IMAP/SMTP accounts via a single deployment.-
- FlicenseNot gradedqualityBmaintenanceEnables Claude to read, search, draft, send, flag, and move email across multiple IMAP/SMTP mailboxes while keeping credentials local.-
- AlicenseNot gradedqualityBmaintenanceEnables Claude and ChatGPT to read, search, and organize mail in a user's own email account, including folders, threads, attachments, drafts, and optional sending, with per-user permission levels and OAuth-secured remote connections.MIT