
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
apple-mail-mcp
Advanced tools
MCP server for Apple Mail - read, search, send, and manage emails via Claude
A Model Context Protocol (MCP) server that enables AI assistants like Claude to read, send, search, and manage emails in Apple Mail on macOS.
Note: This is the npm/Node.js package — install with
npxornpm. There is an unrelated Python project of the same name on PyPI (imdinu/apple-mail-mcp) installed viapipx/uvx. If you're usinguvxand seeing acycloptsdependency error, you're looking for that project, not this one.
This server acts as a bridge between AI assistants and Apple Mail. Once configured, you can ask Claude (or any MCP-compatible AI) to:
The AI assistant communicates with this server, which then uses AppleScript to interact with the Mail app on your Mac. All data stays local on your machine.
If you're using Claude Code (in Terminal or VS Code), just ask Claude to install it:
Install the sweetrb/apple-mail-mcp MCP server so you can help me manage my Apple Mail
Claude will handle the installation and configuration automatically.
Install as a Claude Code plugin for automatic configuration and enhanced AI behavior:
/plugin marketplace add sweetrb/apple-mail-mcp
/plugin install apple-mail
This method also installs a skill that teaches Claude when and how to use Apple Mail effectively.
1. Install the server:
npm install -g github:sweetrb/apple-mail-mcp
2. Add to Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"apple-mail": {
"command": "npx",
"args": ["apple-mail-mcp"]
}
}
}
3. Restart Claude Desktop and start using natural language:
"Show me my unread emails"
On first use, macOS will ask for permission to automate Mail.app. Click "OK" to allow.
| Feature | Description |
|---|---|
| List Messages | List messages with pagination, sender filter, date display |
| Search Messages | Search by sender, subject, content, date range, read/flagged status — across all accounts |
| Read Messages | Get full email content (plain text or HTML) |
| Send Email | Compose and send new emails (with optional file attachments) |
| Send Serial Email | Mail merge — send personalized emails to a list of recipients with {{placeholder}} support |
| Create Draft | Save emails to Drafts folder (with optional file attachments) |
| Reply | Reply to messages (with reply-all support) |
| Forward | Forward messages to new recipients |
| Mark Read/Unread | Change read status (single or batch) |
| Flag/Unflag | Flag or unflag messages (single or batch) |
| Delete Messages | Move messages to trash (single or batch) |
| Move Messages | Organize into mailboxes (single or batch) |
| List Attachments | View attachment metadata (name, type, size) |
| Save Attachment | Save attachments to disk |
| Feature | Description |
|---|---|
| List Mailboxes | Show all folders with message/unread counts |
| Create/Delete/Rename Mailbox | Full mailbox lifecycle management |
| List Accounts | Show configured accounts |
| Unread Count | Get unread counts per mailbox |
| Feature | Description |
|---|---|
| List Rules | View all mail rules and their enabled status |
| Enable/Disable Rules | Toggle mail rules on or off |
| Search Contacts | Look up contacts from Contacts.app by name |
| Email Templates | Save, list, use, and delete reusable email templates |
| Feature | Description |
|---|---|
| Health Check | Verify Mail.app connectivity |
| Statistics | Message and unread counts per account, recently received stats |
| Sync Status | Check if Mail.app is actively syncing |
This section documents all available tools. AI agents should use these tool names and parameters exactly as specified.
search-messagesSearch for messages matching criteria. Searches all accounts by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | No | Text to search in subject/sender |
from | string | No | Filter by sender email address |
subject | string | No | Filter by subject line |
mailbox | string | No | Mailbox to search in (omit to search all mailboxes) |
account | string | No | Account to search in (omit to search all accounts) |
isRead | boolean | No | Filter by read status |
isFlagged | boolean | No | Filter by flagged status |
dateFrom | string | No | Start date filter (e.g., "January 1, 2026") |
dateTo | string | No | End date filter (e.g., "March 1, 2026") |
limit | number | No | Max results (default: 50) |
get-messageGet the full content of a message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
preferHtml | boolean | No | Return HTML source instead of plain text |
Returns: Subject line and message body (plain text by default, HTML if preferHtml is true and HTML content is available).
list-messagesList messages in a mailbox.
| Parameter | Type | Required | Description |
|---|---|---|---|
mailbox | string | No | Mailbox name (omit to list from all mailboxes) |
account | string | No | Account name |
limit | number | No | Max messages (default: 50) |
offset | number | No | Number of messages to skip (for pagination) |
from | string | No | Filter by sender email address or name |
unreadOnly | boolean | No | Only show unread messages |
Returns: List of messages with ID, date, subject, and sender.
send-emailSend a new email immediately.
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string[] | Yes | Recipient addresses |
subject | string | Yes | Email subject |
body | string | Yes | Email body (plain text) |
cc | string[] | No | CC recipients |
bcc | string[] | No | BCC recipients |
account | string | No | Send from specific account |
attachments | string[] | No | Absolute file paths to attach, max 20 files (e.g., ["/Users/me/report.pdf"]) |
Example:
{
"to": ["colleague@company.com"],
"subject": "Meeting Tomorrow",
"body": "Hi, just confirming our meeting at 2pm tomorrow.",
"account": "Work",
"attachments": ["/Users/me/Documents/agenda.pdf"]
}
send-serial-emailSend individual personalized emails to a list of recipients (mail merge). Each recipient receives their own email — recipients don't see each other. Supports {{placeholder}} tokens in both subject and body.
| Parameter | Type | Required | Description |
|---|---|---|---|
recipients | object[] | Yes | List of recipients, max 100 (see below) |
subject | string | Yes | Email subject — use {{Key}} for placeholders |
body | string | Yes | Email body — use {{Key}} for placeholders |
account | string | No | Send from specific account |
delayMs | number | No | Delay between sends in ms (default: 500, max 10000) |
Each recipient object:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Recipient email address |
variables | object | Yes | Key-value pairs for placeholder replacement |
Example:
{
"recipients": [
{ "email": "alice@example.com", "variables": { "Name": "Alice", "Company": "Acme" } },
{ "email": "bob@example.com", "variables": { "Name": "Bob", "Company": "Globex" } }
],
"subject": "Hello {{Name}}!",
"body": "Dear {{Name}},\n\nGreat to connect about {{Company}}.\n\nBest regards"
}
Returns: Per-recipient success/failure results with a summary count.
create-draftSave an email to Drafts without sending.
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string[] | Yes | Recipient addresses |
subject | string | Yes | Email subject |
body | string | Yes | Email body (plain text) |
cc | string[] | No | CC recipients |
bcc | string[] | No | BCC recipients |
account | string | No | Account for draft |
attachments | string[] | No | Absolute file paths to attach, max 20 files |
Returns: Confirmation that draft was created.
reply-to-messageReply to an existing message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID to reply to |
body | string | Yes | Reply body |
replyAll | boolean | No | Reply to all recipients (default: false) |
send | boolean | No | Send immediately (default: true, false = save as draft) |
Example - Reply to sender only:
{
"id": "12345",
"body": "Thanks for the update!"
}
Example - Reply all, save as draft:
{
"id": "12345",
"body": "I'll review this and get back to everyone.",
"replyAll": true,
"send": false
}
forward-messageForward a message to new recipients.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID to forward |
to | string[] | Yes | Recipients to forward to |
body | string | No | Message to prepend |
send | boolean | No | Send immediately (default: true, false = save as draft) |
mark-as-read / mark-as-unreadChange read status of a message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
flag-message / unflag-messageFlag or unflag a message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
delete-messageDelete a message (move to trash).
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
move-messageMove a message to a different mailbox.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
mailbox | string | Yes | Destination mailbox |
account | string | No | Account containing mailbox |
list-attachmentsList attachments on a message.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
Returns: List of attachments with name, MIME type, and size.
save-attachmentSave a message attachment to disk.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Message ID |
attachmentName | string | Yes | Filename of the attachment |
savePath | string | Yes | Directory to save to |
All batch operations accept an array of message IDs (max 100 per batch) and return per-item success/failure results.
batch-delete-messages| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | Message IDs to delete (max 100) |
batch-move-messages| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | Message IDs to move (max 100) |
mailbox | string | Yes | Destination mailbox |
account | string | No | Account containing mailbox |
batch-mark-as-read / batch-mark-as-unread| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | Message IDs (max 100) |
batch-flag-messages / batch-unflag-messages| Parameter | Type | Required | Description |
|---|---|---|---|
ids | string[] | Yes | Message IDs (max 100) |
list-mailboxesList all mailboxes for an account.
| Parameter | Type | Required | Description |
|---|---|---|---|
account | string | No | Account to list from |
Returns: List of mailbox names with message and unread counts.
get-unread-countGet unread message count.
| Parameter | Type | Required | Description |
|---|---|---|---|
mailbox | string | No | Mailbox to check (omit for total) |
account | string | No | Account to check |
create-mailboxCreate a new mailbox.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Mailbox name |
account | string | No | Account to create in |
delete-mailboxDelete a mailbox.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Mailbox name |
account | string | No | Account containing mailbox |
rename-mailboxRename a mailbox (creates new, moves messages, deletes old).
| Parameter | Type | Required | Description |
|---|---|---|---|
oldName | string | Yes | Current mailbox name |
newName | string | Yes | New mailbox name |
account | string | No | Account containing mailbox |
list-accountsList all configured Mail accounts.
Parameters: None
Returns: List of account names and email addresses.
list-rulesList all mail rules.
Parameters: None
Returns: List of rule names and enabled status.
enable-rule / disable-ruleEnable or disable a mail rule.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Rule name |
search-contactsSearch contacts in Contacts.app.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Name to search for |
limit | number | No | Max results (default: 10) |
Returns: List of contacts with name, email addresses, and phone numbers.
Email templates are stored in memory for the duration of the server session.
save-templateSave or update an email template.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name |
subject | string | Yes | Default subject line |
body | string | Yes | Template body |
to | string[] | No | Default recipients |
cc | string[] | No | Default CC recipients |
id | string | No | Template ID (for updating) |
list-templatesList all saved templates.
Parameters: None
get-templateGet a template by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Template ID |
delete-templateDelete a template.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Template ID |
use-templateCreate a draft from a template, with optional overrides.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Template ID |
to | string[] | No | Override recipients |
cc | string[] | No | Override CC |
subject | string | No | Override subject |
body | string | No | Override body |
health-checkVerify Mail.app connectivity and permissions.
Parameters: None
Returns: Status of all health checks (app running, permissions, account access).
get-mail-statsGet mail statistics.
Parameters: None
Returns: Total and per-account message/unread counts, plus recently received stats (24h, 7d, 30d).
get-sync-statusCheck Mail.app sync activity.
Parameters: None
Returns: Whether sync is detected, pending uploads, recent activity, and seconds since last change.
User: "Check my inbox for new emails"
AI: [calls list-messages]
"You have 12 messages. Here are the most recent..."
User: "Show me emails from Sarah"
AI: [calls search-messages with query="Sarah"]
"Found 3 emails from Sarah across all mailboxes..."
User: "Read the first one"
AI: [calls get-message with id="..."]
"Subject: Project Update..."
By default, operations use Mail.app's configured default send account. Search operations check all accounts when no account is specified. To work with specific accounts:
User: "What email accounts do I have?"
AI: [calls list-accounts]
"You have 3 accounts: iCloud, Gmail, Work Exchange"
User: "Show unread emails in my Work account"
AI: [calls list-messages with account="Work Exchange", mailbox="INBOX"]
"Your Work account has 5 unread messages..."
User: "Draft an email to the team about the deadline"
AI: [calls create-draft with to=["team@..."], subject="...", body="..."]
"I've created a draft. Please review it in Mail.app before sending."
User: "Send it"
AI: [User opens Mail.app and sends manually, or AI calls send-email]
User: "Send a personalized email to Alice (alice@acme.com), Bob (bob@globex.com),
and Carol (carol@initech.com). Subject: 'Project Update for {{Company}}',
Body: 'Hi {{Name}}, here is the latest update for {{Company}}.'"
AI: [calls send-serial-email with recipients, subject template, and body template]
"Successfully sent 3 email(s):
- alice@acme.com: sent
- bob@globex.com: sent
- carol@initech.com: sent"
User: "Move all newsletters to Archive"
AI: [calls search-messages to find newsletters]
AI: [calls move-message for each, with mailbox="Archive"]
"Moved 8 newsletters to Archive"
npm install -g github:sweetrb/apple-mail-mcp
git clone https://github.com/sweetrb/apple-mail-mcp.git
cd apple-mail-mcp
npm install
npm run build
If installed from source, use this configuration:
{
"mcpServers": {
"apple-mail": {
"command": "node",
"args": ["/path/to/apple-mail-mcp/build/index.js"]
}
}
}
.mcp.json)This repo ships a .mcp.json at its root so that, when you run claude from inside a clone, the server is registered automatically as a project-scope server — no manual config needed. After npm run build, just launch Claude Code from the repo directory and approve the server when prompted.
The entrypoint is written as:
"args": ["${CLAUDE_PROJECT_DIR:-.}/build/index.js"]
CLAUDE_PROJECT_DIR is the variable Claude Code injects into a project/user-scoped server's environment, and it resolves to the repo root. You must launch claude from inside the repo for this to work — the bare . fallback is only a last resort and is not reliable, because it resolves against the launching process's working directory, not the repo.
Why not
${CLAUDE_PLUGIN_ROOT}?CLAUDE_PLUGIN_ROOTis set only for marketplace plugin installs, never for a project-scope clone, so it can't drive the clone workflow. Conversely, a plugin install can't useCLAUDE_PROJECT_DIR(in a plugin, that points at the user's project, not the plugin's own directory). Claude Code does not support nested defaults like${CLAUDE_PLUGIN_ROOT:-${CLAUDE_PROJECT_DIR:-.}}, so a single entrypoint string cannot serve both contexts. The two distribution paths are therefore decoupled: the plugin carries its own MCP config in.claude-plugin/plugin.json(using${CLAUDE_PLUGIN_ROOT}), while the root.mcp.jsonis dedicated to the clone workflow (using${CLAUDE_PROJECT_DIR:-.}). Becauseplugin.jsondeclares its ownmcpServers, the plugin does not also auto-load the root.mcp.json, so there is no double-registration.
Heads-up on scope precedence: project-scope (
.mcp.json) outranks user-scope. If you also have anapple-mailentry registered at user scope (e.g. an absolute path in~/.claude.json), the project-scope entry wins and the user-scope one is ignored entirely. Pick one — for local development on this repo, the project-scope.mcp.jsonis the intended source. To pin a specific local build instead, register it at local scope (claude mcp add apple-mail -s local -- node /abs/path/build/index.js), which outranks project scope.
create-draft to review emails before sending.| Limitation | Reason |
|---|---|
| macOS only | Apple Mail and AppleScript are macOS-specific |
| No sending HTML email | Emails are sent as plain text; reading HTML content is supported |
| Attachments require absolute paths | File attachments must use full absolute paths (e.g., /Users/me/file.pdf) |
| No smart mailboxes | Cannot access Smart Mailboxes via AppleScript |
| In-memory templates | Email templates are not persisted across server restarts |
| Numeric-only message IDs | Message IDs must contain only digits (validated by schema) |
| Batch size cap | Batch operations are limited to 100 messages per request |
| Date filter format | Date filters must be valid parseable dates (e.g., "January 1, 2026" or "2026-03-15"); bare numbers or non-date strings are rejected |
| Attachment save path restrictions | save-attachment only allows saving to home directory, /tmp, /private/tmp, and /Volumes; path traversal is blocked |
| Attachment count limit | send-email and create-draft accept a maximum of 20 file attachments |
Prior to v1.4.0, reply-to-message and forward-message would send messages with empty body text when the MCP server ran as a background process (e.g., spawned via execSync from Node.js, which is how Claude Code invokes it).
Root cause: The AppleScript reply msg with opening window command creates a GUI compose window asynchronously. When set content runs immediately after, the window may not be ready, and the content assignment is silently ignored. Delays (delay 1, delay 2) were unreliable — the compose window's readiness depends on system load, Mail.app state, and whether the process has GUI access.
Fix: Replaced with opening window with without opening window for both reply and forward commands. With this approach, set content works immediately and reliably from background processes. In-Reply-To and References headers are still set correctly by Mail.app, and no GUI compose window is opened.
See #7 for full details and the list of approaches that were tested.
When sending content containing backslashes (\) to this MCP server, you must escape them as \\ in the JSON parameters.
Why: The MCP protocol uses JSON for parameter passing. In JSON, a single backslash is an escape character. To include a literal backslash in content, it must be escaped as \\.
Example - Email with file path:
{
"to": ["colleague@company.com"],
"subject": "File Location",
"body": "The file is at C:\\\\Users\\\\Documents\\\\report.pdf"
}
The \\\\ in JSON becomes \\ in the actual string, which represents a single \ in the email.
Common patterns requiring escaping:
C:\Users\ → C:\\\\Users\\\\ in JSONMobile\ Documents → Mobile\\\\ Documents in JSON\d+ → \\\\d+ in JSONIf you see errors when sending emails with backslashes, double-check that backslashes are properly escaped in the JSON payload.
search-messages to find the current message IDlist-accounts to see exact account namesapple-mail server fails to connect when run from a clone.mcp.json resolves its entrypoint via ${CLAUDE_PROJECT_DIR:-.}/build/index.js. Launch claude from inside the repo directory — CLAUDE_PROJECT_DIR only resolves to the repo root in that case; the bare . fallback uses the launching shell's working directory and will point at the wrong place otherwise.npm run build first — the server is build/index.js, which doesn't exist until you build.claude mcp list to check status. If you see a conflicting scopes warning for apple-mail, you have it registered at more than one scope; project-scope wins. See Running from a clone for how scope precedence resolves.claude mcp get apple-mail shows ⏸ Pending approval, approve the project-scope server (Claude Code prompts on startup, or run it again after approving).npm install # Install dependencies
npm run build # Compile TypeScript
npm test # Run unit tests
npm run test:integration # Run integration tests (requires Mail.app)
npm run test:all # Run all tests (unit + integration)
npm run lint # Check code style
npm run format # Format code
Rob Sweet - President, Superior Technologies Research
A software consulting, contracting, and development company.
MIT License - see LICENSE for details.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
FAQs
MCP server for Apple Mail - read, search, send, and manage emails via Claude
The npm package apple-mail-mcp receives a total of 199 weekly downloads. As such, apple-mail-mcp popularity was classified as not popular.
We found that apple-mail-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.