MCP Hub
Back to servers

che-apple-mail-mcp

Apple Mail MCP — 44 tools, SQLite millisecond search, .emlx parser, batch ops

Registry
Stars
4
Forks
1
Updated
Apr 1, 2026
Validated
Apr 2, 2026

che-apple-mail-mcp

License: MIT macOS Swift MCP

The most comprehensive Apple Mail MCP server - 44 tools with SQLite-powered millisecond search across 250K+ emails.

English | 繁體中文


Why che-apple-mail-mcp?

FeatureOther MCPsche-apple-mail-mcp
Total Tools~2044
LanguagePythonSwift (Native)
Search SpeedSeconds (AppleScript)Milliseconds (SQLite)
Search FieldsSubject/SenderSubject/Sender/Recipient/Date
Batch OperationsNoUp to 50 emails per call
Mailbox ManagementBasicFull CRUD
Email ColorsNo7 flag colors + background
VIP ManagementNoYes
Rule ManagementPartialFull CRUD
SignaturesNoYes
Raw Headers/SourceNoYes

Quick Start

# Clone and build
git clone https://github.com/kiki830621/che-apple-mail-mcp.git
cd che-apple-mail-mcp
swift build -c release

# Copy to ~/bin and add to Claude Code
# --scope user    : available across all projects (stored in ~/.claude.json)
# --transport stdio: local binary execution via stdin/stdout
# --              : separator between claude options and the command
mkdir -p ~/bin
cp .build/release/CheAppleMailMCP ~/bin/
claude mcp add --scope user --transport stdio che-apple-mail-mcp -- ~/bin/CheAppleMailMCP

💡 Tip: Always install the binary to a local directory like ~/bin/. Avoid placing it in cloud-synced folders (Dropbox, iCloud, OneDrive) as file sync operations can cause MCP connection timeouts.

Then grant Automation permission in System Settings > Privacy & Security > Automation.


All 42 Tools

Accounts (2)
ToolDescription
list_accountsList all mail accounts
get_account_infoGet account details
Mailboxes (4)
ToolDescription
list_mailboxesList all mailboxes (folders)
create_mailboxCreate a new mailbox
delete_mailboxDelete a mailbox
get_special_mailboxesGet special mailbox names (inbox, drafts, sent, trash, junk, outbox)
Emails (7)
ToolDescription
list_emailsList emails in a mailbox
get_emailGet full email content
search_emailsSearch by subject/content
get_unread_countGet unread count
get_email_headersGet all email headers
get_email_sourceGet raw email source
get_email_metadataGet metadata (forwarded, replied, size)
Actions (8)
ToolDescription
mark_readMark as read/unread
flag_emailFlag/unflag email
set_flag_colorSet flag color (7 colors)
set_background_colorSet email background color
mark_as_junkMark as junk/not junk
move_emailMove to another mailbox
copy_emailCopy to another mailbox
delete_emailDelete email (to trash)
Compose (5)
ToolDescription
compose_emailSend new email (supports attachments)
reply_emailReply to email
forward_emailForward email
redirect_emailRedirect email (keeps original sender)
open_mailtoOpen mailto URL
Drafts (2)
ToolDescription
list_draftsList draft emails
create_draftCreate a draft (supports attachments)
Attachments (2)
ToolDescription
list_attachmentsList email attachments
save_attachmentSave attachment to disk
VIP (1)
ToolDescription
list_vip_sendersList VIP senders
Rules (5)
ToolDescription
list_rulesList mail rules
get_rule_detailsGet rule details
create_ruleCreate a new rule
delete_ruleDelete a rule
enable_ruleEnable/disable a rule
Signatures (2)
ToolDescription
list_signaturesList email signatures
get_signatureGet signature content
SMTP (1)
ToolDescription
list_smtp_serversList SMTP servers
Sync (2)
ToolDescription
check_for_new_mailCheck for new mail
synchronize_accountSync IMAP account
Utilities (4)
ToolDescription
extract_name_from_addressExtract name from email address
extract_addressExtract email from full address
get_mail_app_infoGet Mail.app info
import_mailboxImport mailbox from file

Installation

Requirements

  • macOS 13.0+
  • Xcode Command Line Tools
  • Apple Mail with at least one account configured

Step 1: Build

git clone https://github.com/kiki830621/che-apple-mail-mcp.git
cd che-apple-mail-mcp
swift build -c release

Step 2: Configure

For Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "che-apple-mail-mcp": {
      "command": "/full/path/to/che-apple-mail-mcp/.build/release/CheAppleMailMCP"
    }
  }
}

For Claude Code (CLI)

# Copy to ~/bin and register (user scope = available in all projects)
mkdir -p ~/bin
cp .build/release/CheAppleMailMCP ~/bin/
claude mcp add --scope user --transport stdio che-apple-mail-mcp -- ~/bin/CheAppleMailMCP

Step 3: Grant Permissions

open "x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"
  1. Find CheAppleMailMCP and enable permission for Mail.app
  2. If using Claude Code, also add Terminal or iTerm

Step 4: Restart Claude

# For Claude Desktop
osascript -e 'quit app "Claude"' && sleep 2 && open -a "Claude"

# For Claude Code - start a new session
claude

Usage Examples

Natural Language (Claude Desktop)

"List all my mail accounts"
"Show unread emails in Gmail inbox"
"Search for emails about 'quarterly report'"
"Send an email to john@example.com about the meeting"
"Flag important emails in red"
"Create a rule to move newsletters to a folder"

Direct Tool Calls (Claude Code)

"Use list_accounts to show my accounts"
"Use search_emails to find emails containing 'invoice'"
"Use set_flag_color to mark email ID 12345 as blue"
"Use check_for_new_mail to refresh"

Flag & Background Colors

Flag Colors (set_flag_color)

IndexColor
0Red
1Orange
2Yellow
3Green
4Blue
5Purple
6Gray
-1Clear

Background Colors (set_background_color)

blue, gray, green, none, orange, purple, red, yellow


Troubleshooting

ProblemSolution
Server disconnectedRebuild with swift build -c release
Not allowed to send Apple eventsAdd permissions in System Settings > Automation
Mail.app not respondingEnsure Mail.app is running with configured accounts
Commands timing outLarge mailboxes take longer; try specific searches

Technical Details

  • Framework: MCP Swift SDK v0.10.0
  • Automation: AppleScript via NSAppleScript
  • Transport: stdio
  • Platform: macOS 13.0+ (Ventura and later)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


License

MIT License - see LICENSE for details.


Author

Created by Che Cheng (@kiki830621)

If you find this useful, please consider giving it a star!

Reviews

No reviews yet

Sign in to write a review