macOS Mail MCP
Reads emails from Apple Mail accounts on macOS, leveraging Apple's mail automation and account discovery.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@macOS Mail MCPshow me my unread emails from today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
macOS Mail MCP
An MCP server that discovers the mail accounts already configured in Apple Mail and reads them through Apple Mail automation. There is no accounts configuration file, and this project never writes a password or token to disk.
Status and macOS boundary
macOS has no supported public API for enumerating the detailed incoming/outgoing server settings of every Internet Account. This server reads the current Sonoma accountd store at ~/Library/Accounts/Accounts4.sqlite (and supports legacy Apple Mail Accounts.plist metadata when present), then obtains credentials only on demand with the macOS security tool. This is deliberately best-effort across Mail versions: test it against your particular Sonoma-or-newer Mail configuration before using it for production workflows.
The first mail operation may show an Automation prompt. Allow the ChatGPT desktop app to control Mail. Do not export/import passwords: Apple Mail performs its own account authentication, including provider OAuth.
Because Apple Mail stores its account database in a TCC-protected Library location, macOS also requires Full Disk Access for the application launching this server. In System Settings → Privacy & Security → Full Disk Access, add Terminal/iTerm if you launch it there; add your MCP desktop client (for example Codex) when that client launches it. Restart the launching application afterwards.
Related MCP server: mail-mcp
Install
Requires macOS Sonoma+, Python 3.12+, and Apple Mail configured with IMAP-capable accounts.
git clone git@github.com:wherecodegetscooked/applemail-mcp.git
cd applemail-mcp
python3.12 -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/pytestRun it over standard input/output (the normal MCP transport):
.venv/bin/macos-mail-mcpRegister the server with the ChatGPT desktop app / Codex:
codex mcp add macos-mail -- "$PWD/.venv/bin/macos-mail-mcp"Restart the ChatGPT desktop app, then ask a new Codex task about your mail. Keep stdout reserved for MCP traffic; diagnostics go to stderr/the launchd log.
Architecture
discovery.pyscans macOS account metadata every cycle. Account additions, removals, and server changes are picked up without a server restart.apple_mail.pyuses macOS JXA automation to read the already-synced Apple Mail app. Apple Mail remains responsible for IMAP, SMTP, provider OAuth, retries, and credentials.service.pyqueries Apple Mail directly for current mail and search, then caches returned messages in SQLite/FTS5 for subsequent local reads.store.pycontains message metadata, indexed bodies, and attachment metadata. It has no credentials. Attachment bytes are fetched only afterread_attachment.
Security and operations
The SQLite cache is private to the user at ~/Library/Application Support/macOS-Mail-MCP/mail.sqlite3; protect the macOS login account and use FileVault. It can contain email content, so do not place it in a shared directory. Set MAIL_MCP_DB to another private path if required and MAIL_MCP_LOG_LEVEL=DEBUG for troubleshooting. Logs never include passwords.
Apple Mail performs provider authentication itself, so OAuth-only accounts such as Gmail can be queried without making their tokens available to this server. The server needs Full Disk Access for account discovery and Automation permission to read Mail.
launchd
launchd/com.example.macos-mail-mcp.plist is a template. Replace both REPLACE_ME occurrences and the executable path with the virtualenv’s absolute executable path, then install it:
mkdir -p ~/Library/LaunchAgents
cp launchd/com.example.macos-mail-mcp.plist ~/Library/LaunchAgents/
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.example.macos-mail-mcp.plistFor an stdio MCP server, launchd is normally used by a client-side bridge; most MCP desktop clients instead start the command themselves. Do not start two instances against the same SQLite file unless you have intentionally chosen that arrangement.
Testing
Unit tests cover plist normalization, Keychain command handling, and SQLite FTS/incremental sync state. Integration testing should use a dedicated disposable IMAP account and an isolated MAIL_MCP_DB; it must never use a personal mailbox in CI. Run pytest locally after configuring that account.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/wherecodegetscooked/applemail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server