icloud-mcp

io.github.ThomasCrouzet由 GitHub 账号 ThomasCrouzet 发布v0.5.1更新于 Nov 7, 2026

stdio MCP for iCloud Calendar (CalDAV), with optional Contacts and Mail.

已验证STDIO仅桌面效率与工作流沟通与协作

概览

AI 生成的概览

本地 stdio MCP 服务器,让助手通过 CalDAV 访问 iCloud 日历,并可选用通讯录与邮件(IMAP/SMTP)。

可以做什么
  • 查看已启用能力并列出日历
  • 搜索、获取和校验事件,查找空闲时段
  • 以条件 ETag 创建、更新和删除日历事件
  • 列出通讯录并搜索、获取、创建、更新或删除 vCard 联系人
  • 列出邮箱、搜索邮件,读取纯文本正文与附件元数据
  • 修改标记、移动或删除邮件,以及发送或回复纯文本邮件
适用场景
适合在无 macOS 框架、无浏览器自动化的无头机器上,让助手读取或管理 iCloud 日历、联系人和邮件,例如安排日程、查找空闲时间或处理邮件。
运行要求
需要由 MCP 主机通过 stdio 启动的本地 Go 二进制文件(安装需 Go 1.26.0 以上,或使用 Linux amd64/arm64、macOS arm64 的签名发布包)。需要开启双重认证的 Apple 账户和应用专用密码,通过 ICLOUD_EMAIL 与 ICLOUD_PASSWORD 以文件路径提供;邮件还需 ICLOUD_MAIL_ADDRESS,可选 ICLOUD_MAIL_PASSWORD。需要访问 iCloud 主机的网络。
安装前请注意
切勿使用 Apple 账户主密码,应使用应用专用密码并存放于独立的 0600 权限文件。日历写入与删除默认开启,建议先设 ICLOUD_MCP_READ_ONLY=true,再按需开启通讯录、邮件写入与发送。邮件发送需配置 ICLOUD_MCP_SMTP_ALLOWED_RECIPIENTS,使用通配符将允许任意收件人。所有启用的域共用一个进程,一旦被攻破可能泄露全部已加载凭据。账户内容会返回给 MCP 主机,后续存储或传输由主机决定。

安装

在 SourceWeft 中

  1. 打开 控制台中的 icloud-mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

icloud-mcp

iCloud Calendar, Contacts, and Mail through one stdio MCP server.

Get started | MCP tools | Configuration | Documentation

Connect an MCP host to iCloud with one Go binary. Calendar uses CalDAV; optional Contacts and Mail use CardDAV, IMAP, and SMTP. The host starts the process and exchanges JSON-RPC through stdin and stdout.

Why icloud-mcp?

Use this server when an MCP host needs to search calendars, find free time, or work with iCloud contacts and messages on a headless machine. It uses app-specific passwords and remote protocols, without macOS frameworks, browser automation, or private Apple APIs.

Capability gates let you start with Calendar reads and enable other operations as needed. Each domain has its own protocol clients and network policy. All enabled domains share one process: a process compromise can expose all loaded credentials. Use separate processes and account configurations for stronger isolation.

Privacy and security

Accounts: An Apple Account with iCloud Calendar and an app-specific password is required. Contacts uses the same identity. Optional Mail needs a full iCloud Mail address and can use a separate app-specific password. The server has no separate product account; the MCP host has its own account requirements.

Telemetry: The server has no telemetry or crash-reporting service. It writes operational logs and mutation audit records to stderr. The host controls log retention and has its own telemetry policy.

Data: Credentials are loaded at startup. Discovery state and keyed update results stay in process memory; the server writes no local data files. It sends authenticated requests to iCloud and returns account content to the MCP host. That host controls any further storage or transmission to a model provider.

  • Fixed destinations. Calendar and Contacts use their iCloud hosts and validated shards on port 443. Mail uses imap.mail.me.com:993 and smtp.mail.me.com:587, with mandatory STARTTLS for SMTP. TLS 1.2 or later is required. DAV ignores proxy environment variables.
  • Redaction and audit. The server redacts configured identities, passwords, and Basic/SASL forms from errors, results, and logs. Mutation audits contain domain, resourceType, and a process-local HMAC resourceToken, without raw resource paths, UIDs, mailboxes, or recipients.
  • Host permissions. Remote text can contain prompt injection. A compromised host model can invoke every registered tool. Start with global read-only mode and enable only the capabilities you need.

