apple-mail-mcp is a Go Model Context Protocol (MCP) server for macOS that gives MCP-compatible assistants programmatic access to Mail.app for listing accounts/mailboxes, searching and reading messages, sending drafts/emails, and unread-count workflows.
- macOS 12+
- Mail.app configured with at least one account
- Go 1.22+ (only required for building from source)
Download apple-mail-mcp.mcpb from the latest release and double-click it. Claude Desktop installs and registers the server automatically.
curl -fsSL https://raw.githubusercontent.com/maximbilan/apple-mail-mcp-go/main/install.sh | shThis installer:
- Detects macOS architecture and installs
~/.local/bin/apple-mail-mcp - Uses local
go build/go installwhen Go exists, otherwise downloads the latest release binary and verifies SHA256 - Detects Claude Desktop and/or Claude Code and offers registration
go install github.com/maximbilan/apple-mail-mcp-go/cmd/apple-mail-mcp@latest
apple-mail-mcp installClaude Desktop config path:
~/Library/Application Support/Claude/claude_desktop_config.json
Add/update:
{
"mcpServers": {
"apple-mail": {
"command": "/Users/<you>/.local/bin/apple-mail-mcp",
"args": []
}
}
}Claude Code:
claude mcp add apple-mail "$HOME/.local/bin/apple-mail-mcp" --scope userThe first time osascript controls Mail.app, macOS shows an Automation permission prompt.
Grant access for the calling process (for example Terminal, Claude Desktop, or Claude Code).
If needed, manage this at:
System Settings -> Privacy & Security -> Automation
Generated from registered tools via:
go run ./cmd/apple-mail-mcp tools-docs| Name | Params | Description |
|---|---|---|
| list_accounts | none | List account names configured in Mail.app. |
| list_mailboxes | account (string, required) | List mailboxes for an account with unread counts. |
| search_messages | account (required), mailbox, sender_contains, subject_contains, unread_only, date_from, date_to, limit | Search messages with server-side filters. |
| get_message | message_id (required), include_body | Get message metadata and optionally full body. |
| get_unread_count | account (optional) | Get total and per-mailbox unread counts. |
| send_email | to, subject, body, cc, bcc, account | Send a plaintext email immediately. |
| create_draft | to, subject, body, cc, bcc, account | Create a draft email without sending. |
| mark_as_read | message_ids, read | Mark messages as read/unread (max 100 ids). |
Start over stdio transport:
apple-mail-mcp --log-level infoRead-only mode (write tools hidden):
apple-mail-mcp --read-only- Some Mail messages can have missing/malformed date metadata.
search_messagesfalls back fromdate senttodate received, and date can be empty when unavailable. - Gmail label model can surface
All Mailsemantics.search_messagesmailbox output reflects the mailbox requested in the query (for exampleINBOX) to avoid confusion.
Integration tests require Mail.app on macOS and explicit build tag:
go test ./tests/integration -tags=integration -v- Mail.app not responding:
- Open Mail.app once and ensure account sync completes.
- Permission denied:
- Re-check macOS Automation permissions for the process invoking the server.
- AppleScript timeout:
- Open Mail.app, wait for sync to settle, then retry.
- Increase timeout with
APPLE_MAIL_MCP_TIMEOUT(e.g.120sor180).
- Config did not update:
- Restart Claude Desktop and run
claude mcp listfor Claude Code.
- Restart Claude Desktop and run
Before creating a public release:
go build ./...
go vet ./...
go test ./... -raceInstall path smoke checks:
./install.sh
apple-mail-mcp install --yes
apple-mail-mcp uninstall --yes./uninstall.shOr if installed from go install:
apple-mail-mcp uninstallMIT