Apple Mail · Model Context Protocol server

Fast, safe Apple Mail for your AI agent.

A unified MCP server: millisecond on-disk search and complete AppleScript writes, bridged by a canonical Message-ID and gated by one honest safety layer.

31 MCP tools macOS · Apple Mail Python 3.10+ GPL-3.0-or-later
Why it's different

Both halves of Apple Mail automation, in one server.

Read-only servers are fast but can't act. Write servers can act but are slow and target messages by fuzzy subject. This is the union of both — plus the parts neither had.

Millisecond search

FTS5 over a local index built from the same on-disk data Mail uses — 9–20 ms across a real 210k-message mailbox. Optional semantic + hybrid.

Safety-gated writes

Every send/move/flag passes one guard(): read-only mode, batch caps, dry-run previews, and explicit confirm for destructive ops.

Honest undo

Move, trash, flag and status changes are journaled and reversible with undo_last. Sends and permanent deletes aren't — and it says so.

Right message, always

Writes resolve the target by canonical RFC822 Message-ID and read it back to verify before mutating — never a fuzzy subject match that hits the wrong mail.

Never hangs

Every osascript call runs in its own process group with a hard timeout and is killed on expiry. Reads never depend on Mail.app being responsive.

31 tools + recipes

Search, threads, inbox triage, compose/reply/forward, drafts, mailboxes, flag colors, mail rules, RFC-8058 unsubscribe, contacts — as MCP tools and a CLI.

See it work

From "what needs a reply?" to a drafted answer.

A 60-second walkthrough: an agent searches the whole mailbox, surfaces what's awaiting a reply, and drafts a response into Mail — nothing sends without you.

How it works

Two paths, one identity bridge.

Reads never touch Mail.app; writes are the only correct way to make it act. A canonical Message-ID connects them so the agent acts on exactly the message it found.

Read path — fast, disk-direct

Never touches Mail.app

  • Envelope Index opened immutable=1 — no locks, no waits
  • .emlx files parsed from disk into a local FTS5 index
  • Keyword + optional semantic / hybrid search, JWZ threading, triage
  • Kept fresh by an incremental --watch updater
Write path — via guard()

AppleScript / JXA, gated

  • Send / reply / move / flag / trash through osascript
  • read-only mode · batch caps · dry-run · confirm
  • Reversible actions journaled for undo_last
  • Hard timeouts + process-group kill — it can't hang

bridged by a canonical RFC822 Message-ID, read-back verified before any mutation

Install

Running in about 30 seconds.

macOS with Apple Mail configured, Python 3.10+, and Full Disk Access. macOS ships curl — no wget needed.

one command — Claude Desktop
# installs the CLI, indexes, and registers
# with Claude Desktop — backs up your config
$ bash <(curl -fsSL \
    https://raw.githubusercontent.com/ErnestoCobos/\
cobos-apple-mail-mcp/main/scripts/install-claude-desktop.sh)

Prefer to review first? curl … -o install.sh, read it, then bash install.sh.

manual — any MCP client
$ uvx cobos-apple-mail-mcp serve   # zero-install
# or a persistent CLI:
$ pipx install cobos-apple-mail-mcp
$ apple-mail-mcp init
$ apple-mail-mcp index build
$ apple-mail-mcp search "budget review"

Claude Desktop · Claude Code · Codex · Kimi — per-client setup →