See the threat model and reporting policy and security implementation.

Capability gates

CapabilityOperationsEnablement
CalendarList calendars; search, get, and validate events; find free slots; create, update, and delete eventsAlways on by default; ICLOUD_MCP_PERMISSIONS can reduce it
ContactsList books; search and get contacts; create, update, and delete vCard 3.0 contactsICLOUD_MCP_ENABLE_CONTACTS=true
Mail readList mailboxes; search messages; get plain text and attachment metadataICLOUD_MCP_ENABLE_MAIL=true
Mail mutationChange flags; move or trash a messageMail plus ICLOUD_MCP_ENABLE_MAIL_WRITE=true
Mail sendSubmit a plain-text message, or reply to one with preserved conversation headers, through SMTPMail plus ICLOUD_MCP_ENABLE_MAIL_SEND=true and a recipient policy

ICLOUD_MCP_READ_ONLY=true removes every mutation and send tool from tools/list. It does not enable a disabled read domain. Contacts has no separate write flag. Mail mutation and send have independent gates. A send policy is required whenever the send flag is set, including under global read-only.

ICLOUD_MCP_RESOURCE_SCOPES optionally limits which calendars, address books, and mailboxes an agent may use. It is a semicolon-separated list of action=value[,value] entries. Actions are calendar.read, calendar.write, calendar.delete, contacts.read, contacts.write, contacts.delete, mail.read, mail.mutate, and mail.archive. A literal * keeps an action unrestricted.

Calendar values are paths. Contacts values are opaque identifiers or exact display names. Mail values are exact mailbox names. Omitted action scopes fall back to the read or write scope for that domain. Direct identifier injection is checked before the domain operation. Ambiguous or stale Contacts names fail closed. The variable is invalid if an action is unknown, duplicated, empty, or a Calendar path is malformed.

ICLOUD_MCP_PERMISSIONS optionally replaces the implicit write rules. It takes a comma-separated list: calendar.read, calendar.write, calendar.delete, contacts.read, contacts.write, contacts.delete, mail.read, mail.mutate, mail.trash, and mail.send. Domain switches still enable a domain. Global read-only still removes every mutation and send. With no value, the legacy switches above keep their documented behavior. For example, calendar.read,mail.read,mail.send gives Calendar reads and Mail send without Calendar, Contacts, or Mail mutation tools.

MCP tools

The server registers 10 tools by default, 7 with global read-only and optional domains off, and 24 with all gates on. Disabled tools are absent from discovery. The MCP interface provides tools over stdio.

ToolInputResultAccount changes
icloud_capabilitiesNo argumentsEnabled domains, effective capabilities, version, tool names and countNone; the call uses local state
list_calendarsNo argumentsCalendar names and paths for subsequent callsNone
search_eventsstart, end; optional calendar and filtersSorted event page with calendar, recurrence occurrences, and truncation or failure warningsNone
update_eventcalendar, uid, changed fields; optional etag, idempotency_key, occurrence scopeUpdated event or a structured errorConditional Calendar write
get_messagemailbox, uid_validity, uid; optional body limit and HTML fallbackMessage metadata and bounded plain textNone; EXAMINE and PEEK preserve read state
send_messagebody, optional subject, idempotency_key, and at least one recipient across to, cc, bccSubmission status or a structured errorSends mail to allowed recipients; identical keyed calls reuse one submission
reply_messagesource mailbox, uid_validity, uid; body; optional mode and idempotency_keySubmission status or a structured errorReplies to the resolved sender or reply-all recipients; never marks Answered or appends Sent

The complete inventory lists all tools. Run icloud-mcp -doctor for concise read-only domain checks. Add -doctor-format=json for machine-readable output. The command validates local configuration, then probes enabled domains with a 10-second timeout each. It never creates, updates, moves, trashes, or sends. Exit status is 0 when every enabled domain is ready and 1 when a probe fails. Disabled domains stay disabled; enabled domains are never reported ready before a successful probe.

