Apple Mail

Messaging and emailAgent frameworks and SDKs

MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language.

Your AI app calls the Apple Mail MCP server, which does the messaging and email and agent frameworks and SDKs work and sends the result back to the chat.

About Apple Mail

Apple Mail is a community MCP server from patrickfreyer, filed in our directory under messaging and email and agent frameworks and sdks. MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language.

Apple Mail runs on your own machine: your AI app starts it with the command uvx mcp-apple-mail and talks to it over standard input and output.

At a glance

Publisher
patrickfreyer (community)
Runs
Locally on your machine
Install from
Python package on PyPI: mcp-apple-mail
Written in
Python
License
MIT
GitHub stars
275

How to set up Apple Mail

  1. Install uv on the machine that runs your AI app, because Apple Mail starts with uvx and fetches its Python package on first run.
  2. Check the Apple Mail README for keys or settings; the registry lists none that Apple Mail requires.
  3. Add Apple Mail to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Apple Mail tools to confirm the connection.
  5. Run one read-only task with Apple Mail first, and keep your app asking before each tool call until the results look right.

Apple Mail compared with similar servers

  • SMS by markuman has fewer GitHub stars than Apple Mail (270 against 275); both are community servers, and SMS runs as a remote server and Apple Mail runs on your own machine.
  • Zenvia by codespar has more GitHub stars than Apple Mail (278 against 275); both are community servers, and both run locally.
  • Agent Call by XiyaoWang0519 has fewer GitHub stars than Apple Mail (269 against 275); both are community servers, and both run locally.

Before you connect Apple Mail

  • Give Apple Mail its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Apple Mail tool call until you trust what it does with them.
  • Treat text that Apple Mail fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Apple Mail on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Apple Mail

How marketing and sales teams put Apple Mail to work, by company size. Pick the size closest to yours and start Apple Mail on one use case.

Small business

  • A small team can have Apple Mail summarize the inbox or channel each morning, so nothing from a customer waits until the afternoon.
  • Owners can draft replies and follow-ups with Apple Mail and send them only after a read, keeping the personal tone customers expect.
  • A small business with a developer can use Apple Mail to build one focused agent, such as lead follow-up, without a big platform.
  • Apple Mail runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can use Apple Mail to turn long launch threads into decisions, owners and dates that land in the project tracker.
  • Sales and success teams can connect Apple Mail so an agent drafts follow-ups after every customer call, ready to edit and send.
  • Growth engineering teams can use Apple Mail to build agents that combine CRM, analytics and content tools behind one workflow.
  • Start Apple Mail on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can deploy Apple Mail with retention and data loss rules intact, so agents summarize conversations without moving data outside policy.
  • Internal comms teams can use Apple Mail to find what employees ask most across channels and answer it once, in the right place.
  • Enterprises can build on Apple Mail with their own identity, policy and evaluation layers, so agents meet the same bar as other software.
  • Apple Mail is a community server, so have security review the code and pin a version before Apple Mail touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Apple Mail README

From patrickfreyer/apple-mail-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

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.

Quick Install

Prerequisites: macOS with Apple Mail configured, Python 3.10+, and uv (the plugin and uvx installs launch the server with uvx)

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-mcp

Then restart Claude Code.

Codex (CLI, Desktop, and IDE Extension)

With uv installed (uvx available on your PATH), register the local STDIO server:

codex mcp add apple-mail -- uvx mcp-apple-mail
codex mcp list

Alternatively, add this table to ~/.codex/config.toml instead of using the CLI:

[mcp_servers.apple-mail]
command = "uvx"
args = ["mcp-apple-mail"]

The CLI, desktop app, and IDE extension share this configuration. Restart your client or start a new CLI session after adding the server. In the CLI, use /mcp to check the connection, then ask it to list your Apple Mail accounts.

If the desktop app cannot find uvx, run command -v uvx in your terminal and use that absolute path as the TOML command value. Grant the macOS Automation permission to control Mail when prompted; see Troubleshooting.

This registers the MCP server. To install the optional Email Management Expert skill too, use the npx skills method below. See the official Codex MCP documentation for more configuration options.

Other Install Methods
uvx (zero install, MCP server only)
claude mcp add apple-mail -- uvx mcp-apple-mail

Or for Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "apple-mail": {
      "command": "uvx",
      "args": ["mcp-apple-mail"]
    }
  }
}
pip install (MCP server only)
pip install mcp-apple-mail
claude mcp add apple-mail -- mcp-apple-mail
npx skills (skill only, for Claude Code, Codex, Cursor and other agents)

