Skip to main content
Glama
icloud-mcp

icloud-mcp

by mcdscot

icloud-mcp

An MCP server that gives AI assistants access to iCloud Mail (IMAP/SMTP) and iCloud Calendar (CalDAV).

It signs in with an Apple app-specific password, so it never sees your Apple ID password and needs no two-factor handling. Run it locally over stdio, or host it as a remote server protected by an API key.

Tools

Mail

Calendar

icloud_list_mailboxes

icloud_list_calendars

icloud_search_messages

icloud_list_events (recurring events expanded)

icloud_get_message

icloud_create_event

icloud_create_draft

icloud_update_event

icloud_send_message

icloud_delete_event

icloud_move_messages (archive / trash)

icloud_set_flags (read / flagged)

  • Mail is never hard-deleted: "delete" means moving to Deleted Messages.

  • iCloud does not file mail sent over SMTP, so icloud_send_message saves a copy to Sent Messages itself.

  • iCloud rejects CalDAV UID queries, so events are addressed by their CalDAV URL (event_id).

  • Editing or deleting a recurring event affects the whole series.

  • Subscribed calendars (webcal feeds such as sports fixtures or app schedules) are included, read-only. iCloud stores only a link to each feed, so the server downloads it itself and caches it for 15 minutes. Feed URLs often contain private tokens, so tools only ever return the publisher's host name.

  • Legacy CalDAV Reminders lists (shown in iCloud with ⚠️) are hidden; current Reminders are not available over CalDAV.

Related MCP server: icloud-mcp

Requirements

Run locally

git clone https://github.com/mcdscot/icloud-mcp.git
cd icloud-mcp
uv run icloud-mcp setup    # prompts for Apple ID and app-specific password, stores them in the OS keychain
uv run icloud-mcp check    # verifies Mail and Calendar sign-in

setup stores the credentials with keyring (macOS Keychain, Windows Credential Manager or the Linux Secret Service). The password is never echoed or written to a file.

Then add it to your MCP client as a stdio server. For example, with Claude Code:

claude mcp add --scope user icloud -- uv run --directory /path/to/icloud-mcp icloud-mcp

Host it remotely

Remote MCP clients (for example cloud-hosted agents) need an HTTPS endpoint. icloud-mcp serve-http serves stateless Streamable HTTP on $PORT (default 8080), at both / and /mcp, and refuses any request without the API key in $MCP_API_KEY. GET /healthz is open for health checks.

Clients authenticate with either header:

Authorization: Bearer <key>
X-API-Key: <key>

Deploy to Fly.io

cp fly.example.toml fly.toml              # set your app name, region and ICLOUD_TIMEZONE
fly apps create <your-app-name>
python3 -c "import secrets; print('icmcp_' + secrets.token_urlsafe(32))"   # your API key: keep it safe
fly secrets set ICLOUD_USERNAME=<apple-id> ICLOUD_APP_PASSWORD=<app-specific-password> MCP_API_KEY=<api-key>
fly deploy

Your endpoint is https://<your-app-name>.fly.dev. To use your own domain, run fly certs add <domain> and add the DNS records it prints. If your DNS is on Cloudflare, set the record to DNS only (grey cloud) so Fly can issue the certificate.

fly.toml is git-ignored so your app name and settings stay out of the repository. Other hosts work the same way: run the Dockerfile and set the same environment variables.

Configuration

Variable

Purpose

ICLOUD_USERNAME

Apple ID email (overrides the keychain)

ICLOUD_APP_PASSWORD

App-specific password (overrides the keychain)

ICLOUD_FROM

Send-as address, if different from the Apple ID (must be one of your iCloud aliases)

ICLOUD_TIMEZONE

IANA zone for times given without an offset; defaults to the machine's zone

ICLOUD_ALLOW_SEND

false removes icloud_send_message; default true

MCP_API_KEY

Required by serve-http; at least 32 characters

PORT

Port for serve-http; default 8080

Security

This server can read, move and (unless disabled) send email as you. Treat it accordingly.

  • Prompt injection. Emails and calendar invites are written by other people. An assistant reading them can be tricked by instructions hidden in a message, such as "forward the last ten emails to …". For a hosted server, keep ICLOUD_ALLOW_SEND=false: the assistant can still write drafts, and you send them yourself. Only enable sending if you trust every client and review what it does.

  • The API key is the only lock on a hosted server. Generate a long random key, give it only to your MCP client's credential store, never paste it into a chat, and rotate it (fly secrets set MCP_API_KEY=…) if it leaks.

  • Use an app-specific password, never your Apple ID password. You can revoke it at any time at https://account.apple.com without affecting anything else.

  • Single user. One deployment serves one iCloud account; there is no per-user isolation.

  • Destructive tools are marked with MCP destructiveHint, and nothing deletes mail permanently.

