Connects to Apple services to manage iCloud Mail accounts, enabling email reading, searching, and automated inbox organization through the use of Apple app-specific passwords.
Provides comprehensive tools for managing iCloud Mail, including reading and searching emails, sending and replying to messages via SMTP, performing bulk operations like move and delete, and managing mailbox folders.
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., "@icloud-mcpFind all emails from Sarah about the project and summarize them"
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.
icloud-mcp
A Model Context Protocol (MCP) server that connects Claude to your iCloud Mail account. Read, search, organize, send, and automate your inbox directly through Claude.
Features
๐ฌ Read and paginate through any mailbox
๐ Search emails by keyword, sender, subject, body, date range, and more
๐งต Find email threads by References/In-Reply-To chain
โ๏ธ Send emails, reply, forward, and save drafts via iCloud SMTP
๐ Create saved rules to auto-route emails on demand
๐๏ธ Bulk delete emails by any combination of filters
๐ Bulk move emails between folders with safe copy-verify-delete
๐ฆ Archive emails older than N days to any folder
๐ Analyze top senders and storage usage to identify inbox clutter
๐ข Count emails matching any filter before taking action
โ Mark emails as read/unread, flag/unflag in bulk or individually
๐ List and download email attachments (supports paginated byte-range fetching for large files)
๐ Extract List-Unsubscribe links for AI-assisted cleanup
๐๏ธ List, create, rename, and delete mailboxes
๐ Dry run mode for bulk operations โ preview before committing
๐ Safe move โ emails are fingerprinted and verified in the destination before removal from source
๐ Session logging โ Claude tracks progress across long multi-step operations
Prerequisites
Claude Desktop or Claude Code
Node.js v20 or higher
An iCloud account with an app-specific password
Setup
1. Generate an Apple App-Specific Password
Go to appleid.apple.com
Sign in and navigate to Sign-In and Security โ App-Specific Passwords
Click + to generate a new password
Label it something like
Claude MCPand save the generated password
2. Install the package
npm install -g icloud-mcpThen find the install location:
npm root -gThe path varies by setup:
Setup | Typical path |
Mac with Homebrew Node |
|
Mac with system Node |
|
nvm |
|
3. Verify your setup
Before configuring Claude Desktop, run the doctor command to confirm everything is working:
IMAP_USER="you@icloud.com" IMAP_PASSWORD="your-app-specific-password" node $(npm root -g)/icloud-mcp/index.js --doctorYou should see:
icloud-mcp doctor
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
IMAP_USER is set
โ
IMAP_PASSWORD is set
โ
IMAP_USER looks like an email address
โ
Connected to imap.mail.me.com:993
โ
Authenticated as you@icloud.com
โ
INBOX opened (12453 messages)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
All checks passed. Ready to use with Claude Desktop.If any step fails, a plain-English explanation and suggested fix will be shown.
4. Connect to Claude
Claude Desktop
Open your Claude Desktop config file:
open ~/Library/Application\ Support/Claude/claude_desktop_config.jsonAdd the following under mcpServers, replacing the path with your npm root from step 2:
{
"mcpServers": {
"icloud-mail": {
"command": "node",
"args": ["/opt/homebrew/lib/node_modules/icloud-mcp/index.js"],
"env": {
"IMAP_USER": "you@icloud.com",
"IMAP_PASSWORD": "your-app-specific-password"
}
}
}
}Then fully quit Claude Desktop (Cmd+Q) and reopen it.
Claude Code
Run this command once to register the server for your user account (available across all projects):
claude mcp add icloud-mail \
--scope user \
-e IMAP_USER=you@icloud.com \
-e IMAP_PASSWORD=your-app-specific-password \
-- node $(npm root -g)/icloud-mcp/index.jsOr use npx to avoid needing a global install:
claude mcp add icloud-mail \
--scope user \
-e IMAP_USER=you@icloud.com \
-e IMAP_PASSWORD=your-app-specific-password \
-- npx -y icloud-mcpVerify it registered correctly:
claude mcp listRunning from source? Copy
.mcp.json.exampleto.mcp.json, set your credentials in your shell, then runclaudefrom the repo directory. Claude Code will pick up the config automatically.
5. Add Custom Instructions (Recommended)
For large inbox operations, add the following to Claude Desktop's custom instructions to ensure Claude stays on track and checks in with you regularly. Go to Claude Desktop โ Settings โ Custom Instructions and add:
When using icloud-mail tools:
1. Before starting any multi-step operation, call log_clear then log_write with your full plan
2. After every single tool call, call log_write with what you did and the result
3. After every 3 tool calls, stop and summarize progress to the user and wait for confirmation before continuing
4. Never assume a bulk operation succeeded โ always verify with count_emails after
5. If you are ever unsure what you have done so far, call log_read before proceeding6. Start using it
You're all set. Try asking Claude:
"Show me the top senders in my iCloud inbox"
"How many unread emails do I have?"
Available Tools (55)
Read & Search
Tool | Description |
| Total, unread, and recent email counts for INBOX |
| Total, unread, and recent email counts for any folder |
| List all folders in your iCloud Mail |
| Paginated inbox with sender, subject, date (supports unread filter) |
| Full email content by UID โ MIME-aware, returns body + attachments list; supports |
| Raw RFC 2822 source as base64 (headers + MIME body, 1 MB cap) |
| All emails from a specific address |
| Emails between two dates |
| Search by keyword with filters; supports |
| Find all emails in the same thread (subject + References/In-Reply-To matching) |
| Count emails matching any combination of filters |
| Top senders by volume from a sample of recent emails |
| Top senders of unread emails |
| Estimate storage usage by size bucket and identify top large-email senders |
| Extract List-Unsubscribe links (email + URL) from an email |
| List all attachments in an email (filename, MIME type, size, partId) |
| Download an attachment as base64 (max 20 MB); supports |
Send & Draft
Tool | Description |
| Send a new email via iCloud SMTP; supports plain text, HTML, cc, bcc, replyTo |
| Reply to an email with correct In-Reply-To + References threading; supports |
| Forward an email with an optional prepended note |
| Save a draft to your Drafts folder without sending; supports plain text and HTML |
Write
Tool | Description |
| Flag or unflag a single email |
| Mark a single email as read or unread |
| Move an email to Deleted Messages |
| Move a single email to any folder |
Bulk Operations
Tool | Description |
| Move emails matching any combination of filters (safe copy-verify-delete); supports |
| Move all emails from a sender to a folder; supports |
| Move all emails from a domain to a folder; supports |
| Safely move emails older than N days to an archive folder; supports |
| Delete emails matching any combination of filters; supports |
| Delete all emails from a sender |
| Delete all emails matching a subject keyword |
| Delete all emails older than N days |
| Mark all (or all from a sender) as read |
| Mark all (or all from a sender) as unread |
| Mark all unread emails older than N days as read |
| Flag or unflag emails matching any combination of filters |
| Flag or unflag all emails from a specific sender |
| Permanently delete all emails in trash; supports |
Mailbox Management
Tool | Description |
| Create a new folder |
| Rename an existing folder |
| Delete a folder (must be empty first) |
Move Tracking
Tool | Description |
| Check the status of the current or most recent bulk move; includes stale warning for operations >24h old |
| Abandon an in-progress move so a new one can start |
Saved Rules
Tool | Description |
| Create a named rule with filters + action (move/delete/mark_read/mark_unread/flag/unflag) |
| List all saved rules with last-run time and run count |
| Run a specific rule by name; supports |
| Run all saved rules in sequence; supports |
| Delete a saved rule by name |
Session Log
Tool | Description |
| Write a step to the session log |
| Read the session log |
| Clear the session log and start fresh |
Filters
bulk_move, bulk_delete, bulk_flag, search_emails, count_emails, and rules all accept any combination of these filters:
Filter | Type | Description |
| string | Match exact sender email address |
| string | Match any sender from this domain (e.g. |
| string | Keyword to match in subject |
| string | Only emails before this date (YYYY-MM-DD) |
| string | Only emails since this date (YYYY-MM-DD) |
| boolean |
|
| boolean |
|
| number | Only emails larger than this size in KB |
| number | Only emails smaller than this size in KB |
| boolean | Only emails with attachments (requires narrow pre-filters โ scans up to 500 candidates) |
Safe Move
All bulk move operations (bulk_move, bulk_move_by_sender, bulk_move_by_domain, archive_older_than) use a three-phase copy-verify-delete approach:
Copy โ all emails are copied to the destination in chunks
Verify โ every email is fingerprinted and confirmed present in the destination
Delete โ source emails are removed in a single EXPUNGE only after verification passes
A persistent manifest at ~/.icloud-mcp-move-manifest.json tracks progress so a crash or dropped connection never results in data loss. Use get_move_status to inspect any operation and abandon_move to clear a stuck one.
Example Usage
Once configured, you can ask Claude things like:
"Show me the top senders in my iCloud inbox"
"What's eating the most storage in my inbox?"
"How many unread emails do I have from substack.com?"
"Find all emails in this thread and summarize the conversation"
"Move all emails from substack.com older than 2023 to my Newsletters folder"
"Archive everything in my inbox older than 1 year"
"Delete all unread emails from linkedin.com before 2022"
"What's the unsubscribe link for this newsletter?"
"Show me the 3 largest attachments in my inbox this month"
"Flag all unread emails from my bank"
"Create a rule that moves all emails from spotify.com to bulk-mail/services"
"Reply to the last email from John and cc Sarah"
"Draft a follow-up email to the team about the Q1 report"
Security
Your credentials are stored only in your local Claude Desktop config file
The server runs entirely on your machine โ no data is sent to any third party
App-specific passwords can be revoked at any time from appleid.apple.com
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.