-doctor is not available in v0.4.3. It uses configured credentials and does not probe SMTP. For credential-free TLS checks and hosted-network limitations, see Mail network troubleshooting.

Representative read tools also publish output schemas and structuredContent. Their text content remains for older hosts. Both forms come from the same redacted values. Discover their argument schemas with the host's tool list. Domain failures set the MCP error flag and include a JSON code in text content. Follow the error and recovery reference.

Get started

This first run enables Calendar reads only. You need an MCP host, network access to iCloud, and an Apple Account with two-factor authentication to create an app-specific password. Never use the main Apple Account password.

Install the binary

With Go 1.26.0 or newer:

sh
go install github.com/ThomasCrouzet/icloud-mcp/cmd/icloud-mcp@latestgo env GOPATH GOBIN

The executable is installed in GOBIN when set, otherwise in bin under GOPATH (normally $HOME/go/bin). Use its absolute path in the host config.

Without Go, use a release archive for Linux amd64/arm64 or macOS arm64. Archives include checksums, cosign signatures, and certificates. Follow the release verification procedure.

Prepare credentials

Store the Apple Account identity and app-specific password in separate files outside the repository. Each must be a regular file of at most 4 KiB, with mode 0600 or stricter. The host user must be able to read them. Use absolute file:// paths; the server reads these files only at startup.

Connect Claude Desktop

This example uses Claude Desktop on macOS. Open Settings > Developer > Edit Config. Its user configuration file is ~/Library/Application Support/Claude/claude_desktop_config.json; see the official local-server setup guide and environment configuration. Merge this entry into mcpServers, with your actual absolute paths:

json
{  "mcpServers": {    "icloud": {      "command": "/Users/you/go/bin/icloud-mcp",      "env": {        "ICLOUD_EMAIL": "file:///Users/you/.config/icloud-mcp/email",        "ICLOUD_PASSWORD": "file:///Users/you/.config/icloud-mcp/password",        "ICLOUD_MCP_READ_ONLY": "true",        "ICLOUD_MCP_DEFAULT_TZ": "Europe/Paris"      }    }  }}

Keep optional domains off for this run. Fully quit and reopen Claude Desktop. The host launches the binary. Calendar discovery starts on the first Calendar call, so a remote Calendar outage does not block Mail or Contacts startup. Open the host's connector tool list and confirm the icloud tools appear.

Run your first operation

Ask the host:

text
Call icloud_capabilities and confirm readOnly is true and toolCount is 7.Then call list_calendars with no arguments and show the calendar names.

The first call confirms capability discovery. The second reads iCloud. It returns count and a calendars array with name and path fields. An account with no calendars returns an empty array. A synthetic protocol fixture returns:

json
{  "count": 1,  "calendars": [    {"path": "/fixture/calendars/home/", "name": "Fixture Calendar"}  ]}

This output comes from the repository fixture, not a live account. Your names, paths, and count depend on your account. Next, ask the host to use search_events for the next seven days.

For another host, configure a custom stdio process with the same command and environment; its configuration format can differ. See host integration.

Configuration

The binary reads exactly 14 product environment variables from its process environment. It does not load .env files or host configuration files. .env.example lists the supported keys. The host or launching shell must supply them; restart the process after a change.

VariableRequiredDefaultPurpose
ICLOUD_EMAILYesNoneCalendar and Contacts identity; supports file://
ICLOUD_PASSWORDYesNoneApp-specific password; supports file://
ICLOUD_MCP_READ_ONLYNofalseRemove every mutation and send tool
ICLOUD_MCP_PERMISSIONSNoLegacy switchesExplicit comma-separated capability list
ICLOUD_MCP_RESOURCE_SCOPESNoAll resourcesPer-action Calendar, Contacts, and Mail resource allowlists
ICLOUD_MCP_LOG_LEVELNoinfoOperational stderr log level
ICLOUD_MCP_DEFAULT_TZNoUTCIANA zone for Calendar times without an offset and recurring-write fallback
ICLOUD_MCP_ENABLE_CONTACTSNofalseEnable Contacts; writes also require read-only to be off
ICLOUD_MCP_ENABLE_MAILNofalseEnable Mail reads
ICLOUD_MAIL_ADDRESSWhen Mail is onNoneFull iCloud Mail address; supports file://
ICLOUD_MAIL_PASSWORDNoICLOUD_PASSWORDSeparate Mail app-specific password; supports file://
ICLOUD_MCP_ENABLE_MAIL_WRITENofalseEnable IMAP mutations; requires Mail
ICLOUD_MCP_ENABLE_MAIL_SENDNofalseEnable SMTP send; requires Mail and a recipient policy
ICLOUD_MCP_SMTP_ALLOWED_RECIPIENTSWhen send is requestedNoneComma-separated exact addresses, or literal *

