I open-sourced a Cursor skill that gives your AI agent full control over macOS Mail.app: read, search, compose, reply, forward, move, delete, and label emails without leaving the editor.
Drop it into .cursor/skills/ and the agent can triage your inbox, draft replies, and organise mail on your behalf.
Highlights
- Disk-first reads: parses
.emlxfiles directly (~5 ms per message vs seconds via the scripting bridge) - FTS5 search: SQLite full-text search index across body, subject, and sender
- Exchange-safe deletes: uses RFC Message-ID so it works reliably with Exchange accounts
- Draft-first sending: compose and reply always create drafts first; nothing sends without explicit confirmation
- Dry-run support: destructive operations (delete, amend-subject) support
--dry-runto preview changes
Commands
All commands go through scripts/mail.sh and return structured JSON:
list-accounts, list-folders, list-recent, list-emails, list-drafts, read-email, search, compose-draft, amend-draft, send-draft, reply-draft, forward-draft, delete-email, delete-draft, move-email, amend-subject, add-label, build-index
Setup
cp -r apple-mail /path/to/project/.cursor/skills/
On first use, mail.sh auto-creates a micromamba environment with Python 3.11 and installs dependencies.
Requirements: macOS with Mail.app configured, micromamba, Full Disk Access for Terminal.
GitHub: GitHub - Don-Yin/apple-mail: an agent skill that gives AI assistants full control over macOS Mail.app ยท GitHub
License: MIT