Cupertino

Cupertino

Provides MCP servers to interact with Apple's Mail, Notes, Reminders, and Calendar apps on macOS, enabling search, read, and write operations with configurable permissions and a single Full Disk Access grant.

Category
访问服务器

README

<p align="center"> <img src="design/cupertino-lockup.svg" alt="Cupertino" width="560"> </p>

Cupertino

Put your agent to work in your everyday Apple apps.

MCP servers for the Apple apps already on your Mac, and the signed app that grants them their permissions once instead of once each — for any agent that speaks MCP, not for one host.

Unofficial. Not affiliated with Apple. These drive the apps that are already on your Mac.

In use

Look at how I write in my work inbox, then draft this reply in the same voice.

Pull together everything about the Atlas launch from my mail, my notes and my calendar. What do I still owe people?

Turn the action items from yesterday's client thread into reminders, due Friday.

Every one of those carries a constraint — an account, a date bound, a filter. That is the part the naive osascript path answers in 74 seconds or answers wrongly, and the reason a server earns its place: it holds what the model would otherwise re-derive every session. The measurements are in docs/verify.md; what the alternatives cost is in docs/alternatives.md.

The last one needs the write gate open on Reminders. Writes are off per surface until you turn them on, and the toggle decides whether the mutating tools are registered at all — an agent with writes off cannot see that they exist.

Surfaces

Surface Package Status
Mail packages/mail implemented — 18 tools, search/read/attachments + gated writes
Notes packages/notes implemented — 12 tools, search/read/attachments + gated writes
Reminders packages/reminders implemented — 11 tools, lists/search/dates + gated writes
Calendar packages/calendar implemented — 9 tools, ranges/search/recurrence + gated writes
Contacts packages/contacts implemented — 7 tools, resolves handles to names + gated writes
Messages packages/messages implemented — 6 tools, chats/search/decoded text + gated send
Safari packages/safari implemented — 6 tools, history/tabs/reading list, read-only
packages/core shared: the osascript boundary, TCC-aware errors, ro SQLite

Each surface is its own server and its own npm package, so a host loads only the tools it wants. They share one bundle and one Full Disk Access grant, which is the whole reason they live together — see docs/distribution.md.

Quick start

Each server is on npm and runs straight from npx — for Claude Code, a .mcp.json beside your project:

{
  "mcpServers": {
    "apple-mail": {
      "command": "npx",
      "args": ["-y", "@mgcrea/mcp-apple-mail"]
    },
    "apple-notes": {
      "command": "npx",
      "args": ["-y", "@mgcrea/mcp-apple-notes"]
    }
  }
}

The packages are MIT and need no licence key. What they do need is a permission, and on npm you grant it to whatever launches them — your editor, your terminal — which is the trade the signed Cupertino.app exists to avoid: one Full Disk Access grant held by a notarized binary, instead of one per host. See docs/licensing.md.

Or run them from source:

git clone https://github.com/mgcrea/mcp-cupertino.git
cd mcp-cupertino
pnpm install
pnpm build

then point your host at packages/<surface>/dist/cli.js by absolute path.

Writes are off unless you ask for them — see Configuration.

Running through the menu bar app instead routes every server through the bridge, so Full Disk Access is granted to Cupertino rather than to whichever editor spawned the server:

make run      # build Cupertino.app, point it at packages/*/dist, launch it
make smoke    # handshake every server through the bridge

The repo's checked-in .mcp.json is wired for that path. make on its own lists every target.

Note the different server names. Wired by hand as above, a server is apple-mail and runs under whatever grant its host process has. Wired by Cupertino it is cupertino-mail, because that entry points at the app's bridge and runs under the app's grant. Two names for two deployments, and you can have both. The app only ever touches its own cupertino-* keys — an apple-mail entry belonging to some other server is left alone.

Cupertino is machine configuration, not a project dependency, so it belongs in a per-user config: one file each for Claude Desktop, Cursor, LM Studio and Windsurf, and --scope user for the CLIs, which is what the app's copyable commands use. Deliberately not --scope project, which writes an .mcp.json meant to be committed — that entry is an absolute path into a bundle on one Mac, backed by one person's Full Disk Access grant, and it would be useless to a teammate and unwise to offer them.

Which clients get written and which get a command is not about popularity. The app merges into a config only when it is strict JSON with servers under mcpServers; Visual Studio Code's is JSONC and Codex's is TOML, and re-serialising either would delete the comments in a file maintained by hand. Claude Code's ~/.claude.json is strict JSON, but it holds credentials and running sessions write to it concurrently, so a read-modify-write from a menu bar could drop somebody else's change. Those three get a line to paste. ChatGPT is absent entirely: it takes remote HTTP connectors and cannot spawn a local stdio server at all.

