icloud-mcp

icloud-mcp

An MCP server for iCloud Calendar, Contacts, and Mail, usable from any MCP-capable AI client.

Category
访问服务器

README

icloud-mcp

An MCP server for iCloud Calendar, Contacts, and Mail — usable from any MCP-capable AI client (Claude Desktop, Claude Code, Cursor, Windsurf, etc.).

Only uses Apple's officially documented protocols: CalDAV (calendar), CardDAV (contacts), and IMAP/SMTP (mail). It does not touch Reminders, Notes, Find My, or Photos — those only have an undocumented, reverse-engineered API that's out of scope here (see Scope below).

Status

Early development. Not yet published to npm — see Development to run it from source in the meantime.

Tools

Tool Read/Write Description
health_check read Confirms the server is running
list_calendars read Lists iCloud calendars
list_events read Lists events in a calendar within a time range
get_event read Fetches a single event
create_event write Creates a calendar event
update_event write Updates an existing event
delete_event write Deletes an event
list_contacts read Lists contacts, optionally filtered
search_contacts read Searches contacts by name/org/email/phone
get_contact read Fetches a single contact
create_contact write Creates a contact
update_contact write Updates an existing contact
delete_contact write Deletes a contact
list_mailboxes read Lists IMAP mailboxes/folders
list_messages read Lists recent messages in a mailbox
search_messages read Searches messages by sender/subject/text
get_message read Fetches a single message's headers + text body
send_message write Sends an email

Write tools are disabled by default. They only register when ICLOUD_MCP_ALLOW_WRITE=true is set — see Security.

Setup

1. Generate an app-specific password

Apple requires a dedicated app-specific password for third-party CalDAV/CardDAV/IMAP access — never use your actual Apple ID password here.

  1. Go to appleid.apple.com → Sign-In and Security → App-Specific Passwords
  2. Generate one (e.g. named "icloud-mcp") and copy it

2. Configure environment variables

Variable Required Description
ICLOUD_APPLE_ID yes Your Apple ID email
ICLOUD_APP_SPECIFIC_PASSWORD yes* The app-specific password from step 1
ICLOUD_MCP_ALLOW_WRITE no Set to true to enable write tools (default: read-only)
ICLOUD_CALDAV_URL no Override the CalDAV endpoint (default: https://caldav.icloud.com)
ICLOUD_CARDDAV_URL no Override the CardDAV endpoint (default: https://contacts.icloud.com)

* Instead of ICLOUD_APP_SPECIFIC_PASSWORD, you can store the password in your OS keychain under service icloud-mcp, account <your Apple ID> (macOS Keychain / libsecret via keytar), and omit the env var.

3. Add it to your MCP client

Once published, the server runs via npx @lejangt/icloud-mcp over stdio.

Claude Code:

claude mcp add icloud --env ICLOUD_APPLE_ID=you@icloud.com --env ICLOUD_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx -- npx @lejangt/icloud-mcp

Claude Desktop / Cursor / Windsurf / any client using mcpServers JSON config:

{
  "mcpServers": {
    "icloud": {
      "command": "npx",
      "args": ["@lejangt/icloud-mcp"],
      "env": {
        "ICLOUD_APPLE_ID": "you@icloud.com",
        "ICLOUD_APP_SPECIFIC_PASSWORD": "xxxx-xxxx-xxxx-xxxx"
      }
    }
  }
}

Add "ICLOUD_MCP_ALLOW_WRITE": "true" to env if you want write tools enabled.

Security

  • Write tools are opt-in. Without ICLOUD_MCP_ALLOW_WRITE=true, the server only exposes read tools — reducing the blast radius if a client misbehaves or credentials leak.
  • Enabling write tools means the AI agent can send email and modify/delete calendar events and contacts on your behalf. Only enable it if you understand and accept that.
  • All connections use TLS; credentials are never logged (see src/logging.ts).
  • See SECURITY.md for the full threat model and how to report vulnerabilities.

Scope

Calendar, contacts, and mail are supported because Apple documents stable, official protocols for them (CalDAV/CardDAV/IMAP+SMTP with an app-specific password). Reminders, Notes, Find My, and Photos are intentionally out of scope: the only way to access them programmatically is Apple's undocumented, reverse-engineered iCloud web API (as used by projects like pyicloud), which requires your full Apple ID session (2FA included) and can break without warning when Apple changes internals. That's a meaningfully different risk/maintenance profile and isn't part of this project.

Development

Requires Node.js ≥ 18.

npm install
npm run build      # compile TypeScript to dist/
npm run dev        # watch mode
npm run lint
npm run typecheck
npm test

Run the server directly against real credentials for manual testing:

ICLOUD_APPLE_ID=you@icloud.com ICLOUD_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx node dist/index.js

Or drive it interactively with the MCP Inspector:

ICLOUD_APPLE_ID=you@icloud.com ICLOUD_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx \
  npx @modelcontextprotocol/inspector node dist/index.js

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

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

官方
精选
Exa MCP Server

Exa MCP Server

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

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选