mailmcp
Controls Apple Mail, enabling management of configured accounts and mailboxes, searching and reading messages, setting read/flag state, moving or trashing messages, creating/reply/forwarding drafts, handling attachments, and sending drafts from the local Mail session.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mailmcp
A local MCP server that controls Apple Mail through JavaScript for Automation. It uses the accounts that are already configured in Mail. It does not need passwords.
Requirements
macOS with Apple Mail configured
Node.js 22 or later
Automation permission to control Mail
Accessibility permission, only for
delete_mailbox
Related MCP server: apple-mail-mcp
Install
npm install -g @beeltec/mailmcp
mailmcp setupSetup lets you select:
The accounts the server can access
The Trash mailbox of each account (detected automatically when possible)
The tools the server offers (destructive tools are off by default)
The scope: user (all projects) or project (the current directory)
The harnesses to install the server in: Claude Code, Claude Desktop, Codex, Cursor, Gemini CLI, opencode, and pi
Harness | User scope | Project scope |
Claude Code |
|
|
Claude Desktop |
|
|
Codex |
|
|
Cursor |
|
|
Gemini CLI |
|
|
opencode |
|
|
pi (with pi-mcp-adapter) |
|
|
Run setup in the project directory to use project scope. Project files contain absolute paths of your computer.
Run mailmcp setup again to change these settings. Restart the harness after changes.
To add the server manually:
codex mcp add mail -- /absolute/path/to/node /absolute/path/to/mailmcp/dist/cli.jsConfiguration
Setup writes ~/.config/mailmcp/config.json. Set MAILMCP_CONFIG to use a different path.
{
"accounts": [
{ "id": "ACCOUNT-ID-FROM-SETUP", "email": "you@example.com", "trash": ["Trash"] }
],
"tools": ["list_mailboxes", "search_messages", "read_message"]
}Without tools, all tools are enabled. list_accounts is always enabled.
MCP tools cannot change the account allowlist.
Tools
Tools | Purpose |
| List allowed accounts and their mailboxes |
| Manage custom folders (delete only empty ones) |
| Search by subject, sender, recipient, date, and unread state |
| Read message bodies in pages and list attachments |
| Set read state or flag color |
| Move a message within an account or into its Trash |
| Create plain-text drafts |
| Read a draft and get its revision for sending |
| Attach a local file or save a received attachment to a private folder in the OS temp folder |
| Send a draft created in this session |
Limits
Drafts can only be sent from the server session that created them.
send_draftneeds the current revision fromget_draft. Do not retry a timed-out send.mailmcp inserts the draft body through a temporary Mail signature, because Mail quotes text that a script sets directly. The draft window shows its name. Do not select another signature in such a draft, because Mail then replaces the body.
Replies and forwards need Mail's setting "Place signature above quoted text" (on by default). Otherwise the body appears below the quoted original.
mailmcp cannot read body edits made in the draft window.
send_draftstill detects a changed sender, subject, signature or recipient list.add_attachmentworks only with new drafts. Mail puts the attachment above the body. Forwards keep the original attachments.Search pages return at most 50 results. Follow
nextOffsetuntil it isnull.Moves between accounts are not supported.
Each request times out after 45 seconds. A timed-out write can still complete in Mail.
After a timed-out draft request, a temporary
mailmcp draft bodysignature can stay in Mail. mailmcp deletes it with the next draft in the same session. You can also delete it in Mail settings.
Development
npm ci
npm run check
npm run build
npx @modelcontextprotocol/inspector node dist/cli.jsLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search connected email, read and manage messages, draft and send, and manage rules for new mail.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
Gmail, Outlook, Hotmail, Microsoft 365, iCloud, Fastmail, other IMAP mailboxes: search, read, send.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables integration with Apple Mail on macOS using JavaScript for Automation (JXA). Supports reading, searching, sending, and managing emails across multiple accounts with full mailbox hierarchy support.5MIT
- AlicenseAqualityBmaintenanceEnables macOS users to programmatically read, send, search, and manage Apple Mail messages, including drafts, mailboxes, attachments, rules, and templates.25MIT
- FlicenseNot gradedqualityFmaintenanceEnables reading, searching, composing, replying, forwarding, sending, flagging, and moving macOS Apple Mail messages through native scripting, with policy-controlled outgoing drafts and attachments.-
- AlicenseAqualityBmaintenanceEnables local, stdio-based management of the configured macOS Mail app for reading accounts, mailboxes, and messages; drafting, queueing, approving, and sending emails; and handling read status, flags, moves, contact context, and daily briefings with safety controls.2648 npm1MIT