iCloud MCP

io.github.MrGo2由 GitHub 帳號 MrGo2 發布v2.2.2更新於 Nov 4, 2026

Apple Mail, Calendar, Contacts, Reminders, Notes, Messages and Safari via AppleScript or iCloud

概覽

AI 產生的概覽

讓助理存取 Apple 郵件、行事曆、聯絡人、提醒事項、備忘錄、訊息與 Safari,可透過 macOS 應用程式或 iCloud 協定兩種方式。

可以做什麼
  • 讀取、搜尋、寄送郵件並標示已讀,列出郵件資料夾
  • 列出、建立、更新和刪除行事曆活動與行事曆
  • 列出、搜尋、讀取、建立和刪除聯絡人,以及聯絡人帳號與群組
  • 管理提醒事項:清單、建立、更新、完成、刪除與搜尋
  • 列出、讀取、建立和搜尋備忘錄及備忘錄資料夾
  • 列出對話、讀取並傳送 iMessage/SMS,送出點按回應
適用情境
適合讓助理直接操作使用者 Mac 上的 Apple 資料,例如整理郵件、安排行程、查詢聯絡人、勾選提醒事項、檢索備忘錄或閱讀訊息,而不必把資料複製到別處。雲端模式可讓非 Mac 電腦使用郵件、行事曆和聯絡人功能。
執行需求
需要 Node.js 20 或更新版本,以 stdio 在本機執行。本機模式(預設)需要 macOS 及相關應用程式、macOS 自動化、行事曆和聯絡人權限;讀取訊息還需 imsg 命令列工具與完全磁碟存取權。雲端模式需要 USE_LOCAL_MODE=false、ICLOUD_EMAIL 和 ICLOUD_APP_PASSWORD(來自已開啟雙重認證帳號的 App 專用密碼)。
安裝前請注意
雲端模式需要 ICLOUD_APP_PASSWORD 中的 App 專用密碼,一旦外洩應立即撤銷。寄送郵件、訊息及回應無法收回,沒有草稿步驟。刪除活動、聯絡人和提醒事項無法復原;本機模式下更新或刪除重複性活動會影響整個系列。本機模式等於讓助理控制 Mac 上的郵件、行事曆、聯絡人、訊息和 Safari。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 iCloud MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[icloud-mcp banner: Mail, Calendar, Contacts, Reminders, Notes, Messages and Safari for your AI assistant] [Claude creating a note, a reminder and a calendar event through icloud-mcp]

icloud-mcp covers seven Apple services with two interchangeable backends, and as far as we know it is the only MCP server that does. In local mode it drives the native macOS apps through AppleScript: no credentials, no network, and it reaches the services the iCloud protocols do not expose (Reminders, Notes, Messages, Safari). In cloud mode it speaks IMAP/SMTP, CalDAV and CardDAV instead, so it runs on any machine, not just a Mac. The set-mode tool switches between the two at runtime, without a restart.

[Install with NPX in VS Code] [Install in Cursor]

Features

The server exposes 41 tools across Email, Calendar, Contacts, Reminders, Notes, Messages and Safari. Each tool carries a typed schema, a human title and behavioural annotations, and every list-* tool returns machine-readable structuredContent alongside its text output. Local mode needs no passwords at all; macOS privacy permissions take their place: Automation for the apps, plus one-time Calendars and Contacts prompts for list-events and the contact account/group tools, and Full Disk Access for reading messages.

Access and security model

The server speaks JSON-RPC over stdin/stdout only. It opens no ports and listens on no socket.

Credentials are never logged. ICLOUD_APP_PASSWORD is read once at startup and handed only to the IMAP/SMTP/CalDAV/CardDAV clients; diagnostics print a fixed mask, never the value. Where you keep the password is up to you: a .env file beside the module for a manual install, or the .mcpb bundle's sensitive field, which the host stores in the macOS Keychain. Local mode has no password anywhere, since macOS gates access per app through its own Automation prompts, and you can revoke those at any time.

Every tool argument is validated against a zod schema before the handler runs. Arguments are also coerced at each AppleScript interpolation site, so a value that is not a number cannot reach a script template.

Privacy Policy

