Mail & Calendar
An MCP connector that runs as a Cloudflare Worker. It reads and searches iCloudmail directly over IMAP/SMTP, creates synchronized drafts, resolves threadedreplies, and applies saved sender signatures. It does not launch Mail.app oruse AppleScript.
The same connector serves any number of Gmail and Google Calendar accounts:Gmail tools that match Google's own Gmail connector, calendar tools that workacross every account, and one place to link them.
Added once to a Claude or ChatGPT account, it works in every app and devicesigned in to that account, with nothing installed per machine. Clients thatcan run shell commands, such as Claude Code, can also attach local filesthrough one-time upload links. Agents can also register webhooks that hearabout new iCloud mail (mail_listen_set).
| Guide | |
|---|---|
| docs/WORKER.md | Deploy, connect clients, attachments, new-mail webhooks, security |
| docs/GOOGLE.md | Link Gmail and Google Calendar accounts |
Data
Account passwords and preferences are Worker secrets, uploaded byscripts/setup-worker.mjs from this Mac's iCloud configuration (seedocs/WORKER.md). The primary address, sendingaddresses, signatures and display names live in the Worker's KV, seeded onfirst use and edited from chat. iCloud has no API for its alias settings, solist_sending_addresses adds addresses found in Sent and suggestscustom-domain recipients from the inbox.
Drafts live on iCloud: each managed draft carries its ID in a header, so everyclient sees the same drafts, revisions and send state.
Develop
corepack enable
pnpm install --frozen-lockfile
pnpm test
pnpm test:worker
src/worker/index.ts is the Worker: OAuth, the account-linking pages(accounts.ts), attachment uploads (uploads.ts) and the MailSessionDurable Object (session.ts) that serves MCP. src/mcp/server.ts combines theiCloud tools (src/icloud/) with the Gmail and Calendar tools(src/google/). The IMAP, SMTP, MIME and draft modules are undersrc/services/.
pnpm test:worker runs the Worker in local workerd and walks the OAuth flow aclaude.ai connector performs. Real IMAP integration tests run againstGreenMail with RUN_IMAP_IT=1 pnpm test:imap.
Attribution
The transport, MIME, and draft modules derive fromsweetrb/apple-mail-mcp, under the MITlicense. The original copyright notice is preserved in LICENSE.