This repo's own .mcp.json is the exception, and it names its servers cupertino-*-dev on purpose: it points at apps/apple/.build, so working on the app means having the development build and the installed one side by side. Claude Code reports servers of the same name in two scopes as a conflict rather than picking one, so the suffix is what keeps both usable.

Cupertino.app needs macOS 26 or later — its icon is an Icon Composer bundle, which nothing older can render. The servers themselves are plain Node and carry no such floor; only the menu bar app does.

Permissions

Two separate macOS grants, and they land on whatever process launched the server — your editor, your terminal, or Cupertino — never on Mail, Notes or Reminders themselves.

Grant Needed for
Full Disk Access the index lane: Mail search, attachment bytes
Automation (per target app, prompted) the Apple Events lane: accounts, mailboxes, all writes
Contacts (prompted) the Contacts surface — its store is not behind Full Disk Access

System Settings → Privacy & Security → Full Disk Access → add the launching app, then restart it. Granting it to Mail.app does nothing; the reader needs the permission, not Mail.

What works without Full Disk Access:

Surface Without the grant
Mail accounts, mailboxes and writes only — search falls back to Apple Events at ~74 s
Notes fully usable below roughly 5k notes; only attachment bytes need the grant
Reminders usable, but all-day dates and subtasks need the store — the container cannot even be listed without it
Calendar nothing. The only surface with no Apple Events read path fast enough to be a fallback — one 90-day range query costs 3.4 s — so every read needs the grant. Writes still work.
Contacts nothing — but it does not want Full Disk Access. Its store sits behind the separate Contacts permission, which macOS prompts for rather than making you find a settings pane. Writes need Automation on top.
Messages nothing at all. No Apple Events read path exists — Messages answers "Application isn't running" even while running — so there is no second lane and no degraded mode. A send can still be attempted, but with no store to pick the target from or reconcile against, it usually cannot be addressed at all.
Safari live tabs, and only those. The one surface whose lanes are not fallbacks for each other: Apple Events sees what is open now, the file lane sees everything else. History, bookmarks and the Reading List all need the grant.

Tools that need the index don't disappear when it's missing — the tool list is a pure function of allowWrites and nothing else, because MCP clients cache it. They return a structured degraded result naming what's absent. apple_mail_diagnostics / apple_notes_diagnostics report which lane is live and how to grant what's missing.

Tools

Read tools are always registered. Write tools are invisible unless writes are enabled — not merely refused.

Mail

Always available Write-gated
search_messages list_messages count_messages get_thread set_message_flags move_messages delete_messages check_for_new_mail
get_message get_message_source list_attachments send_message reply_to_message forward_message
list_accounts list_mailboxes diagnostics save_attachment

Notes

Always available Write-gated
list_notes search_notes get_note list_attachments create_note update_note move_note delete_notes save_attachment
list_accounts list_folders diagnostics

Reminders

Always available Write-gated
list_reminders search_reminders get_reminder list_lists create_reminder update_reminder complete_reminders move_reminders delete_reminders
list_accounts diagnostics

Calendar

Always available Write-gated
list_events search_events get_event list_calendars create_event update_event delete_events
list_accounts diagnostics

list_events expands repeating events, so a weekly standup is returned once per week. Every result carries the window the expansion is known to cover, and sets truncated when a range runs past it rather than coming back short — a short list of events is indistinguishable from a free afternoon.

Contacts

Always available Write-gated
resolve_handles search_contacts list_contacts get_contact create_contact update_contact
diagnostics

resolve_handles turns phone numbers and email addresses into names, which is what makes the Messages surface readable at all. Read status on each result rather than assuming a name came back: unknown is common and not an error, and ambiguous means two contacts share the number, so no name is returned rather than a guess.

There is no delete tool. Contacts' scripting dictionary has no delete command of any kind, and writes go through Apple Events on every surface here because the store is read-only by policy. See docs/contacts.md.

Messages

Always available Write-gated
list_chats list_messages search_messages send_message
get_message diagnostics

One write tool, because the dictionary has one usable command. sdef lists send, login and logout; the other two would sign the user out of iMessage on every device they own. There is no edit, delete, mark-as-read or reaction verb to expose.

This is the only surface where Apple Events is a write lane and nothing else — every read through it fails, so with APPLE_MESSAGES_ALLOW_WRITES off no Apple Event is ever sent and no Automation grant is ever requested.

send_message prefers a chatRef from list_chats over a raw handle, because Messages refuses to enumerate participants for a script: an existing conversation is the only target that can be addressed reliably. Apple Events hands back no identifier for what it sent, so the result is reconciled against chat.dbreconciliation: "matched" carries a real message ref, and "pending" means Messages accepted the send but has not written the row yet. Pending is not a failure, and retrying it sends the message twice.

