
Mailappmcp
io.github.aernouddekker由 GitHub 账号 aernouddekker 发布v0.4.1更新于 Oct 24, 2026
MCP server for macOS Mail.app — gives Claude native email access via AppleScript
概览
一个本地 macOS MCP 服务器,通过 AppleScript 让助手原生访问 Mail.app,可读取、搜索、撰写、发送和整理邮件。
- 可以做什么
- 列出账户、邮箱和签名,搜索或读取邮件,包括原始源码和附件,并可将附件保存到磁盘、从文本中解析邮箱地址。撰写草稿、发送邮件、回复、转发和重定向,支持纯文本或 HTML 正文及附件。整理邮件:移动、删除、标记已读或垃圾邮件、加旗标和设置颜色,并可触发单个或全部账户收信。
- 适用场景
- 适合让助手在 macOS Mail.app 已配置的账户中筛选、搜索并起草或发送邮件,无需 API 密钥或云服务。仅在已设置 Mail.app 的 Mac 上有意义。
- 运行要求
- 仅限 macOS(依赖 AppleScript,无法在 Linux 或 Windows 上运行),需要 Node.js 18+。通过 stdio 本地运行,可从 npm 安装 mailappmcp 或从源码构建。无需 API 密钥、OAuth 或云服务,使用 Mail.app 中已配置的账户。Mail.app 未运行时会在首次使用时自动启动。
安装
在 SourceWeft 中
- 打开 控制台中的 Mailappmcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
macos-mcp
MCP servers for macOS native apps — gives Claude Code, Claude Desktop, and any MCP client native access to Mail, Numbers, Contacts, Calendar, Reminders, and FaceTime / phone calls.
No API keys, no OAuth, no cloud services. Talks directly to macOS apps via AppleScript and URL schemes (tel://, facetime://). Runs locally on your Mac.
CUPS printing (
printmcp) used to live here; it moved to office-mcp since it's a shell wrapper, not an AppleScript bridge.
Servers
Mail (mailappmcp) — 21 tools
Works with every email account configured in Mail.app — iCloud, Gmail, Outlook, Fastmail, you name it.
Numbers (numbersmcp) — 29 tools
Works with any open Numbers spreadsheet.
Contacts (@aernoud/contactsmcp) — 15 tools
Works with the system address book — all accounts synced to Contacts.app.
Calendar (calendarmcp) — 25 tools
Works with every calendar configured in Calendar.app — iCloud, Google, Exchange, local, you name it.
Reminders (@aernoud/remindersmcp) — 22 tools
Works with every reminder list configured in Reminders.app — iCloud, Exchange, local, you name it.
FaceTime (facetimemcp) — 3 tools
Initiates calls by handing URL schemes to open. Phone calls require an iPhone paired via Continuity (so macOS can route them through your phone).
Phone numbers are normalized + validated as E.164 (+15551234567); spaces, dashes, and parens are tolerated. macOS may show a confirmation prompt before dialing — there is no fully silent dial path, by design.
Requirements
- macOS (uses AppleScript — won't work on Linux/Windows)
- Node.js 18+
Install
From npm
From source
Configure
Claude Code
Add to ~/.claude/settings.json or your project's .mcp.json:
Claude Desktop / Cowork
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
How it works
Each server runs locally over stdio. The Mail, Numbers, and Contacts servers build AppleScript strings, execute them via osascript, and parse the structured output back into JSON. The Print server shells out to CUPS (lp, lpstat, lpoptions, cancel); the FaceTime server hands tel:// / facetime:// URLs to open. A shared package (@mailappmcp/shared) provides the AppleScript runner, the generic command runner (runCommand), string escaping, and delimiter-based parsing.
App lifecycle — leave as found
Mail, Calendar, Contacts, and Reminders need their respective app running to respond to AppleScript. Rather than requiring you to keep those apps open, each server auto-launches them on first use and cleans up afterwards:
- On the first tool call that touches an app, the server checks (via
pgrep) whether the app is already running. If not, it launches it in the background (open -g -a) without stealing focus, and waits up to 5 seconds for the app to accept AppleEvents before running the tool. - That state is remembered in-process for the lifetime of the MCP server. Subsequent tool calls against the same app skip the probe and reuse the running app — no repeated launch penalty.
- On server shutdown (SIGTERM / SIGINT / SIGHUP / normal exit — e.g. when Claude Desktop disconnects the server or the chat ends), the server quits only the apps it launched. Apps you had open before the server started are left alone.
- Edge case: if the server is force-killed (
SIGKILL), the exit handler can't run, so any auto-launched apps stay running. Same as if you'd never had the server.
This means you can use the tools without worrying about a pile of half-launched apps lingering after the session, and without the servers killing apps you were actively using.
Safety
compose-messageopens a visible draft — you review before sendingsend-messageis a separate, explicit actionreply-to-messageandforward-messagedefault to draft mode (sendImmediately: false)delete-messagesmoves to Trash (standard Mail.app behavior)
HTML email
compose-message and send-message accept an optional htmlBody parameter. When supplied, the message is created as a rich-text/HTML message and the recipient sees rendered formatting (headings, bold, lists, clickable links) instead of raw tags. body is still required and is used as the plain-text fallback for clients that read plain content. Omit htmlBody for the existing plain-text behavior — fully backward compatible.
Under the hood, the HTML path for compose-message / send-message uses JXA (osascript -l JavaScript) and Mail.app's runtime htmlContent setter on outgoing messages. The plain-text path still uses ordinary AppleScript.
Branded replies that thread correctly
reply-to-message also accepts htmlBody, producing a reply that is both branded and correctly threaded. Mail's scripting model can't set arbitrary RFC headers, and an outgoing reply's rich-text editor isn't writable via the AppleScript content property — so neither tool alone could do both before. The reply tool now:
- invokes Mail's native
replyverb, which constructs the reply and populates theIn-Reply-To/Referencesheaders (these are message properties, independent of the body), then - puts the branded HTML on the pasteboard as
public.htmland pastes it (Cmd-V) above the auto-quoted thread.
The result renders the branding inline, keeps the quoted thread, and carries the threading headers strict clients (Outlook, Gmail web) require to nest the reply.
Constraints:
htmlBodyandattachmentscannot be combined on a reply (Mail re-parses the HTML during MIME multipart composition and corrupts the rendered body) — the tool returns an error if both are passed. Send the branded reply first, then attach files in a separate reply.- When
htmlBodyis supplied, the plain-textbodyis ignored; Mail derives the plain-text MIME alternative from the pasted rich text. - Pasting requires Mail to hold focus briefly; the script aborts safely (and restores your clipboard) if focus is lost.
Verifying an HTML / branded reply
After producing a branded reply, confirm both halves actually work:
- Render check — open the draft Mail created. The branding should appear as formatted rich text (headings, bold, links), not raw
<tags>, sitting above the quoted original. - Threading / header check — send the reply to a recipient on a strict client (Outlook or Gmail web) and confirm it nests inside the original conversation rather than appearing as a loose message. Equivalently, run
get-message-sourceon the sent reply and verify it carriesIn-Reply-To:andReferences:headers pointing at the original Message-ID. - Clipboard check — confirm your clipboard holds its prior contents afterwards (the tool saves and restores it around the paste).
- Attachment guard — calling
reply-to-messagewith bothhtmlBodyandattachmentsshould return a clear error, not a corrupted draft.
Known limitations
General
osascripthas a 30-second timeout per call- Apps are auto-launched on first use and quit on server shutdown if they weren't running beforehand — see App lifecycle
- For Mail tools taking
messageIdormessageIds, prefer the numeric stringidfromsearch-messages. RFCmessageIdvalues remain supported, but comparing them loads message headers across the mailbox and can leave Mail busy even after the 30-second timeout. Local IDs are specific to this Mac's Mail library; search again after moving a message or rebuilding the library. content containssearches in AppleScript can be slow on large mailboxes — Mail server searches subject and sender by default
Numbers
- Numbers tools require an open document
Calendar
These are limitations of Calendar.app's AppleScript interface itself, not the MCP server:
- Calendars cannot be deleted via AppleScript.
delete calendarraises-10000(AppleEvent handler failed) on every modern macOS version. Thedelete-calendartool checks that the calendar exists and then returns a descriptive error — you must remove calendars manually from the Calendar.app sidebar (right-click → Delete). - Calendars have no usable id/uid. Calendar.app's
calendarclass does not expose a stable id via AppleScript (uid ofraises-10000). All calendar tools therefore identify calendars by name — make sure your calendar names are unique. whosefilters are O(n) over events. AppleScript scans every event in a calendar to evaluatewhose start date ≥ Xpredicates. On a busy multi-calendar store, even an empty 7-day query across all calendars can take 60+ seconds and exceed the 30 sosascripttimeout. Always pass acalendarNametolist-events,search-events,today-events, andupcoming-eventswhen possible to scope the scan.search-eventsadditionally enforces a date window (default: −30 days to +365 days).move-eventreassigns the uid. Calendar.app cannot reparent an event between calendars. The tool deletes the source event and creates a new one in the target calendar; the new event has a fresh uid (returned asnewUidalongsideoldUid).- Recurrence is exposed as raw RRULE strings (e.g.
FREQ=WEEKLY;INTERVAL=1) — read and write only, no parsing or expansion.
License
MIT
来源:README.md,提交 7d81133
工具
0版本历史
1- v0.4.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分