Skip to main content
Glama
IsakRein

mac-mail-mcp

by IsakRein

email-cli

Read Apple Mail.app email from the command line, straight from the local store. No OAuth, no API keys, no scripting the app — Mail keeps all envelope metadata in a SQLite database and the message bodies as .emlx files, and this reads both directly. Works with every account Mail.app is configured with (Gmail, Exchange, iCloud, IMAP), offline, and is read-only by design: it cannot send, move, or delete anything.

Same shape as things and tt: a small data layer, a rich-rendered CLI over the top.

email inbox
email search "invoice" --from stripe --since 2026-07-01
email show 39751

Install

uv tool install "git+https://github.com/IsakRein/Productivity.Email-CLI"

For development:

uv sync --extra dev
uv run pytest

The terminal needs Full Disk Access (System Settings > Privacy & Security) to read ~/Library/Mail. email doctor tells you if it doesn't have it.

Related MCP server: apple-mail-mcp

Commands

Command

What

status

accounts and unread summary

inbox [--account] [--unread]

inbox messages across accounts

unread [--account] [--folder]

unread messages everywhere

search <query> [--folder/--account/--from/--since/--unread/--flagged]

subject/sender search

show <id>

one message in full, with its body

thread <id>

every message in a conversation

accounts

Mail.app accounts

folders [--account] [--all]

folders with message counts

doctor

verify the store is readable end to end

Every read takes --json; lists take --limit N (default 25). Message ids are Mail's own ROWIDs, shown in every table. --account accepts an account name, username, or id prefix.

How it works

  • ~/Library/Mail/V*/MailData/Envelope Index — SQLite with messages, subjects, addresses, mailboxes, recipients, attachments. Opened read-only.

  • ~/Library/Mail/V*/<account>/<Folder>.mbox/.../Messages/<id>.emlx — one file per downloaded message: a byte count, the raw RFC 822 message, then an Apple flags plist. Parsed with the stdlib email package, preferring text/plain and falling back to stripped HTML.

  • ~/Library/Accounts/Accounts4.sqlite — account display names ("Google", "Exchange"). Optional; UUIDs are shown when unreadable.

email_cli/
  db.py      — Envelope Index queries, account names, dataclasses
  emlx.py    — locate + parse .emlx bodies
  cli.py     — commands + rich rendering

Limitations

  • Read-only — no sending, moving, or deleting.

  • Bodies exist only for messages Mail.app has downloaded locally.

  • Mail.app must be (or have been) configured with the accounts.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    5
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to fetch emails from local Apple Mail accounts and mailboxes, and parse Google Scholar alert emails to extract paper titles and links.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A read-only MCP server for Apple Mail on macOS that enables searching and reading emails directly from the local SQLite database, with fast SQL-level filtering and pagination.
    MIT

View all related MCP servers

Related MCP Connectors

  • Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.

  • Read your own DMARC aggregate and forensic reports: sources, alignment, alerts, CSV export.

  • Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.

View all MCP Connectors

Latest Blog Posts

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/IsakRein/Productivity.Email-CLI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server