Installs the Email Management Expert skill via the open skills CLI. The skill does not include the MCP server, so install that too (e.g. with uvx above):

npx skills add patrickfreyer/apple-mail-mcp
claude mcp add apple-mail -- uvx mcp-apple-mail

Add -g to install the skill globally, or -a <agent> to target a specific agent.

Claude Desktop MCPB
  1. Download the latest apple-mail-mcp-vX.Y.Z.mcpb from Releases
  2. Open Claude Desktop → Settings → Developer → MCP Servers → Install from file
  3. Select the .mcpb file and grant Mail.app permissions
Manual setup
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.sh

Tools (28)

Reading & Search
Tool Description
get_inbox_overview Dashboard with unread counts, folders, and recent emails
list_inbox_emails List emails with account/read-status filtering and optional content preview
get_mailbox_unread_counts Unread counts per mailbox or per-account summary
list_accounts List all configured Mail accounts
list_account_addresses Email addresses configured for each account
search_emails Unified search, subject, sender, body text, dates, attachments, flag status/color, cross-account
read_email Read one message by numeric id, headers, capped plain-text body and attachment metadata (text or JSON)
get_email_thread Conversation thread view
get_email_source Raw RFC 822 source of one message (headers, MIME parts)
Organization
Tool Description
list_mailboxes Folder hierarchy with message counts
create_mailbox Create new mailboxes (supports nested paths)
move_email Move/archive emails with filters (subject, sender, date, read status, dry-run)
update_email_status Mark read/unread, flag/unflag (optional flag color), by filters or message IDs
manage_trash Soft delete, permanent delete, empty trash (with dry-run)
synchronize_account Ask Mail.app to check the server for new mail now
Composition
Tool Description
compose_email Send new emails (plain text or HTML body)
reply_to_email Reply or reply-all with optional HTML body
forward_email Forward with optional message, CC/BCC; mode="draft" saves it without a window, keeping the original attachments
manage_drafts Create, list, open, send, and delete drafts, by subject or draft id
create_rich_email_draft Export an unsent HTML .eml preview; Mail opens it in a read-only viewer. Use compose_email(mode="draft") for a sendable draft
Attachments
Tool Description
list_email_attachments List attachments with names and sizes
save_email_attachment Save attachments to disk
Smart Inbox
Tool Description
get_awaiting_reply Find sent emails that haven't received a reply
get_needs_response Identify emails that likely need your response
get_top_senders Analyse most frequent senders by count or domain
Analytics & Export
Tool Description
get_statistics Email analytics (volume, top senders, read ratios)
export_emails Export single emails or mailboxes to TXT/HTML
inbox_dashboard Interactive UI dashboard (requires mcp-ui-server)

Configuration

Read-Only Mode

Pass --read-only to block delivery. Nothing leaves the machine: compose_email, reply_to_email and forward_email refuse mode="send", and manage_drafts refuses action="send".

The composing tools stay registered so that mode="draft" and mode="open" keep working. Those never deliver anything, and they are the only place in the compose surface that supports attachments, manage_drafts and create_rich_email_draft cannot attach files.

