Repository navigation
Releases
v3.3.0
Added
list_email_attachmentsandsave_email_attachmentacceptmessage_id(the idsearch_emailsreturns) andmailbox, looking the message up directly instead of by subject, so recurring subjects can't pick the wrong month (#128 by @proscar87).read_email(account, message_id, mailbox)returns one message as headers, plain-text body and attachment list, looked up directly by the idsearch_emailsreturns, with the body capped atmax_charsand the cut stated (#128 by @proscar87).
Security
- The write-path denylist now also checks the path as requested, not only its
symlink target. A symlink inside a protected folder (e.g.
/opt/homebrew/bin/python3) resolves outside it, so writing through it was
allowed (#125 by @proscar87, follow-up to #103). - Hardened the file-path guard for file-writing tools (#103, follow-up to #19).
The old denylist missed shell startup files, so a prompt-injected
save_email_attachment(save_path="~/.zshrc")could plant an attacker-supplied
attachment that ran on the next shell.save_email_attachment,
export_emailsandcreate_rich_email_draft'soutput_path(previously
unchecked) now refuse every dotfile and dot-folder directly in$HOME
(~/.zshrc,~/.ssh,~/.gitconfig,~/.config,~/.netrc, ...),
.git/hooks,.git/configand.envrcanywhere, autostart and persistence
locations (~/Library/LaunchAgents,/Library/LaunchDaemons,
~/Library/Application Support,~/Library/Preferences, ...) andPATH
folders (~/bin,/usr/local/bin,/opt/homebrew/bin). Everything else
stays writable, including paths outside$HOMEsuch as the temp dir. - Attachment paths for
compose_emailandreply_to_emailmay now be any
readable file (previously$HOMEonly) except secrets:~/.ssh,~/.gnupg,
~/.aws,~/.netrc, git/cloud credentials,.envfiles,
~/Library/Keychainsand browser profiles and cookie stores. - New opt-in restriction:
APPLE_MAIL_MCP_WRITE_DIRSand
APPLE_MAIL_MCP_ATTACH_DIRS(colon-separated), or the repeatable
--write-dir/--attach-dirflags, confine writes or attachments to the
listed folders; the denylist still applies inside them. - All checks live in one shared module (
apple_mail_mcp/paths.py) instead of
three copies, resolve..and symlinks before checking, and compare
case-insensitively to match APFS (~/.ZSHRCis~/.zshrc).
Fixed
list_inbox_emailsin text output andget_mailbox_unread_counts(summary_only=True)
ignoredaccountand returned every account; they now filter by it
(#135 by @proscar87).search_emailson a mailbox over the whose-clause limit now stops its
bounded index scan at the first message outside adate_fromwindow
(newest-first) ordate_towindow (oldest-first), instead of reading the
full 4000-message cap. A one-week search of a 6,000-message mailbox no
longer holds the automation lock for minutes (#133 by
@joel-alturaeducation, related to #87 and #132).- The Claude Code plugin manifests (
plugin/.claude-plugin/plugin.json,
.claude-plugin/marketplace.json) were stuck at 3.1.2, soclaude plugin updatereported installs as current. They are now at 3.2.1 and
scripts/check_versions.pyandRELEASING.mdcover them (#127 by
@proscar87). move_emailno longer treats a negativeolder_than_daysas a filter (it
added no date condition, so the call moved everything), andmanage_trash
rejects an unrecognisedactioninstead of falling through to
move_to_trash(#124 by @proscar87).reply_to_emailnow restores the user's clipboard. The restore step sat
after the script'sreturn, so it never ran and every reply (send, draft
or open) left the reply body on the clipboard. The error path now restores
it too, as doesforward_email's error path when amessagewas pasted
(#106).
What's Changed
- docs: support installing the skill via npx skills by @patrickfreyer in #116
- refactor: reuse _COMPOSE_FONT_STYLE and test reply/forward font (#100 follow-up) by @patrickfreyer in #115
- fix: verify saved reply drafts (carries #92 and #91) by @patrickfreyer in #114
- fix: bound the get_awaiting_reply inbox scan so large mailboxes stop timing out by @patrickfreyer in #117
- fix: bound the get_awaiting_reply inbox scan so large mailboxes stop timing out by @karrolcia in #90
- fix: keep account names containing | intact by @patrickfreyer in #120
- fix: keep account names containing | intact by @herbeckrobin in #107
- fix: add a mailbox parameter to save_email_attachment by @patrickfreyer in #121
- fix: add a mailbox parameter to save_email_attachment by @herbeckrobin in #109
- fix: report the real trash count in manage_trash by @patrickfreyer in #122
- fix: report the real trash count in manage_trash by @herbeckrobin in #108
- fix: group get_email_thread by Message-ID instead of subject by @patrickfreyer in #123
- fix: group get_email_thread by Message-ID instead of subject by @herbeckrobin in #110
- fix: serialize concurrent AppleScript calls to Mail.app across plugin processes by @patrickfreyer in #118
- fix: serialize concurrent AppleScript calls to Mail.app across plugin processes by @ahharvey in #94
- fix: make --read-only block delivery instead of the compose tools by @patrickfreyer in #119
- fix: make --read-only block delivery instead of the compose tools by @herbeckrobin in #95
- fix: harden the file-write path guard (#103) by @patrickfreyer in #112
- fix: restore the clipboard after reply_to_email (#106) by @patrickfreyer in #111
- Carry #124: stop invalid inputs from turning move_email and manage_trash destructive by @patrickfreyer in #129
- fix: stop invalid inputs from turning move_email and manage_trash destructive by @proscar87 in #124
- Carry #127: bump Claude Code plugin manifests to 3.2.1 and guard them by @patrickfreyer in #130
- fix: bump the Claude Code plugin manifests to 3.2.1 and guard them by @proscar87 in #127
- Carry #125: check the requested path, not only its symlink target, against the write denylist by @patrickfreyer in #131
- fix: check the requested path, not only its symlink target, against the write denylist by @proscar87 in #125
- fix: stop the bounded search scan once it passes the date window (#133) by @patrickfreyer in #134
- fix: honour the account in list_inbox_emails text output and unread summary by @proscar87 in #135
- feat: read_email — one message by id as headers, text body and attachment list by @proscar87 in #136
- Carry #137: list and save attachments by message_id by @patrickfreyer in #138
- feat: list and save attachments by message_id by @proscar87 in #137
- Release 3.3.0 by @patrickfreyer in #139
New Contributors
- @karrolcia made their first contribution in #90
- @herbeckrobin made their first contribution in #107
Full Changelog: v3.2.1...v3.3.0
v3.2.1
Fixed
- The server failed to start on any fresh install since the
mcpSDK 2.0
release (ModuleNotFoundError: No module named 'mcp.server.fastmcp', #97).
server.pyimportedFastMCPfrom the SDK's bundled v1 module instead of
from the declaredfastmcpdependency, so oncefastmcp4.x pulled in
mcp2.x the import path vanished. Now importsfrom fastmcp import FastMCP.--read-onlyalso calledFastMCP.remove_tool(), which is
deprecated in fastmcp 3.x and removed in 4.x; it now goes through
local_provider.remove_tool(), which both support. search_emailsno longer hangs Mail or returns nothing on very large
mailboxes such as a Gmail INBOX (#41, #87). Above 5,000 messages the full
whosescan is skipped in favour of a bounded index scan (newest first for
date_desc), capped at 4,000 messages per call; when the cap is reached
the response says so (scan_limitedin JSON, a NOTE line in text) instead
of silently returning less. Body-text search on large mailboxes is bounded
too.- Reply and forward drafts render in the intended sans-serif font instead of
Mail's small serif default (#100, #101). The reply/forward HTML now carries
an explicit font style rather thanfont: inherit. - Removed the redundant
plugin/commands/email-management.mdslash command.
It shadowedplugin/skills/email-management/under the same
apple-mail:email-managementlisting key, so every session showed two
near-duplicate entries with different descriptions (#82). Claude Code
invokes skills directly as slash commands, so/email-managementstill
works via the skill alone. create_rich_email_draft'ssave_as_draftno longer claims or silently
retries a save that can never succeed. Mail opens a.emlas a read-only
message viewer, not a compose object, so the AppleScriptevery outgoing message whose subject is ...query can never match it — the old retry
loop always returnedFalseafter ~5s of polling (#83). The tool now
skips the futile retry and reports plainly thatsave_as_draftisn't
supported for this workflow, pointing tocompose_email(mode="draft")or
manage_draftsfor a real, sendable HTML draft.
What's Changed
- fix: remove redundant commands/email-management.md by @patrickfreyer in #84
- fix: report create_rich_email_draft save_as_draft honestly by @patrickfreyer in #85
- fix: import FastMCP from fastmcp so the server starts on mcp 2.x by @dbl-0 in #104
- fix: bound search_emails to a capped index scan on large mailboxes (#41) by @proscar87 in #87
- Fix reply drafts rendering in serif/small font by @syntheticgoo in #101
- release: v3.2.1 by @patrickfreyer in #113
New Contributors
- @dbl-0 made their first contribution in #104
- @proscar87 made their first contribution in #87
- @syntheticgoo made their first contribution in #101
Full Changelog: v3.2.0...v3.2.1
v3.2.0
Added
get_email_source— new tool exposing an email's raw RFC 822 source
(full headers + MIME body) for debugging threading, authentication results,
and encoding issues (#66). Supports aheaders_onlymode and a configurable
byte cap with an explicit truncation marker so huge messages can't flood the
context. Uses Mail'smessage idproperty and resolves localized inbox
names viabuild_mailbox_ref.list_inbox_emailsnow surfacesmessage_id,internet_message_idand a
mail_linkin both its JSON and text output, matchingsearch_emails
(#76) — inbox listings can be cited as Apple Mail deep links
(message://…) and targeted by id without a second lookup.
Backward-compatible with older 5-field records.
Fixed
- Stored XSS in the inbox dashboard (#77). Attacker-controlled email
subjects/senders containing</script>could break out of the dashboard's
embedded JSON<script>block and inject arbitrary HTML. JSON injected into
the template now escapes<,>,&, and U+2028/U+2029; remaining
unescaped template interpolations in the account cards were also fixed. - Umlauts, ß, and emoji no longer garble when pasting HTML bodies into
Mail (#79). The Cocoa HTML→RTF importer auto-detected the charset and
defaulted to Latin-1, double-decoding UTF-8 bytes into mojibake
("Grüße" → "Grüße") on both the plain and HTML compose paths. The
importer is now pinned to UTF-8 viaNSCharacterEncodingDocumentAttribute.
What's Changed
- fix: pin HTML->RTF importer to UTF-8 so umlauts/ß/emoji survive paste to Mail by @patrickfreyer in #79
- feat: add get_email_source tool for raw RFC 822 access by @ahharvey in #66
- feat: surface message_id + mail_link in list_inbox_emails (parity with search) by @elfensky in #76
- Fix stored XSS in inbox dashboard (script-context breakout + innerHTML sinks) by @atlascodesai in #77
- release: v3.2.0 by @patrickfreyer in #81
New Contributors
- @ahharvey made their first contribution in #66
- @elfensky made their first contribution in #76
- @atlascodesai made their first contribution in #77
Full Changelog: v3.1.8...v3.2.0
v3.1.8
Fixed
- HTML replies/compositions no longer paste the body twice (a rendered
copy plus a second copy of the raw<p>/<b>source).reply_to_email,
compose_email, andforward_emailplaced the raw HTML source on the
clipboard underNSPasteboardTypeHTML; for any HTML that wasn't a complete
document, Mail rendered it AND surfaced the literal markup, so the message
appeared twice. The body is now converted to anNSAttributedStringand
written back as RTF (a single unambiguous rich-text flavor) plus a
rendered plain-text fallback.create_rich_email_draftwas unaffected
(it already builds a proper multipart/alternative.eml).
Added
- Release workflow now builds and attaches the
.mcpbbundle to the GitHub
Release automatically on each tag (verifies the bundle contains the
apple_mail_mcppackage and doesn't leakvenv//__pycache__). scripts/extract_changelog.py— pulls the current version's section from
this file to use as the GitHub Release body.
What's Changed
- ci: auto-build and attach the .mcpb bundle to each GitHub Release by @patrickfreyer in #69
- feat: full flag color support (set, report, query) by @samalone in #67
- move_email: add message_ids fast path for precise targeting by @brendandebeasi in #50
New Contributors
Full Changelog: v3.1.7...v3.1.8
v3.1.7 — PyPI fix + one-click .mcpb bundle
Apple Mail MCP v3.1.7
First 3.x release published to PyPI — uvx mcp-apple-mail now works with no workaround. Versions 3.0.0–3.1.6 were tagged but never uploaded, so PyPI had been stuck on the broken 2.2.0 wheel (ModuleNotFoundError: No module named 'apple_mail_mcp'). Fixes #42; addresses #57.
Install
uvx / pip (MCP server):
claude mcp add apple-mail -- uvx mcp-apple-mail
# or: pip install -U mcp-apple-mailClaude Desktop (one-click bundle): download apple-mail-mcp-v3.1.7.mcpb below → Claude Desktop → Settings → Developer → MCP Servers → Install from file → grant Mail.app permissions.
What's new in the release process
- PyPI Trusted Publishing (OIDC, no stored tokens) — tagged releases now publish automatically.
- CI builds the wheel and runs a packaging guard (
verify_wheel.py) on every push/PR, so a "dist-info only" wheel can't ship again. - Added
CHANGELOG.md+RELEASING.md.
The .mcpb bundle includes the full apple_mail_mcp package (all 27 tools), the MCP Apps dashboard UI, and the Email Management Expert skill.
v3.1.6 — Fix handler-script breakage from the timeout wrap
Fixed
- search_emails and smart inbox tools broken on v3.1.5 (#63, #64): the central
with timeoutwrap introduced in #61 nested AppleScript handler definitions (on name(...)) inside a block, which is illegal — every handler-bearing tool failed instantly withExpected "end" but found "on" (-2741). The wrap now skips handler-defining scripts; they keep their own inner timeouts and remain covered by the Python-side process kill and in-flight child tracking, so the orphaned-osascript protection from #58/#61 stays intact.
Thanks to Adrian Giles (fortress.games) for the second precise external bug report in two days.
Note: v3.1.5 was never published to PyPI; publish 3.1.6 instead.
🤖 Generated with Claude Code
v3.1.5 — Reliable body paste (no more silent empty sends)
Highlights
Fix: silent empty-body sends in reply_to_email / compose_email (HTML path) (#62)
The HTML body is inserted via a blind Cmd+V into the Mail compose window, which only lands if Mail is frontmost when the keystroke fires. The previous code relied on a single activate + fixed delay, which intermittently fired the paste before the compose window had keyboard focus — sending a message containing only the signature, while still reporting success.
This release polls until frontmost of process "Mail" is true (re-asserting focus each iteration, up to ~4s) before pasting, in both the reply and new-message paths.
A content-read-back guard was intentionally not used: Mail's GUI editor buffer is decoupled from the scriptable content property (verified empirically — it reads 0 chars even after a successful paste), so such a guard would false-fail every send. This is documented in code comments.
Also included since v3.1.4
- Prevent orphaned
osascriptfrom pinning Mail.app's main thread (#58, #61) - Reconcile version strings + add a version-drift guard (#59, #60)
Verification
- 77/77 tests pass, including new
PasteFocusHardeningTests(focus poll present and ordered before the paste; fragile fixed delay removed; no content read-back reintroduced) - All generated AppleScript variants pass
osacompile - Live draft-mode round-trip confirmed the body lands
🤖 Generated with Claude Code
v3.1.4 — HTML attachment fix + accumulated improvements
Highlight — HTML emails with attachments now actually send the attachment
The headline fix: when calling compose_email with both body_html and attachments, the attachment was being silently dropped before send. The HTML clipboard injection used Cmd+A + Cmd+V to paste the body, but the attachment was added BEFORE the paste — so the Select All grabbed the inline attachment placeholder and the paste replaced it with the HTML clipboard payload.
Impact: every HTML send with an attachment since v3.1.0 has silently lost the file. The MCP returned success because AppleScript completed without error, but recipients got no attachment.
Fix (commit 2594e8f): attachments are now added in a fresh tell newMsg block AFTER the HTML paste completes. Verified end-to-end — files arrive intact on the recipient side.
New tools
list_account_addresses(#43) — enumerate all configured email addresses per account, useful for picking the rightfrom_addressfor multi-alias accounts.synchronize_account(#53) — force-sync an account to pull new messages from the server before subsequent searches.
Other fixes
- Localized inbox names (#52) —
get_inbox_overview,list_inbox_emails, and related tools now resolve the inbox mailbox correctly when Mail.app is configured in FR/DE/ES/IT/PT/NL/JA (where "Inbox" is "Boîte de réception" / "Posteingang" / "Bandeja de entrada" / etc.). - Account default sender +
from_addressoverride (#35) —compose_emailandreply_to_emailnow respect each account's "Send new messages from" default, and accept an optionalfrom_addressparameter to pick a specific alias. - Strip CDATA wrappers (#54) — email bodies wrapped in
<![CDATA[...]]>are now unwrapped before sending so the literal tags don't appear in the recipient's email. - Reply attachment scope (commit
70d5ef1) — the attachment block inreply_to_emailis now correctly scoped toreplyMessageso AppleScript's "last paragraph" reference resolves.
Installation
Download the .mcpb file and install via Claude Desktop: Settings → Developer → MCP Servers → Install from file.
Full changelog
v3.1.3...v3.1.4 — 7 commits.
v3.1.3
What's new
- mail_link in text output — The
message://deep link was already available in JSON search results but hidden from the default text format. It now appears as aLink:line, making it easy to copy-paste into Apple Reminders or other apps that supportmessage://URLs.
Example
✓ Meeting reminder
From: sender@example.com
Date: 2026-05-02T10:30:00
Mailbox: INBOX
Link: message://%3C12345678-ABCD-1234-EFGH-123456789ABC@example.com%3E
Install / Upgrade
Claude Code plugin (recommended):
Download apple-mail-mcp-v3.1.3.mcpb below and install via Claude Code or Claude Desktop.
PyPI:
pip install --upgrade mcp-apple-mailv3.1.1
What's Changed
- fix: Update remaining PyPI package name reference in README
- chore: Remove stale artifacts, fix pyproject.toml for plugin/ layout
- chore: Add mcp-name verification string for official MCP Registry
- chore: Add server.json for MCP Registry schema validation
Full Changelog: v3.1.0...v3.1.1