Apple Mail MCP Server
This server gives AI assistants full programmatic access to Apple Mail, enabling reading, searching, composing, organizing, and analyzing emails via natural language on macOS.
Reading & Search
Inbox overview – Dashboard with unread counts, folders, and recent emails
List inbox emails – List emails with account/read-status filtering and optional content preview
Unread counts – Per-mailbox or per-account unread totals
List accounts – See all configured Mail accounts and their email addresses
Search emails – Unified search by subject, sender, body text, date range, attachments, and read status across one or all accounts
Get email thread – View a full conversation thread by subject keyword
Organization
List mailboxes – View folder hierarchy with message counts
Create mailbox – Create new folders (including nested paths)
Move emails – Move or archive emails with filters (subject, sender, date, read status) and dry-run preview
Update email status – Mark emails as read/unread or flag/unflag by filters or message IDs
Manage trash – Soft delete, permanently delete, or empty trash (with dry-run safety)
Synchronize account – Force an immediate IMAP sync to push changes to servers
Composition
Compose email – Send new emails (plain text or HTML) with CC/BCC/attachments
Reply to email – Reply or reply-all with optional HTML formatting
Forward email – Forward emails with an optional added message and CC/BCC
Manage drafts – Create, list, open, send, or delete drafts
Create rich HTML draft – Build a rich HTML
.emldraft, open it in Mail, and optionally save to Drafts
Attachments
List attachments – See attachment names and sizes for matching emails
Save attachments – Save specific attachments to disk
Smart Inbox
Awaiting reply – Find sent emails that haven't received a reply yet (follow-up tracking)
Needs response – Identify emails that likely require your response, ranked by priority
Top senders – Analyze most frequent senders by individual or domain
Analytics & Export
Statistics – Email analytics including volume, top senders, and read ratios
Export emails – Export single emails or entire mailboxes to TXT or HTML files
Inbox dashboard – Interactive UI dashboard (requires mcp-ui-server)
Provides comprehensive integration with Apple Mail, enabling AI assistants to read, search, organize, compose, and manage emails directly through natural language commands. Supports advanced email operations including threading, attachment handling, folder management, and email analytics.
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., "@Apple Mail MCP Serverfind emails from John about the Alpha project"
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.
Apple Mail MCP Server
Star History
An MCP server that gives AI assistants full access to Apple Mail -- read, search, compose, organize, and analyze emails via natural language. Built with FastMCP.
Related MCP server: IMAP Email MCP Server
Quick Install
Prerequisites: macOS with Apple Mail configured, Python 3.10+
Claude Code Plugin (Recommended)
Two commands — gets you the MCP server, /email-management slash command, and the Email Management Expert skill:
claude plugin marketplace add patrickfreyer/apple-mail-mcp
claude plugin install apple-mail@apple-mail-mcpThen restart Claude Code.
Other Install Methods
claude mcp add apple-mail -- uvx mcp-apple-mailOr for Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"apple-mail": {
"command": "uvx",
"args": ["mcp-apple-mail"]
}
}
}pip install mcp-apple-mail
claude mcp add apple-mail -- mcp-apple-mailDownload
apple-mail-mcp-v2.2.0.mcpbfrom ReleasesOpen Claude Desktop → Settings → Developer → MCP Servers → Install from file
Select the
.mcpbfile and grant Mail.app permissions
git clone https://github.com/patrickfreyer/apple-mail-mcp.git
cd apple-mail-mcp/plugin
python3 -m venv venv
venv/bin/pip install -r requirements.txt
claude mcp add apple-mail -- /bin/bash $(pwd)/start_mcp.shTools (22)
Reading & Search
Tool | Description |
| Dashboard with unread counts, folders, and recent emails |
| List emails with account/read-status filtering and optional content preview |
| Unread counts per mailbox or per-account summary |
| List all configured Mail accounts |
| Unified search — subject, sender, body text, dates, attachments, cross-account |
| Conversation thread view |
Organization
Tool | Description |
| Folder hierarchy with message counts |
| Create new mailboxes (supports nested paths) |
| Move/archive emails with filters (subject, sender, date, read status, dry-run) |
| Mark read/unread, flag/unflag — by filters or message IDs |
| Soft delete, permanent delete, empty trash (with dry-run) |
Composition
Tool | Description |
| Send new emails (plain text or HTML body) |
| Reply or reply-all with optional HTML body |
| Forward with optional message, CC/BCC |
| Create, list, send, and delete drafts |
| Build a rich HTML |
Attachments
Tool | Description |
| List attachments with names and sizes |
| Save attachments to disk |
Smart Inbox
Tool | Description |
| Find sent emails that haven't received a reply |
| Identify emails that likely need your response |
| Analyse most frequent senders by count or domain |
Analytics & Export
Tool | Description |
| Email analytics (volume, top senders, read ratios) |
| Export single emails or mailboxes to TXT/HTML |
| Interactive UI dashboard (requires mcp-ui-server) |
Configuration
Read-Only Mode
Pass --read-only to disable tools that send email (compose_email, reply_to_email, forward_email). Draft management remains available (list, create, delete) but sending a draft via manage_drafts is blocked.
{
"mcpServers": {
"apple-mail": {
"command": "/path/to/venv/bin/python3",
"args": ["/path/to/apple_mail_mcp.py", "--read-only"]
}
}
}User Preferences (Optional)
Set the USER_EMAIL_PREFERENCES environment variable to give the assistant context about your workflow:
{
"mcpServers": {
"apple-mail": {
"command": "/path/to/venv/bin/python3",
"args": ["/path/to/apple_mail_mcp.py"],
"env": {
"USER_EMAIL_PREFERENCES": "Default to BCG account, show max 50 emails, prefer Archive and Projects folders"
}
}
}
}For .mcpb installs, configure this in Claude Desktop under Developer > MCP Servers > Apple Mail MCP.
Safety Limits
Batch operations have conservative defaults to prevent accidental bulk actions:
Operation | Default Limit |
| 10 emails |
| 5 emails |
| 1 email |
Override via function parameters when needed.
Usage Examples
Show me an overview of my inbox
Search for emails about "project update" in my Gmail
Reply to the email about "Domain name" with "Thanks for the update!"
Move emails with "invoice" in the subject to my Archive folder
Show me email statistics for the last 30 days
Create a rich HTML draft for a weekly update and open it in MailRich HTML Drafts
Use create_rich_email_draft when you need a visually formatted email, newsletter, or leadership update.
It generates an unsent
.emlfile with multipart plain-text + HTML bodiesIt can open the draft directly in Mail for editing
It can optionally ask Mail to save the opened compose window into Drafts
It accepts partial details, so you can start with just an account and subject and fill in the rest later
This is more reliable than injecting raw HTML into AppleScript content, which Mail often stores as literal markup.
Email Management Skill
A companion Claude Code Skill is included that teaches Claude expert email workflows (Inbox Zero, daily triage, folder organization). When installed as a plugin, the skill is loaded automatically. For standalone MCP installs, copy it manually:
cp -r plugin/skills/email-management ~/.claude/skills/email-managementRequirements
macOS with Apple Mail configured
Python 3.7+
fastmcp(+ optionalmcp-ui-serverfor dashboard)Claude Desktop or any MCP-compatible client
Mail.app permissions: Automation + Mail Data Access (grant in System Settings > Privacy & Security > Automation)
Troubleshooting
Issue | Fix |
Mail.app not responding | Ensure Mail.app is running; check Automation permissions in System Settings |
Slow searches | Set |
Mailbox not found | Use exact folder names; nested folders use |
Permission errors | Grant access in System Settings > Privacy & Security > Automation |
Rich draft shows raw HTML | Use |
Project Structure
apple-mail-mcp/
├── .claude-plugin/
│ └── marketplace.json # Marketplace manifest (for plugin distribution)
├── plugin/ # Claude Code plugin
│ ├── .claude-plugin/
│ │ └── plugin.json # Plugin manifest
│ ├── commands/ # /email-management slash command
│ ├── skills/ # Email Management Expert skill
│ ├── apple_mail_mcp/ # Python MCP server package (24 tools)
│ ├── apple_mail_mcp.py # Entry point
│ ├── start_mcp.sh # Startup wrapper (auto-creates venv)
│ └── requirements.txt
├── apple-mail-mcpb/ # MCPB build files (Claude Desktop)
├── LICENSE
└── README.mdContributing
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Commit and push
Open a Pull Request
Releasing
Follow these steps when cutting a new release to keep all version strings in sync:
Bump
__version__inplugin/apple_mail_mcp/__init__.pyto the new version.Update
apple-mail-mcpb/manifest.json("version"field) to match.Update
pyproject.toml(version = ...under[project]) to match.Update both version fields in
server.json("version"and"packages"[0]["version"]) to match.Run
python3 scripts/check_versions.py— it must print OK before you proceed.Commit, tag, and push:
git tag vX.Y.Z && git push origin vX.Y.Z.Create a GitHub release from the tag.
Build and publish to PyPI:
python -m build && twine upload dist/*(requires PyPI credentials).
The test suite also enforces version consistency (
tests/test_version_consistency.py), so any CI run on a branch with mismatched versions will fail fast.
License
MIT -- see LICENSE.
Links
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/patrickfreyer/apple-mail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server