Boolean values accept unset, 0, false, 1, and true; the parser trims whitespace and ignores case. Invalid values fail before network access. Pass environment values as strings, including quoted booleans in YAML. Mail write or send without Mail is a boot error. Prefer exact recipient addresses: literal * permits any syntactically valid recipient and causes a boot warning.

For Calendar times, use an explicit RFC3339 offset or a local time without an offset in ICLOUD_MCP_DEFAULT_TZ. Do not label a local hour with Z. Timed results include an explicit numeric offset; all-day dates use YYYY-MM-DD. See the full configuration and date rules for log-level forms and optional-domain examples.

Operations

AreaBehavior
LifecycleConfiguration validates before network access. Calendar, Contacts, and Mail initialize independently. Calendar and Contacts discovery is lazy; Mail uses fresh sessions. A failing domain does not remove another domain. EOF and SIGTERM stop the stdio process. Use a separate process for each account.
Logsstdout is reserved for JSON-RPC. Operational logs and mutation audits go to stderr. -audit-format=json is the default; text is also supported.
HealthDisabled by default. -health 127.0.0.1:8797 enables loopback-only /healthz and /status with domain status and rate limits. Enabled domains start as not_checked. Use -doctor for bounded read-only probes. These are monitoring endpoints; MCP remains stdio.
Read retriesCalendar and Contacts retry bounded HTTP status failures. A transient IMAP read can use one replacement session.
MutationsCalendar/Contacts writes, IMAP mutations, and SMTP never replay automatically. An outcome_unknown result requires reconciliation before another mutation.
Update keysupdate_event and update_contact retain keyed results in memory. Known results last 15 minutes; uncertain results remain until process exit. Restart removes the cache without resolving outcomes.

Use strong ETags for Calendar and Contacts updates and deletes. Creates use If-None-Match: *; updates and deletes use a strong If-Match. For creates, client_uid or its idempotency_key alias identifies the resource. For keyed updates, follow the cache contract and recovery procedure.

Limits

Tools have a 25 s deadline and DAV a 30 s HTTP timeout. Stdio frames are limited to 1 MiB and MCP results to 256 KiB. Calendar and Contacts each allow 60 reads and 20 writes per minute. Mail has separate limits of 60 reads, 20 mutations, and 20 sends per minute. See the public limits for search, parser, recurrence, and concurrency bounds.

Documentation

GuideContents
Host integrationSecrets, all configuration keys, dates, health, multiple accounts, caller behavior
ArchitectureStartup, boundaries, full tool inventory, limits, update idempotency
Error codesStructured errors, retry rules, mutation reconciliation
CalDAV compatibilityCalendar discovery, conditional writes, recurrence
CardDAV compatibilityContacts discovery, search, vCard formats and writes
Mail compatibilityIMAP identities, sessions, MIME bounds, mutations, SMTP
Mail network troubleshootingVersion-specific diagnostics, credential-free TLS checks, approved deployment networks
Security policy and implementationThreat model, private reporting, technical controls
TestingLocal checks, protocol evidence, CI, live integration, release verification
Releases and ChangelogPublished archives and version history

Build and test

From the repository root, use Go 1.26.0 or newer and Make. Build and test need no iCloud account or running service. CI and release builds pin Go 1.26.10.

sh
make build        # bin/icloud-mcp, host Go; version defaults to devmake test         # go test ./... -race -covermake lint         # go vet and pinned golangci-lint v2.15.0