About 3% of messages across all history keep their text only in an archived NSArchiver blob that SQL cannot reach — and Apple stopped writing the plain column in early 2026, so for anything recent it is ~100%. This server decodes them; textSource on every result says which lane answered. See docs/messages.md.

Safari

Always available Write-gated
search_history get_page list_tabs — none
list_bookmarks list_reading_list diagnostics

Read-only, and the write column is empty on purpose. Opening a URL or adding to the Reading List is an Apple Event that navigates a real, visible browser, and no write on this surface was ever probed.

list_tabs is the only tool in the whole bundle that works without Full Disk Access — it needs an Automation grant instead, and Safari has to be running. A tab's history field being null means not found in history, never "never visited": only about 55% of open tabs match a history row, because redirects, session parameters and pages never committed to history all produce a URL that is simply not there.

There is no do JavaScript tool. That verb needs "Allow JavaScript from Apple Events", a Safari developer-menu toggle which is not a TCC grant and whose own state cannot be read reliably. Shipping it would mean reporting a healthy surface whose most powerful capability silently fails. See docs/safari.md.

All names are prefixed apple_mail_ / apple_notes_ / apple_reminders_ / apple_calendar_ / apple_contacts_ / apple_messages_ / apple_safari_.

Configuration

Environment only — these servers hold no secret of their own, so there is no config file. Prefix is APPLE_MAIL_, APPLE_NOTES_, APPLE_REMINDERS_, APPLE_CALENDAR_, APPLE_CONTACTS_, APPLE_MESSAGES_ or APPLE_SAFARI_.

Variable Default What
*_ALLOW_WRITES false register the mutating tools at all
*_ACCOUNTS all account allowlist (names or UUIDs) — the read-side control
*_ATTACHMENT_DIR ~/Downloads the only directory attachments may be written into
*_MAX_RESULTS 200 cap on any listing
*_INDEX_MODE auto auto | ro | immutable | off
*_OSASCRIPT_TIMEOUT_MS 30000 per-Apple-Events-call timeout
*_DEBUG false verbose logging to stderr

allowWrites gates mutation, but on Mail the larger blast radius is reading an entire archive — that is what *_ACCOUNTS is for, and it is enforced in exactly one place so no query path escapes it. Mail also takes *_ROOT, *_ENVELOPE_INDEX, *_DEGRADED_MAX_MESSAGES, *_BODY_MAX_BYTES, *_BODY_SCAN_MAX, *_BODY_SCAN_BYTES and *_MAILBOX_CACHE_TTL_MS; see packages/mail/src/config.ts.

The app

The menu bar is Cupertino's whole surface — there is no Dock icon and no main window.

Section What it answers
Full Disk Access granted or not, with the button that opens the right Settings pane
One pane per surface Automation status per app, the consent prompt, and the writes toggle
Connections which client is talking to which server right now, and how many tools it has called
MCP clients one-click wiring for Claude Desktop, Cursor, LM Studio and Windsurf; a copyable command for Claude Code, VS Code and Codex
Activity… opens a window listing every tool call, live

The Activity window records tool names only — never arguments, message contents or results. It is the answer to "what did the assistant just do with my mail?", and the reason the servers run under an app you can see rather than inside whichever editor spawned them.

Writes are off per surface until you turn them on, and the toggle decides whether the mutating tools are registered at all — an assistant with writes off cannot see that they exist.

Why a single app

Full Disk Access is one indivisible whole-disk grant. Granting it per surface buys no containment and costs a System Settings trip each time, so every surface ships inside one signed, notarized app called Cupertino. docs/distribution.md also records why the Mac App Store cannot host any of this, so the question does not get re-opened.

But the grant is not the only thing the app holds, and it is not the only reason to run the servers under it rather than under an editor:

The grant lands on Cupertino not on whichever editor spawned the server, and with it every extension and task that editor runs
A visible audit trail the Activity window lists every tool call, live; a server inside an editor is unobservable
Writes are off, per surface and the toggle decides whether the mutating tools are registered at all
*_ACCOUNTS bounds reading the blast radius on Mail is the archive, not the mutations
Results say how much to trust them indexAgeSeconds, a WAL-blind warning, and a structured degraded result rather than a vanished tool
Four surfaces, one grant which is the actual payoff of the indivisibility above

docs/alternatives.md is the honest version of that list: what else reads Apple Mail for an assistant, and where those tools are ahead.

Documentation

