# Apple Mail MCP [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/jayvee6/apple-mail-mcp  
**GitHub Stars:** 2  
**npm Downloads (last month):** 516  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/apple-mail-mcp

## Description
LLM access to Apple Mail and iCloud via AppleScript. Read, search, compose, reply, flag and delete.

## Tools
Capabilities this server exposes over MCP:

- **list_folders** — List all mail accounts and their folders/mailboxes. Returns a tree of account → [mailbox names]. Use this to discover exact mailbox names before calling list_emails or search_emails.
- **list_emails** — List emails in a specific mailbox with pagination. Returns message summaries including a message_ref that can be passed to get_email, reply_email, move_email, etc. Messages are returned newest-first (index 1 = most recent).
- **get_email** — Read the full content of a specific email including headers and body. The message_ref comes from list_emails or search_emails results.
- **search_emails** — Search for emails matching criteria across one or all mailboxes. Returns message summaries with message_ref fields for use with other tools. At least one filter (from_filter, subject_filter, after_date, before_date) should be provided.
- **compose_email** — Compose a new email. If send is false (default), opens the compose window with a draft. If send is true, sends immediately without confirmation.
- **reply_email** — Reply to an existing email. If send is false (default), opens the reply in a compose window. If send is true, sends immediately without confirmation.
- **move_email** — Move an email to a different mailbox. Use list_folders to see available mailbox names.
- **archive_email** — Move an email to the Archive mailbox of its account. Uses 'Archive' for iCloud, 'All Mail' for Gmail.
- **flag_email** — Set or clear the flag on an email.
- **mark_read** — Mark an email as read or unread.
- **move_to_junk** — Move an email to the Junk/Spam mailbox of its account. Uses 'Junk' for iCloud, 'Spam' for Gmail.
- **delete_email** — Move an email to the Trash (Deleted Messages for iCloud, Trash for Gmail).
- **create_folder** — Create a new top-level mailbox/folder inside an account. Idempotent — reports success if the folder already exists. Pair with move_matching to file mail by rule.
- **move_matching** — Bulk-move every email in a source mailbox that matches the given criteria into a destination mailbox, in one pass. Each call matches a single from/subject substring; to file a sender that spans several unrelated addresses, issue one call per address into the same folder. At least one filter (from_filter, subject_filter, after_date, before_date) is required — this guards against accidentally moving an entire mailbox. The destination must already exist (call create_folder first if needed). Omit limit to move ALL matches (fast native bulk move); set limit to cap the count (slower, per-message). Returns the number of messages moved. On very large mailboxes this can take a few minutes.
- **get_pending_events** — Return and clear all real-time incoming mail events pushed by the MailKit extension. Returns an empty array if the extension is not installed or no new mail has arrived since the last call. Each event includes: subject, from, date, messageId, preview, receivedAt.
- **summarize_email** — Summarize an email in 2-3 sentences using the configured local AI model (LM Studio / Gemma, or OpenAI-compat). Returns a concise plain-text summary of the message content and any required actions.
- **classify_email** — Classify an email by category and priority using the configured local AI model. Returns JSON with: category (string), priority (high/medium/low), action_required (boolean), tags (string[]).
- **draft_reply** — Draft a reply to an email using the configured local AI model. Returns plain text body ready to pass to reply_email. Does not send — use reply_email to review and send.
- **triage_inbox** — Classify and summarize multiple emails from a mailbox in one call using the configured local AI model. Returns a JSON array sorted by priority. Useful for getting a quick overview of a busy inbox.
- **create_rule** — Create a native Apple Mail rule that files incoming mail from given sender domains into a folder. This is a REAL Mail rule: Mail applies it to new incoming mail automatically while Mail is running — no background process. Multiple domains are OR-combined into one rule. Native rules do not touch existing mail; set apply_to_existing=true to also sort what is already in the mailbox now. Idempotent: an existing rule with the same name is replaced. The destination folder must already exist (use create_folder).
- **list_rules** — List all Apple Mail rules: name, enabled state, move-target folder, and the sender domains each matches. Shows every rule in Mail, including ones created outside this tool.
- **delete_rule** — Delete an Apple Mail rule by name. Use list_rules to see rule names. Removes the rule only; it does not move any mail back.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "apple-mail-mcp": {
    "command": "npx",
    "args": ["-y","@jdot6/apple-mail-mcp"]
  }
}
```

## Documentation

## What Apple Mail MCP does

Apple Mail MCP exposes Apple Mail operations as MCP tools for an AI client. It can enumerate accounts and mailboxes, list messages with pagination, read complete headers and bodies, and search by sender, subject, or date range. Messages can be moved, archived, flagged, marked read or unread, sent to junk, or moved to the trash. Mailboxes and native Mail rules can also be created, listed, and removed, and matching messages can be moved in bulk.

Email creation supports both reviewable drafts and immediate sending. Replies work the same way: the tool can open a reply in Mail or send it directly. The repository also includes optional local-AI operations for summarizing messages, classifying them, drafting replies, and triaging up to 20 messages by priority.

## How it works

The MCP process runs under Node.js and communicates with the client over standard input and output. For mail operations, it invokes AppleScript files through `osascript`, which controls the Apple Mail application on the Mac. Apple Mail must be open and have at least one configured account.

Message operations use a composite `message_ref` rather than relying on a changing list position. The reference combines the account, mailbox, and RFC 2822 Message-ID. `list_emails` and `search_emails` return these references for later calls to tools such as `get_email`, `reply_email`, and `move_email`.

An optional MailKit extension can send new-message notifications to a local HTTP listener on `127.0.0.1:27182`. The `get_pending_events` tool drains those queued events. The listener starts even without the extension, but then returns no extension-generated events.

## Setup and configuration

The supported environment is macOS with Apple Mail configured, plus Node.js 18 or newer. The simplest installation adds `npx -y @jdot6/apple-mail-mcp` to Claude Desktop's MCP configuration. A repository checkout can instead be installed with `npm install`, built with `npm run build`, and launched using the resulting `dist/index.js` file. Claude Desktop must be restarted after changing its configuration.

macOS requests Automation permission the first time the Node.js process controls Mail. Allow the request, or re-enable the terminal or Node.js runtime under System Settings → Privacy & Security → Automation if access was denied.

Optional AI behavior is configured with `APPLE_MAIL_AI_PROVIDER`, `APPLE_MAIL_AI_ENDPOINT`, `APPLE_MAIL_AI_MODEL`, `APPLE_MAIL_AI_API_KEY`, `APPLE_MAIL_AI_ENRICH_EVENTS`, and `APPLE_MAIL_AI_ALLOW_REMOTE`. The default provider is LM Studio at `http://localhost:1234`; any OpenAI-compatible server can be used. Remote endpoints are blocked unless `APPLE_MAIL_AI_ALLOW_REMOTE=1` is set, and sending email content to such an endpoint exposes that content to the remote service.

The MailKit extension is built from the included Xcode project, launched once to register it, and enabled under Mail → Settings → Extensions.

## Tools and capabilities

- Discover accounts and mailbox names with `list_folders`.
- Browse, search, and read messages with `list_emails`, `search_emails`, and `get_email`.
- Draft or send new messages and replies with `compose_email` and `reply_email`.
- Move, archive, flag, mark, junk, or delete messages.
- Create, inspect, and remove Mail rules with `create_rule`, `list_rules`, and `delete_rule`.
- Bulk-move filtered messages with `move_matching`.
- Process new-mail notifications with `get_pending_events`.
- Summarize, classify, draft, and triage messages using the optional local-AI tools.

## Limitations and notes

The server depends on macOS, Apple Mail, AppleScript automation permissions, and a configured Mail account. Immediate sending is available when a tool's `send` option is enabled and does not add a confirmation step. The companion Email Compose Review skill uses a separate review workflow for LLM-drafted messages and keeps final sending in Mail.

The local HTTP bridge binds only to loopback. AI features can remain local with LM Studio, but configuring a remote OpenAI-compatible endpoint sends full email content there after remote access is explicitly enabled.

_Full upstream README: https://allmcps.com/mcp/apple-mail-mcp/readme_