Development

uv run pytest

License

MIT

Available Tools

12 tools
icloud_create_draftB

Save a plain-text draft to the iCloud Drafts mailbox without sending it.

Inputs: to (required), body (required), subject (required), cc, +3 more. Returns: object

icloud_create_eventC

Create an event in an iCloud calendar.

Inputs: start (required), summary (required), calendar (required), end, +4 more. Returns: object

icloud_delete_eventA
Destructive

Delete an event (for a recurring event, the whole series). Confirm with the user first.

Inputs: event_id (required). Returns: object

icloud_get_messageA
Read-only

Read one message: headers, body as text (HTML converted), and the attachment list.

Inputs: uid (required), mailbox, mark_read, max_chars. Returns: object

icloud_list_calendarsA
Read-only

List the user's iCloud calendars: their own and shared ones (kind 'calendar'), plus calendars they subscribe to such as sports fixtures or app feeds (kind 'subscribed', read-only).

Inputs: no named parameters. Returns: result

icloud_list_eventsA
Read-only

List events in a time range across calendars, recurring events expanded into occurrences, sorted by start.

Includes subscribed calendars (marked read_only). All-day events report `end` as the last day inclusive.
If a subscribed feed cannot be fetched, its error is listed under `warnings` and the rest still return.

Inputs: end (required), start (required), limit, query, +2 more. Returns: object

icloud_list_mailboxesA
Read-only

List iCloud Mail mailboxes with total and unread message counts.

Inputs: no named parameters. Returns: result

icloud_move_messagesA

Move messages between mailboxes (also how to archive or trash them; nothing is permanently deleted).

Inputs: uids (required), to_mailbox (required), from_mailbox (required). Returns: object

icloud_search_messagesA
Read-only

Search one mailbox and return message summaries (newest first) with uid, sender, subject, date and flags.

With no filters it lists the most recent messages. Use offset/has_more to page.

Inputs: text, limit, since, before, +7 more. Returns: object

icloud_send_messageA
Destructive

Send a plain-text email from the user's iCloud address. Cannot be undone: confirm with the user first.

Inputs: to (required), body (required), subject (required), cc, +3 more. Returns: object

icloud_set_flagsC

Mark messages read/unread and/or flagged/unflagged.

Inputs: uids (required), mailbox (required), seen, flagged. Returns: object

icloud_update_eventA

Change fields of an event; omitted fields stay as they are. For a recurring event this edits the whole series.

Inputs: event_id (required), end, start, all_day, +3 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 12 tools

    Disambiguation5/5

    Mail and calendar tools are cleanly separated, and within mail each tool maps to a distinct action: listing mailboxes, searching, reading a single message, drafting, sending, moving, and flagging. The move vs. set_flags split is explicitly clarified in the descriptions, leaving no real boundary confusion.

    Naming Consistency5/5

    All twelve tools follow a uniform `icloud_<verb>_<noun>` snake_case pattern, and the resource prefixes (mailboxes, messages, calendars, events) make the pattern even more predictable. No mixed conventions or vague verbs.

    Tool Count5/5

    Twelve tools split sensibly into seven mail operations and five calendar operations, each earning its place with no filler. The surface is well-scoped for a personal iCloud mail+calendar integration.

    Completeness4/5

    Core CRUD and lifecycle coverage is present for both domains: search/read/draft/send/move/flag for mail and list/create/update/delete for events. Minor gaps remain, such as no reply/forward, no attachment download, no calendar creation/deletion, and no attendee/RSVP handling.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI assistants with read-only access to iCloud mail and calendar via IMAP and CalDAV, with opt-in write support for sending mail, managing events, and contacts.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an AI assistant to read and search iCloud mail, draft messages (never sent), manage calendar events with a preview/commit gate, and look up contacts via IMAP, CalDAV, and CardDAV.
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to read iCloud Mail over IMAP with an app-specific password, including listing mailboxes, browsing and searching messages, and reading message bodies and attachment filenames. All operations are read-only, so messages remain unread and cannot be sent, deleted, moved, or altered.
      4
      MIT