The server collects nothing and keeps nothing: no telemetry, no analytics, no state on disk. Your data moves only between your machine, the AI client you connect and Apple's services. The full policy, covering collection, storage, third-party sharing, retention and contact, is in PRIVACY.md.

Tools

Tools marked local only return an error in cloud mode, because the iCloud protocols do not expose those services.

Authentication

  • about
    • Returns information about this server, the active mode and whether credentials are configured
    • No input
  • check-auth-status
    • Verifies credentials are usable for the active mode
    • No input
  • set-mode
    • Switches between local and cloud without restarting
    • Input: mode (string, local or cloud)

Email

  • list-emails: folder (string, optional), count (number, optional, max 50)
  • read-email: uid (string), folder (string, optional)
  • send-email: to, subject, body (strings); cc, bcc (strings, optional); isHtml (boolean, optional, cloud mode only)
  • search-emails: query, from, subject, folder (strings, optional), unreadOnly (boolean, optional), count (number, optional)
  • mark-as-read: uid (string), folder (string, optional), isRead (boolean, optional)
  • list-folders: no input

Calendar

  • list-events: count (number, optional, max 50), daysAhead (number, optional)
  • create-event: summary, start, end (strings, ISO 8601); description, location (optional); calendarUrl (cloud) or calendarName (local)
  • update-event: eventUrl (string); any of summary, start, end, description, location. Only the fields you pass change
  • delete-event: eventUrl (string)
  • list-calendars: no input

Contacts

  • list-contacts: count (number, optional, max 50)
  • search-contacts: query (string), count (number, optional). Matches name, organisation, email and phone; phone matching ignores formatting
  • read-contact: contactUrl (string)
  • create-contact: displayName, firstName, lastName, email, phone, organization, title, notes (all optional)
  • delete-contact: contactUrl (string)
  • list-contact-accounts: no input (local only). Returns each account's id, name, type (cardDAV, exchange, local) and groupCount
  • list-contact-groups: accountId (string, optional) (local only)

Reminders (local only)

  • list-reminder-lists: no input
  • list-reminders: listName (string, optional), includeCompleted (boolean, optional), count (number, optional)
  • create-reminder: name (string); body, dueDate, listName (optional); priority (number 0-9, optional)
  • update-reminder: reminderId (string); any of name, body, dueDate, priority
  • complete-reminder: reminderId (string), completed (boolean, optional)
  • delete-reminder: reminderId (string)
  • search-reminders: query (string), count (number, optional)

Notes (local only)

  • list-note-folders: no input
  • list-notes: folderName (string, optional), count (number, optional)
  • read-note: noteId (string)
  • create-note: title (string), body (string, optional), folderName (string, optional)
  • search-notes: query (string), count (number, optional)

Messages (local only)

Reading requires the imsg CLI and Full Disk Access.

  • list-chats: limit (number, optional, max 1000), since (ISO 8601, optional — only chats active since that date, e.g. a weekly review)
  • read-messages: chatId (number); limit (number, optional); start, end (ISO 8601, optional); attachments (boolean, optional)
  • send-message: to (string), body (string), file (string, optional)
  • react-message: chatId (number), type (love, like, dislike, laugh, emphasis, question)

Safari (local only)

  • list-safari-tabs: no input
  • get-current-safari-url: no input
  • open-safari-url: url (string), inNewWindow (boolean, optional)
  • close-safari-tab: windowIndex (number, optional), tabIndex (number, optional)

Tool annotations (MCP hints)

Every tool declares its behaviour explicitly instead of relying on the spec defaults, which are deliberately pessimistic. All list-*, read-*, search-* and get-* tools, plus about and check-auth-status, are marked read-only. Nine tools carry destructiveHint: the four deletions (delete-event, delete-contact, delete-reminder, close-safari-tab), the three that reach another person irrevocably (send-email, send-message, react-message) and the two in-place updates (update-event, update-reminder). Tools that reach the network or another person carry openWorldHint: all Email and Calendar tools, send-message, react-message and open-safari-url. The read-only tools plus mark-as-read, complete-reminder, update-reminder, update-event and set-mode are marked idempotent.

Installation

Requires Node.js 20 or newer.