docs/distribution.md how this ships, and why not the App Store
docs/surfaces.md which surfaces, and what each one costs
docs/licensing.md what is open, what is sold, what buys trust
docs/alternatives.md what else reads Apple Mail, and where we lose
docs/mail-body.md the body-search lane, and how it is decided
docs/notes.md Apple Notes phase-0 measurements
docs/reminders.md Apple Reminders phase-0 measurements
docs/messages.md Apple Messages: measurements, decoder, send
docs/calendar.md Apple Calendar phase-0 measurements
docs/safari.md Safari phase-0 measurements
docs/envelope-index.md Mail's observed Envelope Index schema
docs/verify.md checking the Mail server against a real index

Working on it

pnpm build          # every package
pnpm test           # every package
pnpm typecheck
pnpm lint
pnpm format

The marketing site is its own workspace, and deploys by hand:

pnpm --filter @mgcrea/cupertino-website dev     # astro dev
pnpm --filter @mgcrea/cupertino-website build   # static build

It is built from the design canvas in .idea/design/, and reads its tool counts from packages/*/src/tools/ rather than from this file — see apps/website.

The Swift half is xcodebuild, named by the Makefile rather than wrapped by it:

make app            # build Cupertino.app (Debug)
make run            # build, point at packages/*/dist, launch
make smoke          # handshake every server through the bridge
make stop           # quit and remove the socket

The app's screenshots are captured rather than taken by hand — apps/apple/Screenshots/ holds the config and the committed goldens, and the website renders the output:

make screenshots          # capture, gate against the goldens, compose both sets
make screenshots-check     # gate only — fails if the UI drifted
make screenshots-update    # accept the captures as the new goldens (review the diffs first)
make screenshots-selftest  # prove the gate fails when it should

A run takes over the pointer and the active app at the moment of each shot, so do not use the machine while it runs. It needs Screen Recording permission for the terminal, never for Cupertino itself. make screenshots-doctor checks that and the two other things that otherwise fail silently: whether the caption font resolves, and whether the output size is one a store would accept.

What the screenshots show is fixture data from apps/apple/Cupertino/DemoSeed.swift, not this Mac: in -ScreenshotMode the app starts no host, seeds its own log and sessions, and answers the permission and store questions from a table. Without that the images would report one laptop's TCC state and print its home directory into the marketing site.

Phase-0 probes are repo-wide and read-only. They need the permission of the surface they measure, and redact their output to counts, timings and DDL:

pnpm probe:mail      # Envelope Index — needs Full Disk Access
pnpm probe:mail-body # which lane can search message bodies — needs Full Disk Access
pnpm probe:notes     # Notes — the Apple Events half runs without it
pnpm probe:reminders # Reminders — the store path is a glob, so finding it is itself privileged
pnpm probe:messages  # chat.db — no Apple Events read lane exists, so this one needs the grant
                     #   --send-target=<handle> also checks the send lane's targeting, without sending
pnpm probe:calendar  # settles whether Calendar has a file lane at all
pnpm probe:safari    # History.db, and the Reading List hiding inside Bookmarks.plist
pnpm probe:contacts  # the resolver Messages needs — its own TCC grant, not Full Disk Access

Every probed surface now has a package. Safari is read-only — it registers no mutating tool, and that is a recorded decision rather than an omission: opening a URL or adding to the Reading List navigates a real, visible browser and was never probed. See docs/safari.md. Messages registers exactly one write tool, send_message, which is the whole of what its scripting dictionary can do. Every probe degrades rather than exits — an app that is not running, or a permission that is not granted, is reported as a finding — and none of them launches an app unless you pass --launch. Their shared mechanism lives in scripts/lib/probe-kit.mjs.

Releases are tagged per package, so a tag names what it publishes: mail-v1.1.0, reminders-v1.1.0, calendar-v1.1.0, core-v1.1.0. The app is tagged app-v1.1.0 and releases on its own lane — a signed, notarized Cupertino.zip attached to the GitHub release, plus its SHA-256. See docs/distribution.md.

The repo is mcp-cupertino; the npm packages stay @mgcrea/mcp-apple-*, because that is what people search npm for. Neither name is load-bearing. The bundle identifier io.mgcrea.cupertino is the string that actually matters, because changing it would invalidate every user's Full Disk Access grant.

Licence

Two, because the halves are not the same thing.

Part Licence
packages/*, scripts/ MIT — libraries, vendor them freely
apps/apple/ source-available — read, audit, compile; binary redistribution reserved
the signed, notarized build sold, under the EULA shipped with it

Cupertino asks for Full Disk Access, so the source stays readable — that is what such a grant is owed, and reading it is the point. Running it is a separate question: the licence check lives in the source, so any build asks for a key, yours or ours. What is sold is the notarized binary and the maintenance behind it. The servers are MIT and run on their own with no key at all. The reasoning is in docs/licensing.md.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选