make release-all VERSION=vX.Y.Z packages Linux amd64/arm64 and macOS arm64 with the host toolchain. make release VERSION=vX.Y.Z uses a pinned Docker image for Linux arm64. Replace vX.Y.Z with a release version. Both require a clean worktree, including untracked files, and refuse to overwrite output. Tag releases build after CI and gitleaks pass. Live integration tests require credentials and explicit gates; see Testing.

Contributing

Follow CONTRIBUTING.md. Run gofmt, make test, and make lint before opening a pull request. Report bugs through GitHub Issues, with the version, enabled domains, reproduction steps, and redacted errors. Report vulnerabilities privately through SECURITY.md.

Status

The implemented scope is iCloud Calendar with optional Contacts and Mail.

TargetPublished archiveNative release smokeStatus
Linux amd64YesUbuntu GitHub-hosted runnerSupported
Linux arm64YesCompile and archive onlySupported
macOS arm64YesmacOS GitHub-hosted arm64 runnerSupported
Windows amd64NoNoneCompile-only, explicit scope decision

Windows has no signed archive and no runtime support claim. Compilation is not evidence of file-credential handling, service startup, or installation.

Install without Go by downloading icloud-mcp-vX.Y.Z-<os>-<arch>.tar.gz and icloud-mcp-vX.Y.Z-checksums.txt from the release. Verify the checksum and cosign signature, extract icloud-mcp, and use its absolute path in the host configuration. See the release verification procedure.

Current limits to account for:

  • Calendar. Recurring operations support a full series or one occurrence. this-and-future and RDATE are unsupported. A search range is at most 366 days.
  • Contacts. Reads accept vCard 3.0 and 4.0. Writes support 3.0 only; vCard 4.0 and groups are read-only. Full-object updates preserve PHOTO and unknown fields.
  • Mail. Message identity is (mailbox, UIDVALIDITY, UID). Reads return plain text and attachment metadata, without HTML or attachment bodies. move_message rejects SPECIAL-USE Trash and Junk destinations; use trash_message for intentional deletion. When CONDSTORE is advertised, set_message_flags requires expected_modseq. The adapter validates one UID STORE from the returned FETCH metadata, reports concurrent_modification for a stale MODSEQ, and never retries the write.
  • Scope. Reminders, Notes, Photos, Drive, Find My, Keychain, Messages, and Home are outside the supported scope. Modern Reminders are not exposed by this CalDAV connector.

Architecture

[A stdio MCP client connects to capability gates and separate Calendar, Contacts, IMAP, and SMTP clients.]

Each domain keeps separate credentials, transports or dialers, rate limiters, and semaphores. Shared code handles redaction, audit, result bounds, and the process lifecycle. See the package map.

Direct dependencies

The single Go module has exactly 10 direct dependencies. Exact versions are in go.mod; required notices are in THIRD_PARTY_NOTICES.md.

DependencyPurpose
github.com/emersion/go-webdavCalDAV primitives; custom discovery and conditional requests preserve iCloud behavior
github.com/emersion/go-icaliCalendar parsing and encoding
github.com/mark3labs/mcp-goMCP stdio transport, schemas, and JSON-RPC
github.com/teambition/rrule-goBounded recurrence expansion with timezone preservation
golang.org/x/timeIndependent domain rate limiters
github.com/emersion/go-vcardvCard 3.0/4.0 reads and 3.0 writes
github.com/emersion/go-imap/v2IMAP through the narrow internal/mail/imapadapter boundary
github.com/emersion/go-messageMIME parsing and bounded plain-text handling
github.com/emersion/go-smtpSMTP submission with STARTTLS
github.com/emersion/go-saslSASL PLAIN authentication after STARTTLS

License and credits

MIT. Copyright (c) 2026 Thomas Crouzet. See LICENSE and third-party notices.

Attribution

Calendar tool shape and several patterns were inspired by github.com/roygabriel/mcp-icloud-calendar (MIT, copyright 2026 Gabe). Code was rewritten, not copied.

来源:README.md,提交 47931a5

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

4
  1. v0.5.1最新Nov 7, 2026
  2. v0.4.3Nov 4, 2026
  3. v0.4.2Oct 31, 2026
  4. v0.4.0Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分