Let your AI install it

Paste this into Claude, Claude Code, Cursor, ChatGPT or any agent with shell or config access:

Install the iCloud MCP server. It is the npm package "mcp-icloud" (Node 20+),stdio transport, server name "icloud", command "npx" with args ["-y", "mcp-icloud"].On Claude Code run: claude mcp add --transport stdio icloud -- npx -y mcp-icloudFor other clients, add that command/args pair to the client's MCP config file.Local mode (default) needs macOS; cloud mode needs env vars USE_LOCAL_MODE=false,ICLOUD_EMAIL and ICLOUD_APP_PASSWORD (app-specific password from account.apple.com).Docs: https://github.com/MrGo2/icloud-mcp

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "icloud": {      "command": "npx",      "args": ["-y", "mcp-icloud"]    }  }}

For cloud mode, add credentials:

json
{  "mcpServers": {    "icloud": {      "command": "npx",      "args": ["-y", "mcp-icloud"],      "env": {        "USE_LOCAL_MODE": "false",        "ICLOUD_EMAIL": "[email protected]",        "ICLOUD_APP_PASSWORD": "xxxx-xxxx-xxxx-xxxx"      }    }  }}

Claude Code

bash
claude mcp add --transport stdio icloud -- npx -y mcp-icloud

VS Code

Use the badge at the top of this README, or add the same command/args pair to your MCP settings.

Desktop extension (.mcpb)

Download the .mcpb from Releases and open it to sideload. The bundle prompts for the mode and, for cloud mode, stores the app-specific password in the macOS Keychain rather than a file.

Permissions and troubleshooting

macOS Automation prompts (local mode)

The first time a tool touches an app, macOS asks whether the calling program may control it. This happens once per app, not once per tool. Approve the prompt, or grant it later under System Settings → Privacy & Security → Automation.

If you dismissed a prompt, calls to that app fail with an authorisation error (osascript error -1743, "not authorized to send Apple events"). macOS will not ask again on its own. Re-enable the checkbox under Automation, or reset the decisions:

bash
tccutil reset AppleEvents

That clears Automation permissions for every app, so expect the prompts to return on next use.

Contacts access (accounts and groups)

list-contact-accounts and list-contact-groups read accounts and groups through the macOS Contacts framework, because Contacts.app's scripting interface has no notion of accounts. The first call asks the program that launches the server for access to your contacts. Approve it once, or grant it later under System Settings → Privacy & Security → Contacts.

Full Disk Access (reading messages)

list-chats and read-messages read the Messages database through the imsg CLI, which is gated by Full Disk Access, not Automation. Grant it to the program that launches the server (Claude Desktop, your terminal, or your editor) under System Settings → Privacy & Security → Full Disk Access. Without it, those tools report that Full Disk Access is required.

If imsg is installed somewhere unusual, point at it explicitly:

bash
export ICLOUD_MCP_IMSG_PATH=/opt/homebrew/bin/imsg

The server otherwise looks in ICLOUD_MCP_IMSG_PATH, IMSG_PATH, both Homebrew prefixes, and finally PATH.

Known limitation: large mailboxes

Mail.app tools iterate messages through AppleScript, which is slow on very large mailboxes and can exceed the Apple Event timeout before returning. Narrow the request with folder and a smaller count, or use cloud mode, where IMAP does the filtering server-side. This is a property of the AppleScript bridge, not something the server can work around.

Calendar access (local mode)

list-events in local mode no longer scripts Calendar.app when it can avoid it. It reads the date window straight from EventKit, the macOS calendar store, in one query that returns in about a tenth of a second even with dozens of subscribed calendars. EventKit needs its own permission, separate from Automation: the first list-events call asks the program that launches the server (Claude Desktop, your terminal, or your editor) for access to your calendars. Approve it once, or grant it later under System Settings → Privacy & Security → Calendars.

