
Apple Mail MCP Server by sweetrb: Setup for Claude Code, Codex and More
Lets Claude, Codex and other assistants read, search, draft, send and organize email in the Apple Mail app on your Mac.
This is a community server by sweetrb that drives the Apple Mail app on your Mac. It runs locally, needs macOS and Node.js 20 or later, and has no account or API key. The first time you use it, macOS asks you to allow automation of Mail.
It can send real email and delete messages, folders and rules, and there is no read-only mode. Ask for drafts first and review them before anything is sent.
Good for
- Mac users who live in Apple Mail and want help triaging the inbox
- People who want email drafted for review, then sent
- Claude Code and Codex users who already work on a Mac
- Teams sending personalized mail merges from Apple Mail
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install Apple Mail MCP (sweetrb)
Claude Code
- 1
Copy this prompt.
Add the Apple Mail MCP (sweetrb) server to Claude Code. Run this command: claude mcp add apple-mail -s user -- npx -y apple-mail-mcp Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires macOS, Node.js 20+.
Only works on a Mac. The first call makes macOS ask you to allow automation of Mail, so click OK.
From the project README. Source.
Tools
Finds emails by sender, subject, text, date or status
Searches across your accounts and returns each match with an id, date, subject, sender, mailbox and read state. The ids are what other tools need.
Try: “Find unread emails from john@example.com this week.”
Read ·
search-messagesLists recent emails in a mailbox
Browses a mailbox page by page, optionally for one sender or unread only, and returns ids with date, subject and sender.
Try: “Show my 20 latest inbox messages.”
Read ·
list-messagesReads one email in full
Returns the subject and body of a message you already have the id for, as plain text or HTML.
Try: “Read the email from the landlord.”
Read ·
get-messageShows an email's raw headers
Returns the technical headers of a message, such as the sender's Date line, Message-ID and the Received trail, without the body.
Try: “Show the headers of that suspicious email.”
Read ·
get-message-headersGets the original email file exactly as stored
Fetches a message's complete original bytes from the mail server for archiving, with a SHA-256 hash. It works only for accounts set up over IMAP, and can save the result to a file.
Try: “Save the original of that invoice email to my Documents folder.”
Files ·
get-message-rfc822Shows a whole conversation
Gathers the messages in the same conversation as one email, oldest first.
Try: “Show the full thread for this email.”
Read ·
get-threadSaves a draft for you to review
Creates an email in Drafts instead of sending it. The README names this the safe choice for any new message.
Try: “Draft a reply to the team about Friday's meeting.”
Write ·
create-draftSends an email right away
Sends one email immediately to the recipients you give, with optional attachments. The tool's own description says it cannot be unsent, so confirm recipients and text first.
Try: “Send Anna the meeting notes.”
Write ·
send-emailSends personalized copies to a list
Mail merge: sends one personalized email per recipient, up to 100, with placeholders filled from each recipient's details.
Try: “Send each client their invoice number in the same message.”
Write ·
send-serial-emailReplies to an email
Replies to a message by id, keeping the thread and quote. It can reply to everyone, and it can save a draft instead of sending.
Try: “Reply to John saying Thursday works, as a draft.”
Write ·
reply-to-messageForwards an email
Forwards a message by id to new recipients with an optional note. It can save a draft instead of sending.
Try: “Forward this to my colleague with a short note.”
Write ·
forward-messageMarks one email as read
Sets one message to read.
Try: “Mark that email as read.”
Write ·
mark-as-readMarks one email as unread
Sets one message back to unread.
Try: “Mark that email unread so I see it later.”
Write ·
mark-as-unreadFlags one email, with an optional color
Flags a message, optionally red, orange, yellow, green, blue, purple or gray.
Try: “Flag the contract email in red.”
Write ·
flag-messageRemoves the flag from one email
Clears the flag on one message.
Try: “Remove the flag from that email.”
Write ·
unflag-messageFiles one email into another folder
Moves one message into a mailbox you name, for example to archive it.
Try: “Move this email to Archive.”
Write ·
move-messageMoves one email to the Trash
Deletes one message by moving it to Trash.
Try: “Delete that newsletter.”
Delete ·
delete-messageMarks many emails as read
Sets up to 100 messages to read at once and reports how many worked.
Try: “Mark all these newsletters as read.”
Write ·
batch-mark-as-readMarks many emails as unread
Sets up to 100 messages to unread at once.
Try: “Mark these three emails as unread.”
Write ·
batch-mark-as-unreadFlags many emails at once
Flags up to 100 messages, optionally with a color.
Try: “Flag all the invoices from this month in green.”
Write ·
batch-flag-messagesUnflags many emails at once
Clears flags on up to 100 messages.
Try: “Remove flags from all of last year's emails.”
Write ·
batch-unflag-messagesFiles many emails into one folder
Moves up to 100 messages to the same mailbox in one call, for example to bulk archive.
Try: “Move all these receipts to the Receipts folder.”
Write ·
batch-move-messagesMoves many emails to the Trash
Moves up to 100 messages to Trash in one call and reports counts of successes and failures.
Try: “Delete all the promotional emails I just listed.”
Delete ·
batch-delete-messagesConverts an IMAP id to a Mail id
Looks up the numeric Mail.app id for messages found with an imap: id, which replying and forwarding need.
Try: “Get the Mail id for that IMAP message.”
Read ·
resolve-message-idLists an email's attachments
Returns each attachment's name, type and size for a message.
Try: “What attachments does the invoice email have?”
Read ·
list-attachmentsSaves an attachment to a folder
Writes one attachment into a directory you name. The tool only accepts folders inside its allowed roots and rejects path tricks.
Try: “Save the PDF from that email to my Downloads folder.”
Write ·
save-attachmentGets an attachment's contents without saving
Returns up to 3 MiB of an attachment as base64 so the assistant can read it without writing a file.
Try: “Read the text in the attached CSV.”
Read ·
fetch-attachmentLists your folders with counts
Shows the mailboxes in your accounts with their paths and unread and message counts, and says when an account could not be read.
Try: “List all my mail folders.”
Read ·
list-mailboxesCounts unread emails
Returns the number of unread messages for the inbox, or a mailbox or account you name.
Try: “How many unread emails do I have?”
Read ·
get-unread-countCreates a mail folder
Creates a new mailbox in an account.
Try: “Create a folder called Receipts 2026.”
Write ·
create-mailboxRenames a mail folder
Renames an existing mailbox within an account.
Try: “Rename the folder Old to Archive 2024.”
Write ·
rename-mailboxDeletes a mail folder
Deletes a folder. The tool's description says this removes the folder and any messages it contains.
Try: “Delete the empty folder Temp.”
Delete ·
delete-mailboxLists your smart mailboxes
Shows smart mailboxes and a summary of their criteria. It works on German-language macOS too.
Try: “What smart mailboxes do I have?”
Read ·
list-smart-mailboxesCreates a smart mailbox
Creates a smart mailbox that matches a sender, subject or body text.
Try: “Create a smart mailbox for emails from my bank.”
Write ·
create-smart-mailboxDeletes a smart mailbox
Removes a smart mailbox by name. Only the saved search goes, not real folders or messages.
Try: “Delete my smart mailbox "Bank".”
Delete ·
delete-smart-mailboxFinds newsletter senders and makes a smart mailbox for each
Scans up to about 400 recent messages per inbox to find bulk senders. It only proposes by default, and with dry run off it edits Apple Mail's smart mailbox file (backed up first) and can create many at once.
Try: “Show me which newsletters I could group into smart mailboxes.”
Write ·
create-newsletter-smart-mailboxesLists your mail accounts
Returns the names of the accounts set up in Mail, such as iCloud or Gmail, to pass to other tools.
Try: “Which mail accounts do I have?”
Read ·
list-accountsLists your mail rules
Shows each Mail rule and whether it is on.
Try: “What mail rules do I have?”
Read ·
list-rulesTurns a mail rule on
Enables an existing rule by name.
Try: “Turn on my "Receipts" rule.”
Write ·
enable-ruleTurns a mail rule off
Disables a rule by name without deleting it.
Try: “Pause my newsletter rule.”
Write ·
disable-ruleCreates a mail rule
Adds a rule with conditions and actions such as mark read, flag, move or delete. It then acts on your real mail on an ongoing basis.
Try: “Create a rule that files mail from billing@example.com into Receipts.”
Delete ·
create-ruleDeletes a mail rule
Removes a rule permanently by name.
Try: “Delete my "Old promos" rule.”
Delete ·
delete-ruleLooks up people in your Contacts
Searches the macOS Contacts database for names, emails and phone numbers. It needs Full Disk Access and Node.js 22.5 or later.
Try: “What is Maria's email address?”
Files ·
search-contactsSaves a reusable email template
Stores a template with subject, body and optional default recipients in a file on your Mac. Using an existing id overwrites that template.
Try: “Save this as a template called "Weekly update".”
Write ·
save-templateLists your saved templates
Returns the id, name and subject of each saved template.
Try: “What email templates do I have?”
Read ·
list-templatesShows one template
Returns a template's full subject, recipients and body.
Try: “Show my "Weekly update" template.”
Read ·
get-templateDeletes a saved template
Removes a saved template permanently by id.
Try: “Delete the "Weekly update" template.”
Delete ·
delete-templateMakes a draft from a template
Creates a draft in Mail from a saved template, with any changes you ask for, for you to review and send.
Try: “Draft an email from my "Weekly update" template for the team.”
Write ·
use-templateChecks that Mail is reachable
Runs a quick pass or fail check of the connection to Mail.app.
Try: “Is the Mail connection working?”
Read ·
health-checkDiagnoses setup problems
Checks Mail permissions, accounts and the IMAP and SMTP setup and explains how to fix what is wrong.
Try: “Run the doctor and tell me why sending fails.”
Read ·
doctorShows mailbox totals
Returns total and unread counts, recent arrivals over the last 24 hours, 7 days and 30 days, and a per-account breakdown.
Try: “How much mail did I get this week?”
Read ·
get-mail-statsChecks if Mail is syncing
Reports whether Mail.app is running and syncing, which explains why new mail may not show yet.
Try: “Is Mail still syncing?”
Read ·
get-sync-status
Read from the source code
Permissions
high risk · 5 things to watch
High risk
The assistant can send real email and delete messages, folders and rules in Apple Mail, and there is no read-only mode. Ask for drafts first and confirm every delete.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It sends real email that cannot be unsent
The send, reply, forward and mail-merge tools send straight away unless you ask for a draft. Ask for drafts and read them before sending. github.com
It can delete messages, folders and rules
It can delete messages (to Trash, up to 100 at once), whole mailboxes with their messages, mail rules and smart mailboxes. Confirm the exact names before each delete. github.com
A mail rule keeps acting on your mail
The rule tool can create rules that mark, move or delete mail on an ongoing basis. Review the conditions before you allow it. github.com
Attachments and templates write files on your Mac
Saving an attachment writes into a folder you name inside its allowed roots, and templates are stored in a file under Application Support. Outbound attachments may come from ordinary files under your home folder, with credential and config locations denied by default. github.com
Contact search needs Full Disk Access
Searching contacts reads the Contacts database directly, so it needs Full Disk Access for Node and Node.js 22.5 or later. Skip that permission if you do not need it. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | No read-only mode is documented. Every tool in the default install is available. |
|---|---|
| Talks to | Your own mail provider over TLS, only if you configure IMAP or SMTP |
| Sign-in and keys | No account or API key. It controls Mail.app through macOS Automation, and optional IMAP or SMTP passwords are kept in the macOS Keychain. |
Questions
Is the Apple Mail MCP server official?
No. It is a community project by sweetrb, not made by Apple. It runs on your Mac and drives the Apple Mail app.
Does it only work on a Mac?
Yes. It needs macOS, because it talks to Apple Mail through AppleScript, plus Node.js 20 or later and at least one account set up in Mail.
Will it send email without asking me?
It can. The send tool sends immediately and cannot be undone. Ask for drafts and review them, since the README recommends the draft tool for any new message.
Does it need an API key or my email password?
No key is needed. It works through the Mail app you already use after you allow macOS automation. IMAP and SMTP are optional, and their passwords stay in the macOS Keychain.
Can it run read-only?
No. There is no read-only switch, so every tool stays available in the default install.
Does my mail leave my computer?
Not through this server. The README says it talks only to Mail on your Mac and, if you set up IMAP or SMTP, to your own mail provider. Your AI app still sees whatever the tools return.
Is it the same as imdinu/apple-mail-mcp?
No. That is an unrelated Python project of the same name. This page covers the npm package apple-mail-mcp from sweetrb.
Which assistants does it work with?
Claude Code, Claude Desktop and Codex are documented, and the README also covers Hermes and Antigravity. It runs locally, so web chat apps cannot use it.
Why does macOS keep asking for permission?
macOS asks for Automation access to Mail the first time. If it keeps asking, usually after a Node upgrade, the README points to a guide that runs the server under the signed Node build.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
apple-mail-mcp- Registry
- npm
- Version
- 2.20.52
- License
- MIT
- Last commit
- Oct 31, 2026
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 3Hide
- github.com · github.com
- www.npmjs.com · npmjs.com
- github.com · github.com