{
  "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
update_email_status 10 emails
manage_trash 5 emails
move_email 1 email

Override via function parameters when needed.

File Access

By default the server can write and attach files anywhere your user account can, except a hardened denylist of locations an attacker could use for code execution or credential theft. (Attachment bytes come from whoever emailed you, and a prompt-injected email can steer tool arguments.)

Writes (save_email_attachment, export_emails, create_rich_email_draft's output_path) are refused for:

  • any dotfile or dot-folder directly in your home folder: shell startup files (~/.zshrc, ~/.zshenv, ~/.zprofile, ~/.zlogin, ~/.bashrc, ~/.bash_profile, ~/.profile), ~/.ssh, ~/.gnupg, ~/.aws, ~/.config (incl. ~/.config/git), ~/.gitconfig, ~/.netrc, ~/.envrc, ~/.local/bin, ...
  • .git/hooks, .git/config and .envrc in any folder
  • autostart, persistence and app-config folders: ~/Library/LaunchAgents, ~/Library/LaunchDaemons, /Library/LaunchAgents, /Library/LaunchDaemons, ~/Library/Application Support (incl. com.apple.backgroundtaskmanagementagent), ~/Library/Application Scripts, ~/Library/Preferences, ~/Library/Keychains, ~/Library/Mail, ~/Library/Containers, ...
  • folders on PATH: ~/bin, /usr/local/bin, /opt/homebrew/bin, and /etc

Attachments (compose_email, reply_to_email, ...) may be any readable file except secrets: ~/.ssh, ~/.gnupg, ~/.aws, ~/.netrc, ~/.git-credentials, ~/.config/gh, .env files, ~/Library/Keychains, and browser profiles and cookie stores (Safari, Chrome, Firefox, Edge, Brave, Arc, ...).

Paths are resolved (~, .., symlinks) before checking, and matching is case-insensitive like APFS.

Restricting further (opt-in). To confine writes or attachments to specific folders, list them (colon-separated) in the server's env, or pass --write-dir / --attach-dir (repeatable) as arguments. Once set, only those folders are allowed for that side, and the denylist still applies inside them. The tool's own cache (~/Library/Caches/apple-mail-mcp, the default rich-draft location) stays writable.

"env": {
  "APPLE_MAIL_MCP_WRITE_DIRS": "~/Downloads:~/Documents/mail-exports",
  "APPLE_MAIL_MCP_ATTACH_DIRS": "~/Documents:~/Desktop"
}

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 Mail
Rich HTML Drafts

Use create_rich_email_draft when you need a visually formatted email, newsletter, or leadership update.

  • It generates an unsent .eml file with multipart plain-text + HTML bodies
  • It 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, add it with npx skills add patrickfreyer/apple-mail-mcp or copy it manually:

cp -r plugin/skills/email-management ~/.claude/skills/email-management

Requirements

  • macOS with Apple Mail configured
  • Python 3.10+ and uv for the plugin / uvx installs
  • fastmcp (+ optional mcp-ui-server for 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 include_content: false and lower max_results
Mailbox not found Use exact folder names; nested folders use / separator (e.g., Projects/Alpha)
Permission errors Grant access in System Settings > Privacy & Security > Automation
Rich draft shows raw HTML Use create_rich_email_draft instead of pasting HTML into manage_drafts or AppleScript content

Project Structure

apple-mail-mcp/
├── .claude-plugin/
│   └── marketplace.json       # Marketplace manifest (for plugin distribution)
├── plugin/                    # Claude Code plugin
│   ├── .claude-plugin/
│   │   └── plugin.json        # Plugin manifest
│   ├── skills/                # Email Management Expert skill (also invocable as /email-management)
│   ├── apple_mail_mcp/        # Python MCP server package (28 tools)
│   ├── apple_mail_mcp.py      # Entry point
│   ├── start_mcp.sh           # Startup wrapper for the .mcpb bundle and local clones (auto-creates venv)
│   └── requirements.txt
├── apple-mail-mcpb/           # MCPB build files (Claude Desktop)
├── LICENSE
└── README.md

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit and push
  4. Open a Pull Request

Releasing

Follow these steps when cutting a new release to keep all version strings in sync:

  1. Bump __version__ in plugin/apple_mail_mcp/__init__.py to the new version.
  2. Update apple-mail-mcpb/manifest.json ("version" field) to match.
  3. Update pyproject.toml (version = ... under [project]) to match.
  4. Update both version fields in server.json ("version" and "packages"[0]["version"]) to match.
  5. Run python3 scripts/check_versions.py, it must print OK before you proceed.
  6. Commit, tag, and push: git tag vX.Y.Z && git push origin vX.Y.Z.
  7. Create a GitHub release from the tag.
  8. 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.

Privacy Policy

The server runs entirely on your Mac, makes no network requests of its own and collects nothing. It reads Mail.app data only when a tool asks, returns it to your MCP client, and sends email only when you ask a sending tool to. Installing through the plugin downloads the pinned mcp-apple-mail package from PyPI with uvx. Full policy: PRIVACY.md.

License

MIT -- see LICENSE.

Links

Questions about Apple Mail

What is the Apple Mail MCP server?

MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language. Apple Mail is maintained by patrickfreyer on GitHub at patrickfreyer/apple-mail-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Apple Mail MCP server?

Add Apple Mail to your AI app's MCP config with the command uvx mcp-apple-mail. In Claude Code, run claude mcp add --transport stdio apple-mail -- uvx mcp-apple-mail. To run Apple Mail this way you need uv installed.

Does Apple Mail need an API key?

The registry lists no required keys for Apple Mail. Check the Apple Mail README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Apple Mail an official MCP server?

No. Apple Mail is a community server maintained by patrickfreyer. Community servers can be excellent; read the code and the open issues before you give Apple Mail access to company data.

What license is Apple Mail under?

Apple Mail is released under the MIT license, according to its GitHub repository. The license covers the code of Apple Mail; the service it connects to has its own terms.