If that access is denied, restricted or left unanswered, list-events falls back to the old Calendar.app query and logs EventKit unavailable on stderr. That path still filters the window inside Calendar.app with a whose query, but on accounts with many calendars, especially subscribed ones carrying years of events (holidays, sports fixtures, travel feeds), it can exceed any reasonable timeout. In that case grant Calendars access, or use cloud mode, where CalDAV filters server-side (see #11).

Through EventKit, a recurring event appears once per occurrence in the window, and every occurrence carries the series id. Passing that id to update-event or delete-event in local mode changes or deletes the whole series.

App-specific password (cloud mode)

Cloud mode needs an app-specific password. Your normal Apple ID password will not work, and Apple only issues app-specific passwords on accounts with two-factor authentication turned on.

  1. Sign in at appleid.apple.com.
  2. Go to Sign-In and Security → App-Specific Passwords.
  3. Generate one and name it, for example, "iCloud MCP".
  4. Put it in ICLOUD_APP_PASSWORD, together with ICLOUD_EMAIL.

Revoke it from the same page if it is ever exposed.

Checking what the server thinks

Call about for the active mode and service list, and check-auth-status to confirm credentials are usable in the current mode.

Requirements

  • Node.js 20 or newer
  • Local mode: macOS with the relevant apps installed, plus imsg and Full Disk Access if you want to read messages
  • Cloud mode: any OS, an iCloud account with two-factor authentication, and an app-specific password. Covers Email, Calendar and Contacts only

Configuration

VariableDefaultPurpose
USE_LOCAL_MODEtruefalse selects cloud mode
ICLOUD_EMAIL(unset)iCloud address, cloud mode only
ICLOUD_APP_PASSWORD(unset)App-specific password, cloud mode only
ICLOUD_MCP_IMSG_PATH(unset)Explicit path to the imsg binary

Read from the environment, or from a .env file beside the module. See .env.example.

Development

pnpm is the supported package manager; pnpm-lock.yaml is the committed lockfile.

bash
pnpm installpnpm test          # unit + contract suites, and a live stdio sessionpnpm run inspect   # drive the server with the MCP Inspector

The test suites stub osascript and the imsg CLI, so they touch no real mail, calendar or message data. They need macOS, because local mode refuses to start elsewhere; CI runs them on a macOS runner.

License

MIT. See LICENSE.

來源:README.md,提交 ffb5c0c

工具

41

about

About This Server

Returns information about this iCloud MCP server

無需輸入參數。

check-auth-status

Check Auth Status

Check if iCloud credentials are configured correctly

無需輸入參數。

set-mode

Switch Mode

Switch between LOCAL (AppleScript/macOS apps) and CLOUD (iCloud protocols) modes

輸入參數mode必填

list-emails

List Emails

Lists emails from a folder (default: inbox)

輸入參數countfolder

read-email

Read Email

Reads the full content of an email by UID

輸入參數uid必填folder

send-email

Send Email

Sends an email immediately from the user's account to one or more comma-separated recipients, with optional CC, BCC and HTML body. Cloud mode delivers over SMTP and returns the new message ID; local mode sends through Mail.app, which only sends plain text and returns no ID. There is no draft step, so the message goes out as soon as the tool runs.

輸入參數ccto必填bccbody必填isHtmlsubject必填

search-emails

Search Emails

Searches one mail folder (inbox by default) by free text, sender, subject and unread state; the filters combine as AND. Results carry the same summary fields as list-emails, including the ref handle that read-email and mark-as-read take.

輸入參數fromcountqueryfoldersubjectunreadOnly

mark-as-read

Mark Email Read/Unread

Marks an email as read or unread

輸入參數uid必填folderisRead

list-folders

List Mail Folders

Lists all email folders

無需輸入參數。

list-events

List Events

Lists upcoming calendar events within a look-ahead window (30 days by default, up to 365). Each event carries its title, start and end times, and the ref handle that update-event and delete-event take as their eventUrl argument.

輸入參數countdaysAhead

create-event

Create Event

Creates a new calendar event

輸入參數end必填start必填summary必填locationcalendarUrldescriptioncalendarName

update-event

Update Event

Updates an existing calendar event. Only the fields you pass are changed. In cloud mode the CalDAV property-merge preserves recurrence, invitees and alarms (experimental: the live round-trip is not yet verified). In local mode, every occurrence of a recurring event shares the series UID, so this acts on the whole series, not one occurrence.

輸入參數endstartsummaryeventUrl必填locationdescription

delete-event

Delete Event

Deletes a calendar event. In local mode, every occurrence of a recurring event shares the series UID, so this acts on the whole series, not one occurrence.

輸入參數eventUrl必填

list-calendars

List Calendars

Lists all available calendars

無需輸入參數。

list-contacts

List Contacts

Lists contacts from the user's address book, up to 50 per call, including the handle that read-contact and delete-contact take. For a targeted lookup, search-contacts filters by name, email or phone instead of paging through the full list.

輸入參數count

search-contacts

Search Contacts

Search contacts by name, email, or phone

輸入參數countquery必填

read-contact

Read Contact

Get detailed information about a specific contact

輸入參數contactUrl必填

create-contact

Create Contact

Creates a contact in the user's address book (Contacts.app in local mode, iCloud over CardDAV in cloud mode). Every field is optional, so pass at least a name (displayName, or firstName and lastName) along with any known email, phone, organization, job title or notes.

輸入參數emailnotesphonetitlelastNamefirstNamedisplayNameorganization

delete-contact

Delete Contact

Permanently deletes a contact from the user's address book. Takes the handle returned by list-contacts or search-contacts; there is no undo through this server.

輸入參數contactUrl必填

list-contact-accounts

List Contact Accounts

Lists all contact accounts (iCloud, Google, Exchange, etc.) - LOCAL mode only

無需輸入參數。

list-contact-groups

List Contact Groups

Lists contact groups from all accounts or a specific account - LOCAL mode only

輸入參數accountId

list-reminder-lists

List Reminder Lists

Lists all reminder lists from Reminders.app (LOCAL mode only)

無需輸入參數。

list-reminders

List Reminders

Lists reminders from a specific list or all lists (LOCAL mode only)

輸入參數countlistNameincludeCompleted

create-reminder

Create Reminder

Creates a new reminder (LOCAL mode only)

輸入參數bodyname必填dueDatelistNamepriority

update-reminder

Update Reminder

Updates an existing reminder (LOCAL mode only)

輸入參數bodynamedueDatepriorityreminderId必填

complete-reminder

Complete Reminder

Marks a reminder as complete or incomplete (LOCAL mode only)

輸入參數completedreminderId必填

delete-reminder

Delete Reminder

Deletes a reminder (LOCAL mode only)

輸入參數reminderId必填

search-reminders

Search Reminders

Search reminders by text in name or body (LOCAL mode only)

輸入參數countquery必填

list-note-folders

List Note Folders

Lists all folders in Notes.app (LOCAL mode only)

無需輸入參數。

list-notes

List Notes

Lists notes from a specific folder or all folders

輸入參數countfolderName

read-note

Read Note

Reads the content of a specific note

輸入參數noteId必填

create-note

Create Note

Creates a new note

輸入參數bodytitle必填folderName

search-notes

Search Notes

Search notes by text in title or content

輸入參數countquery必填

list-chats

List Chats

List recent iMessage/SMS conversations, most recent first. Use `since` to get only the conversations active after a date (e.g. the last 7 days).

輸入參數limitsince

read-messages

Read Messages

Read message history for a specific iMessage/SMS conversation

輸入參數endlimitstartchatId必填attachments

send-message

Send Message

Sends an iMessage or SMS to a phone number or email handle, with an optional file attachment. The message is delivered as soon as the tool runs; there is no draft step and no recall.

輸入參數to必填body必填file

react-message

React To Message

Send a tapback reaction (love, like, dislike, laugh, emphasis, question)

輸入參數type必填chatId必填

list-safari-tabs

List Safari Tabs

Lists all open tabs in Safari across all windows

無需輸入參數。

get-current-safari-url

Get Current Safari URL

Gets the URL and title of the current/active Safari tab

無需輸入參數。

open-safari-url

Open URL In Safari

Opens a URL in Safari (new tab or new window)

輸入參數url必填inNewWindow

close-safari-tab

Close Safari Tab

Closes a Safari tab

輸入參數tabIndexwindowIndex

版本歷史

3
  1. v2.2.2最新Nov 4, 2026
  2. v2.1.5Nov 4, 2026
  3. v2.1.3Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分