
Icloud Mcp
io.github.eodozzy由 GitHub 帳號 eodozzy 發布v0.1.1更新於 Oct 24, 2026
Read-only-by-default MCP server for iCloud mail, calendar, and contacts (IMAP/CalDAV/CardDAV).
概覽
本機 MCP 伺服器,讓助理以唯讀方式存取 iCloud 郵件、行事曆與聯絡人,寫入操作須明確開啟並逐次確認。
- 可以做什麼
- 列出、搜尋並讀取郵件:資料夾、收件匣清單、全文搜尋、完整內文
- 依日期範圍列出與搜尋行事曆事件,並列出行事曆名稱
- 依姓名、組織或電子郵件列出與搜尋聯絡人
- 寄送、回覆與轉寄郵件(須開啟的寫入工具)
- 建立、更新與刪除事件及聯絡人(須開啟的寫入工具)
- 以被動資源形式提供最近收件匣郵件與今日事件
- 適用情境
- 適合讓助理在不把資料複製到別處的前提下查看 iCloud 收件匣、行程或通訊錄,例如彙整近期郵件、尋找某個事件或查詢聯絡人。只有希望助理代寄郵件或修改事件、聯絡人時,才值得開啟寫入功能。
- 執行需求
- 以 Python 3.11+ 套件形式透過 stdio 在本機執行(pip 或 uvx)。需要 ICLOUD_USERNAME(Apple ID 電子郵件)與 Apple 專用密碼,優先存放於系統鑰匙圈(ICLOUD_KEYRING_SERVICE),否則改用 ICLOUD_APP_PASSWORD。需要連線至 iCloud 的 IMAP、SMTP、CalDAV 與 CardDAV 端點,可用環境變數覆寫。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Icloud Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
icloud-mcp
[PyPI] [Python] [License: MIT]
A Model Context Protocol server that gives AI assistants read-only access to your iCloud mail and calendar over IMAP and CalDAV. Credentials live in your OS keyring (macOS Keychain by default) — never in a config file or the repo.
Defaults target iCloud, but every endpoint is overridable, so it works against any standard IMAP/CalDAV provider.
Status
Read-only by default; writes are strictly opt-in. Mail, calendar, and contacts
can be listed, searched, and read with no ability to change anything: the IMAP
connection is opened read-only and bodies are fetched with BODY.PEEK[], so
messages are never even marked as read.
Mutating tools span mail (send_mail, reply_mail, forward_mail), calendar
(create_event, update_event, delete_event), and contacts (create_contact,
update_contact, delete_contact) — but all are disabled unless you set
ICLOUD_ENABLE_WRITES=1, and even then every write requires an interactive
confirmation (MCP elicitation) before it runs. See Writes (opt-in).
Writes (opt-in)
Mutations are gated two ways:
- Operator switch — write tools refuse with an explanatory error unless
ICLOUD_ENABLE_WRITES=1is set in the server's environment. - Per-action confirmation — when enabled, each write tool calls back to the client to confirm the exact action before executing. Destructive operations (delete event / contact) are gated identically — no extra force flag, just the same confirmation.
iCloud issues a single app-specific password covering IMAP, SMTP, CalDAV, and CardDAV — there is no scoped "write-only" credential — so write-safety is structural: mail is sent over a separate, fresh SMTP connection (the read path's IMAP client has no send capability), and the opt-in flag + confirmation guard every mutation.
Install
Or run it without installing — handy for MCP clients that launch the server on demand:
To install the latest unreleased code straight from GitHub:
Or for local development:
Requires Python 3.11+.
Credentials
Generate an app-specific password for your Apple ID (never use your main password), then store it in your keyring:
On other platforms, the cross-platform keyring
library is used — keyring set icloud-mcp [email protected] also works anywhere.
The username comes from the ICLOUD_USERNAME environment variable. Resolution
order for the password:
- OS keyring (
ICLOUD_KEYRING_SERVICE, defaulticloud-mcp, + username) ICLOUD_APP_PASSWORDenvironment variable (fallback)
To reuse an existing keyring entry (e.g. one named my-icloud), set
ICLOUD_KEYRING_SERVICE=my-icloud.
Configuration
Set ICLOUD_USERNAME (required). All else is optional — see
.env.example for the full list of endpoint/timezone overrides.
Register with an MCP client
The server speaks MCP over stdio: a client launches the icloud-mcp command
as a subprocess and talks to it over stdin/stdout. "Installing" it into a client
just means telling that client which command to run and which env vars to pass —
the password itself stays in the keyring, never in the client config.
If icloud-mcp isn't on your PATH (e.g. you installed into a virtualenv),
use the absolute path to the launcher, e.g. /path/to/repo/.venv/bin/icloud-mcp.
Claude Code
Then claude mcp list to confirm. Add -s user to make it available across all
projects rather than just the current one.
Claude Desktop
Add the server to Claude Desktop's config file. On macOS this is:
(On Windows: %APPDATA%\Claude\claude_desktop_config.json.)
The easiest way to open it is Settings → Developer → Edit Config. Add an
mcpServers key alongside whatever is already in the file — do not paste a
second top-level { ... } object, or the file becomes invalid JSON:
If the file already contains other keys, merge mcpServers in as a sibling
(remember the comma between keys):
Then fully quit Claude Desktop (⌘Q, not just closing the window) and reopen it. The server shows up as a Local MCP server and its tools become available.
Notes:
- First call prompts for Keychain access. macOS asks whether
icloud-mcpmay read the keyring item; click Always Allow to avoid repeat prompts. - Claude Desktop may rewrite this file when it saves its own preferences,
dropping hand-added keys it doesn't recognize. If the server disappears after
you change other settings, just re-add the
mcpServersblock.
Tools & resources
Tools (model-invoked):
⚠️ Write tools require ICLOUD_ENABLE_WRITES=1 and confirm each action — see
Writes (opt-in).
Resources (passive context):
Behavior notes
- Empty/missing headers: messages whose
Subjectheader is absent or present-but-blank render as(no subject); a blank/absentFromrenders as(unknown). (Some mail has an empty subject line rather than no subject line at all — both are normalized.) - Snippets prefer the
text/plainpart; for HTML-only mail, tags are stripped (<style>/<script>/<head>content discarded) so you still get a readable preview. - Double-wrapped bodies: some senders (e.g. USPS Informed Delivery) embed a
redundant MIME header block at the top of the decoded body. A leading
Content-*/MIME-Versionheader block is stripped so those headers don't leak into the snippet or body. since_dateis date-granular and evaluated in the IMAP server's timezone (UTC for iCloud), so asince_dateof today can include late-yesterday messages in your local time.
Development
Security notes
- The app-specific password lives in the OS keyring only — never in
.env, never committed. - Read access (mail, calendar, contacts) cannot mutate anything; the IMAP session is opened read-only.
- Writes are off by default. They require
ICLOUD_ENABLE_WRITES=1and an interactive confirmation per action, and mail is sent over a separate SMTP connection isolated from the read path. - An app-specific password can be revoked at any time from appleid.apple.com without affecting your Apple ID.
License
MIT — see LICENSE.
Not affiliated with, endorsed by, or sponsored by Apple Inc. iCloud is a trademark of Apple Inc.
來源:README.md,提交 0d4886d
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
