
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 分
