# mail-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/p-l-ta/mail-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 301  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mail-mcp

## Description
Search, read, send, and manage email via macOS Mail.app across all configured accounts.

## Tools
Capabilities this server exposes over MCP:

- **search_emails** — Search Mail.app messages via the Envelope Index database. Returns rich metadata including RFC message-id (usable with read_email, reply_to_email, set_message_flags).
- **read_email** — Read full body of a message by its RFC message-id. Uses Mail.app via AppleScript so it works for IMAP/iCloud/Exchange messages without filesystem access.
- **list_accounts_and_mailboxes** — List all configured Mail.app accounts and their mailboxes with unread counts.
- **list_recent** — List recent messages in a mailbox of a specific account.
- **send_email** — Send a new email via Mail.app from an existing account.
- **reply_to_email** — Reply to an existing message identified by RFC message-id.
- **set_message_flags** — Set read and/or flagged status on a message identified by RFC message-id.
- **move_email** — Move a message to a different mailbox by RFC message-id. Use list_accounts_and_mailboxes to get exact mailbox names.
- **trash_email** — Move a message to Deleted Messages (trash) by RFC message-id. Does not permanently delete.
- **create_mailbox** — Create a new mailbox (folder) in a Mail.app account.
- **bulk_mark_read** — Mark multiple messages as read in one call — by mailbox, sender substring, or both. Far faster than calling set_message_flags per message.
- **bulk_apply** — Apply one action (mark_read, mark_unread, flag, unflag, trash, or move) to a list of messages by RFC message-id, in a single batched call — far faster than calling set_message_flags/trash_email/move_email once per message.
- **bulk_flag** — Flag or unflag multiple messages in one call — by mailbox, sender substring, or both. Queries the Envelope Index for matching IDs then updates in a single batched AppleScript call.
- **bulk_trash** — Move multiple messages to trash in one call — by mailbox, sender substring, or both. Queries the Envelope Index for matching IDs then trashes in a single batched AppleScript call.
- **bulk_move** — Move multiple messages to a destination mailbox in one call — by mailbox, sender substring, or both. Queries the Envelope Index for matching IDs then moves in a single batched AppleScript call.
- **get_unsubscribe_link** — Extract unsubscribe URLs from a message — checks the List-Unsubscribe header first (reliable), then scans the plain-text body as a fallback.
- **list_senders** — Return a grouped count of senders across mailboxes — who sends how many messages, how many are unread, and when the last arrived. By default excludes Deleted Messages, Junk, Sent, and Drafts so counts reflect live mail only. Ideal for identifying bulk senders and noise.
- **empty_mailbox** — Delete every message in a mailbox at once — moves to Deleted Messages, or permanently removes if the mailbox is already Deleted Messages/Trash. Use for Junk, Trash, or bulk-cleanup folders.
- **list_rules** — List all Mail.app rules with their conditions and actions. Reads directly from SyncedRules.plist.
- **create_rule** — Create a new Mail.app rule. A timestamped backup of SyncedRules.plist is made before writing. Mail.app may need to be restarted for the rule to take effect.
- **update_rule** — Update an existing Mail.app rule by its RuleId (use list_rules to find IDs). A timestamped backup is made before writing. Mail.app may need to be restarted for changes to take effect.
- **delete_rule** — Permanently delete a Mail.app rule by its RuleId. A timestamped backup of SyncedRules.plist is made before writing so the deletion can be undone. Mail.app may need to be restarted for the change to take effect.
- **check_compatibility** — Probe each mail-mcp dependency (Envelope Index schema, SyncedRules.plist, AppleScript, MailData directory) and report pass/fail. Run this after a macOS update to verify nothing broke.
- **submit_feedback** — Open a pre-filled GitHub issue for mail-mcp (p-l-ta/mail-mcp) in the default browser. Automatically includes macOS version and mail-mcp version in the issue body.

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

```json
"mcpServers": {
  "mail-mcp": {
    "command": "npx",
    "args": ["-y","@p-l-ta/mail-mcp"]
  }
}
```

## Documentation

## What the mail-mcp MCP server does

The mail-mcp MCP server exposes macOS Mail.app through MCP so an agent can work with email across the accounts configured in Mail.app. Supported account types mentioned by the project include iCloud, Exchange, and IMAP accounts. The server can discover accounts and mailboxes, inspect unread totals, search messages, retrieve message content, and perform common mailbox and message operations.

Search results come from Mail.app's local Envelope Index SQLite database. This provides structured filtering across accounts without requiring the server to implement separate integrations for each mail provider. Message bodies and actions use Mail.app itself: AppleScript automation reads messages, sends new mail, replies, changes flags, moves messages, and sends messages to Deleted Messages.

The server runs locally on the Mac. It does not use its own backend, telemetry, or external API requests. Email data remains on the device and is returned to the MCP host only through normal tool responses.

## How it works

The mail-mcp MCP server uses two local access paths:

- Database queries search Mail.app's Envelope Index for messages and mailbox metadata.
- AppleScript controls Mail.app for operations that need the application, including sending, replying, reading bodies, flag changes, moves, and trashing.

This arrangement also supports accounts whose messages are not available as local files, because action requests are delegated to Mail.app. The server communicates with an MCP host over stdio.

## Setup and configuration

The host computer must run macOS with Mail.app configured, and Node.js 20 or newer is required. Claude Desktop users can install the released `.mcpb` package by downloading it and opening the file. For other stdio hosts, run the package with `npx @p-l-ta/mail-mcp`, or install it globally with npm and point the host at the `mail-mcp` executable.

The application launching the MCP server must have Full Disk Access and Automation permission for Mail. These permissions are granted in System Settings under Privacy & Security. Permission inheritance comes from the MCP host, so granting access to a different terminal or application may not be sufficient.

## Tools and capabilities

Available operations include:

- Search messages using rich filters and read a full message by RFC message ID.
- List configured accounts, mailboxes, unread counts, recent messages, and grouped sender totals.
- Send new messages and reply to existing messages by RFC message ID.
- Set read or flagged status, move messages, or move them to Deleted Messages.
- Create mailboxes and mark messages read in bulk by mailbox or sender.
- Extract unsubscribe URLs from message headers and bodies.
- Empty an entire mailbox, including folders such as Junk or Trash.

## Limitations and notes

This tool requires macOS Mail.app and cannot be used as a provider-neutral mail service on systems without Mail.app. Its operations depend on the permissions granted to the host application. The server itself does not connect to external mail APIs or servers, but it can access local Mail.app data and control Mail.app through AppleScript.

Destructive operations need particular care: `trash_email` moves a message to Deleted Messages, while `empty_mailbox` removes every message in a selected mailbox. The project identifies the latter as suitable for folders such as Junk and Trash, so an agent should request a precise mailbox before invoking it. Message-specific reading and replying use the RFC message ID rather than a provider-specific identifier.

The project is licensed under MIT.

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

