A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Model Context Protocol server for iCloud Mail management and email operations
A Model Context Protocol (MCP) server for integrating with iCloud Mail using App Password authentication. This server provides tools to read, send, and manage emails through iCloud's IMAP and SMTP services.
Development logs for this project are being shared on Hack Club's Summer of Making. Check it out to follow the development journey!
# Clone the repository
git clone https://github.com/minagishl/icloud-mail-mcp.git
cd icloud-mail-mcp
# Install dependencies using pnpm
pnpm install
# Build the project
pnpm run build
The server requires environment variables to be set for authentication. Configuration is done through your MCP client settings:
Add to your MCP server configuration:
{
"icloud-mail-mcp": {
"command": "node",
"args": ["/path/to/icloud-mail-mcp/dist/index.js"],
"env": {
"ICLOUD_EMAIL": "your-email@icloud.com",
"ICLOUD_APP_PASSWORD": "your-app-specific-password"
}
}
}
get_messagesRetrieve email messages from a specified mailbox.
Parameters:
mailbox (string, optional): Mailbox name (default: "INBOX")limit (number, optional): Maximum number of messages to retrieve (default: 10)unreadOnly (boolean, optional): Retrieve only unread messages (default: false)send_emailSend an email through iCloud Mail.
Parameters:
to (string or array, required): Recipient email address(es)subject (string, required): Email subjecttext (string, optional): Plain text email bodyhtml (string, optional): HTML email bodymark_as_readMark email messages as read.
Parameters:
messageIds (array, required): Array of message IDs to mark as readmailbox (string, optional): Mailbox name (default: "INBOX")move_messagesMove messages between mailboxes.
Parameters:
messageIds (array, required): Array of message IDs to movesourceMailbox (string, required): Source mailbox namedestinationMailbox (string, required): Destination mailbox namesearch_messagesSearch for messages using various criteria.
Parameters:
query (string, optional): Search query text (searches in subject, from, body)mailbox (string, optional): Mailbox name (default: "INBOX")limit (number, optional): Maximum number of messages to retrieve (default: 10)dateFrom (string, optional): Start date for search (YYYY-MM-DD format)dateTo (string, optional): End date for search (YYYY-MM-DD format)fromEmail (string, optional): Filter by sender email addressunreadOnly (boolean, optional): Search only unread messages (default: false)delete_messagesDelete messages from a mailbox.
Parameters:
messageIds (array, required): Array of message IDs to deletemailbox (string, optional): Mailbox name (default: "INBOX")set_flagsSet flags on messages (read, unread, flagged, etc.).
Parameters:
messageIds (array, required): Array of message IDs to set flags onflags (array, required): Array of flags to set (e.g., ["\Seen", "\Flagged"])mailbox (string, optional): Mailbox name (default: "INBOX")action (string, optional): Whether to "add" or "remove" the flags (default: "add")download_attachmentDownload an attachment from a specific message.
Parameters:
messageId (string, required): Message ID containing the attachmentattachmentIndex (number, optional): Index of the attachment to download (0-based, default: 0)mailbox (string, optional): Mailbox name (default: "INBOX")auto_organizeAutomatically organize emails based on rules (sender, subject keywords, etc.).
Parameters:
rules (array, required): Array of organization rules with conditions and actionssourceMailbox (string, optional): Source mailbox to organize (default: "INBOX")dryRun (boolean, optional): If true, only shows what would be organized without moving emails (default: false)Rule Structure:
{
"name": "Rule name",
"condition": {
"fromContains": "sender keyword",
"subjectContains": "subject keyword"
},
"action": {
"moveToMailbox": "destination folder"
}
}
get_mailboxesList all available mailboxes in your iCloud Mail account.
Parameters: None
create_mailboxCreate a new mailbox (folder) in your iCloud Mail account.
Parameters:
name (string, required): Name of the mailbox to createdelete_mailboxDelete an existing mailbox (folder) from your iCloud Mail account.
Parameters:
name (string, required): Name of the mailbox to deleteSafety Features:
test_connectionTest the email server connection to verify IMAP and SMTP connectivity.
Parameters: None
check_configCheck if environment variables are properly configured and show connection status.
Parameters: None
Start the MCP server:
# With environment variables (recommended)
ICLOUD_EMAIL="your-email@icloud.com" ICLOUD_APP_PASSWORD="your-app-password" pnpm run start
# Or start normally and configure manually
pnpm run start
Get recent messages:
{
"tool": "get_messages",
"arguments": {
"limit": 5,
"unreadOnly": true
}
}
Send an email:
{
"tool": "send_email",
"arguments": {
"to": "recipient@example.com",
"subject": "Hello from MCP",
"text": "This email was sent using the iCloud Mail MCP server!"
}
}
Move messages between mailboxes:
{
"tool": "move_messages",
"arguments": {
"messageIds": ["message-id-1", "message-id-2"],
"sourceMailbox": "INBOX",
"destinationMailbox": "My Custom Folder"
}
}
Create a new mailbox:
{
"tool": "create_mailbox",
"arguments": {
"name": "My Custom Folder"
}
}
Delete a mailbox:
{
"tool": "delete_mailbox",
"arguments": {
"name": "My Custom Folder"
}
}
Test connection:
{
"tool": "test_connection",
"arguments": {}
}
Check configuration:
{
"tool": "check_config",
"arguments": {}
}
# Install dependencies
pnpm install
# Run in development mode
pnpm run dev
# Build the project
pnpm run build
# Type checking
pnpm run typecheck
# Run tests
pnpm run test
# Run linting
pnpm run lint
This project includes comprehensive test coverage using Vitest. The test suite covers:
src/lib/icloud-mail-client.test.ts)src/types/config.test.ts)src/index.test.ts)# Run all tests once
pnpm run test:run
# Run tests in watch mode (interactive)
pnpm run test
# Run tests with UI interface
pnpm run test:ui
anyThe server uses the following default settings for iCloud Mail:
This project is licensed under the MIT License - see the LICENSE file for details.
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
MCP server integration for DaVinci Resolve Studio
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnos