iCloud CalDAV MCP

iCloud CalDAV MCP

Provides AI calendar operators full iCloud Calendar access through CalDAV, with two-factor authentication and app-specific passwords.

Category
访问服务器

README

iCloud CalDAV MCP

A production-oriented FastMCP server that gives an AI calendar operator full iCloud Calendar access through CalDAV. It exposes Streamable HTTP at /mcp and requires a separate bearer key on every HTTP request.

Security model

The two authentication layers are intentionally independent:

  1. MCP_API_KEY protects the public MCP endpoint. Poke sends it as Authorization: Bearer <MCP_API_KEY>.
  2. ICLOUD_USERNAME and ICLOUD_APP_PASSWORD authenticate this server to Apple CalDAV.

Never use your normal Apple ID password. Apple requires two-factor authentication before you can create an app-specific password. Create one at account.apple.com under Sign-In and Security → App-Specific Passwords. Rotate both secrets immediately if they are exposed.

Configuration precedence is process environment, then .env, then documented defaults. The server exits before binding if any required secret is absent. Secret values are never logged or returned by tools.

Local setup

Python 3.11 or newer and uv are recommended.

cp .env.example .env
# Edit .env and replace every placeholder.
uv sync --all-extras
uv run icloud-caldav-mcp

The server binds to 0.0.0.0:${PORT:-8000}. Its MCP URL is:

http://localhost:8000/mcp

Exact development checks:

uv run ruff format --check .
uv run ruff check .
uv run mypy src
uv run pytest
./scripts/inspector_smoke.sh

Tests marked integration launch an ephemeral Radicale process bound only to loopback. They never contact iCloud. When real ICLOUD_* credentials are present, the separately selected manual smoke test can verify Apple discovery without modifying events:

RUN_ICLOUD_SMOKE=1 uv run pytest -m icloud -v

Connect Poke

Poke requires a public HTTPS endpoint. In Poke, create a custom MCP connection with:

  • URL: https://<your-host>/mcp
  • Header: Authorization: Bearer <the exact MCP_API_KEY value>
  • Transport: Streamable HTTP

Do not put the Apple credentials in Poke; only this server needs them.

Docker

One-command build and run after creating .env:

docker build -t icloud-caldav-mcp . && docker run --rm --env-file .env -p 8000:8000 icloud-caldav-mcp

The image runs as an unprivileged user and listens on PORT.

HTTPS deployment

For a hosted service, deploy the Dockerfile to Render, Fly.io, Railway, Cloud Run, or another container platform; configure the three required secrets in that platform's secret manager and set its internal port to 8000. The platform terminates TLS, yielding https://<service-host>/mcp.

For a temporary local endpoint, run the server and a reputable HTTPS tunnel such as Cloudflare Tunnel:

cloudflared tunnel --url http://localhost:8000

Append /mcp to the generated HTTPS hostname. Treat an ephemeral tunnel URL and its bearer key as production credentials; stop the tunnel and rotate the key when finished.

Environment variables

Variable Required Default Purpose
MCP_API_KEY yes Bearer credential protecting every HTTP request
ICLOUD_USERNAME yes Apple ID email
ICLOUD_APP_PASSWORD yes Apple app-specific password
CALDAV_URL no https://caldav.icloud.com CalDAV origin; override only for local testing
PORT no 8000 HTTP listen port
DEFAULT_TIMEZONE no UTC IANA timezone used when a tool omits one
LOG_LEVEL no INFO Structured log threshold

Tool safety conventions

Mutations return the event UID, opaque calendar ID, and exactly what changed. Deletions require the UID and explicit scope. Datetimes are ISO 8601; timed values without an offset are interpreted in the supplied timezone, while all-day values are calendar dates with an exclusive end date. Conflict warnings are advisory and do not silently reject a requested mutation.

The server exposes 21 tools: calendar list/create/update/delete; event create/get/list/agenda, search/update/edit/delete/move; invite response; free/busy and free-slot finding; quick-add; ICS import/export; and safe batch create/delete. Create requests support stable idempotency keys, and updates support expected SEQUENCE checks to prevent lost concurrent edits.

iCloud behavior

Apple can redirect discovery from caldav.icloud.com to a partition host such as pXX-caldav.icloud.com. The client follows principal and calendar-home-set discovery and keeps the canonical URLs Apple returns. Calendar permissions and server-side scheduling behavior remain subject to the iCloud account and calendar sharing configuration.

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

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

官方
精选
Exa MCP Server

Exa MCP Server

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

官方
精选