io.github.eodozzy/icloud-mcp
Read-only-by-default MCP server for iCloud mail, calendar, and contacts (IMAP/CalDAV/CardDAV).
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
icloud-mcpclaude mcp add icloud-mcp -e 'ICLOUD_USERNAME=<ICLOUD_USERNAME>' -e 'ICLOUD_KEYRING_SERVICE=<ICLOUD_KEYRING_SERVICE>' -e 'ICLOUD_APP_PASSWORD=<your icloud_app_password>' -e 'ICLOUD_ENABLE_WRITES=<ICLOUD_ENABLE_WRITES>' -e 'ICLOUD_IMAP_HOST=<ICLOUD_IMAP_HOST>' -e 'ICLOUD_IMAP_PORT=<ICLOUD_IMAP_PORT>' -e 'ICLOUD_SMTP_HOST=<ICLOUD_SMTP_HOST>' -e 'ICLOUD_SMTP_PORT=<ICLOUD_SMTP_PORT>' -e 'ICLOUD_CALDAV_URL=<ICLOUD_CALDAV_URL>' -e 'ICLOUD_CARDDAV_URL=<ICLOUD_CARDDAV_URL>' -e 'ICLOUD_TZ=<ICLOUD_TZ>' -- uvx icloud-mcp==0.1.1
{
"mcpServers": {
"icloud-mcp": {
"command": "uvx",
"args": [
"icloud-mcp==0.1.1"
],
"env": {
"ICLOUD_USERNAME": "<ICLOUD_USERNAME>",
"ICLOUD_KEYRING_SERVICE": "<ICLOUD_KEYRING_SERVICE>",
"ICLOUD_APP_PASSWORD": "<your icloud_app_password>",
"ICLOUD_ENABLE_WRITES": "<ICLOUD_ENABLE_WRITES>",
"ICLOUD_IMAP_HOST": "<ICLOUD_IMAP_HOST>",
"ICLOUD_IMAP_PORT": "<ICLOUD_IMAP_PORT>",
"ICLOUD_SMTP_HOST": "<ICLOUD_SMTP_HOST>",
"ICLOUD_SMTP_PORT": "<ICLOUD_SMTP_PORT>",
"ICLOUD_CALDAV_URL": "<ICLOUD_CALDAV_URL>",
"ICLOUD_CARDDAV_URL": "<ICLOUD_CARDDAV_URL>",
"ICLOUD_TZ": "<ICLOUD_TZ>"
}
}
}
}
Variables d'environnement
ICLOUD_USERNAMEobligatoire Your Apple ID email (the IMAP/CalDAV username).ICLOUD_KEYRING_SERVICEOS-keyring service name to read the app-specific password from. Default: icloud-mcp. Set to reuse an existing entry.ICLOUD_APP_PASSWORDsecret App-specific password. Fallback only; preferred storage is the OS keyring. Used only when no keyring entry is found.ICLOUD_ENABLE_WRITESEnable mutating tools (send/reply/forward mail, create/update/delete event & contact). Off by default; each write still requires interactive confirmation. Accepts 1/true/yes/on.ICLOUD_IMAP_HOSTIMAP host override. Default: imap.mail.me.comICLOUD_IMAP_PORTIMAP port override. Default: 993ICLOUD_SMTP_HOSTSMTP host override (used only by write/send tools). Default: smtp.mail.me.comICLOUD_SMTP_PORTSMTP port override. Default: 587ICLOUD_CALDAV_URLCalDAV base URL override. Default: https://caldav.icloud.com/ICLOUD_CARDDAV_URLCardDAV base URL override. Default: https://contacts.icloud.com/ICLOUD_TZIANA timezone for rendering/scoping events. Default: system local time.
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
icloud-mcp
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
pip install icloud-mcp
Or run it without installing — handy for MCP clients that launch the server on demand:
uvx icloud-mcp
To install the latest unreleased code straight from GitHub:
pip install git+https://github.com/eodozzy/icloud-mcp
Or for local development:
git clone git@github.com:eodozzy/icloud-mcp
cd icloud-mcp
python3 -m venv .venv && .venv/bin/pip install -e ".[test]"
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:
# macOS
security add-generic-password -a "you@icloud.com" -s "icloud-mcp" -w "xxxx-xxxx-xxxx-xxxx"
On other platforms, the cross-platform keyring
library is used — keyring set icloud-mcp you@icloud.com 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
claude mcp add icloud \
--env ICLOUD_USERNAME=you@icloud.com \
--env ICLOUD_KEYRING_SERVICE=icloud-mcp \
-- icloud-mcp
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:
~/Library/Application Support/Claude/claude_desktop_config.json
(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:
{
"mcpServers": {
"icloud": {
"command": "icloud-mcp",
"env": {
"ICLOUD_USERNAME": "you@icloud.com",
"ICLOUD_KEYRING_SERVICE": "icloud-mcp"
}
}
}
}
If the file already contains other keys, merge mcpServers in as a sibling
(remember the comma between keys):
{
"someExistingSetting": "...",
"mcpServers": { "icloud": { "...": "..." } }
}
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):
| Tool | Description |
|---|---|
list_mail | List a folder (default INBOX), newest first, with optional since_date |
search_mail | Full-text search the inbox (or a named folder) |
list_folders | List the available IMAP mailbox folder names |
get_message | Fetch one message by UID, with full body |
list_events | Calendar events in a date window |
search_events | Events whose title matches text, in a window |
list_calendars | Names of all calendars |
list_contacts | List address-book contacts (name, emails, phones, org) |
search_contacts | Find contacts matching text across name, org, and emails |
send_mail ⚠️ | Send a plain-text email |
reply_mail ⚠️ | Reply to a message by UID (quotes original; reply_all optional) |
forward_mail ⚠️ | Forward a message by UID to a new recipient |
create_event ⚠️ | Create a calendar event |
update_event ⚠️ | Edit an event by UID (only the fields you pass) |
delete_event ⚠️ | Delete an event by UID |
create_contact ⚠️ | Create a new contact |
update_contact ⚠️ | Edit a contact by UID (merges into the existing vCard) |
delete_contact ⚠️ | Delete a contact by UID |
⚠️ Write tools require ICLOUD_ENABLE_WRITES=1 and confirm each action — see
Writes (opt-in).
Resources (passive context):
| URI | Description |
|---|---|
icloud://mail/inbox/recent | Most recent inbox messages |
icloud://calendar/today | Today + tomorrow's events |
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
.venv/bin/pytest # run the fixture-based test suite (no live account)
.venv/bin/mcp dev -m icloud_mcp.server # interactive MCP Inspector
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.
Questions fréquentes
Qu'est-ce que io.github.eodozzy/icloud-mcp ?
Read-only-by-default MCP server for iCloud mail, calendar, and contacts (IMAP/CalDAV/CardDAV).
Comment installer io.github.eodozzy/icloud-mcp ?
Il s'exécute sur votre machine. Dans Claude Code : claude mcp add icloud-mcp -e 'ICLOUD_USERNAME=<ICLOUD_USERNAME>' -e 'ICLOUD_KEYRING_SERVICE=<ICLOUD_KEYRING_SERVICE>' -e 'ICLOUD_APP_PASSWORD=<your icloud_app_password>' -e 'ICLOUD_ENABLE_WRITES=<ICLOUD_ENABLE_WRITES>' -e 'ICLOUD_IMAP_HOST=<ICLOUD_IMAP_HOST>' -e 'ICLOUD_IMAP_PORT=<ICLOUD_IMAP_PORT>' -e 'ICLOUD_SMTP_HOST=<ICLOUD_SMTP_HOST>' -e 'ICLOUD_SMTP_PORT=<ICLOUD_SMTP_PORT>' -e 'ICLOUD_CALDAV_URL=<ICLOUD_CALDAV_URL>' -e 'ICLOUD_CARDDAV_URL=<ICLOUD_CARDDAV_URL>' -e 'ICLOUD_TZ=<ICLOUD_TZ>' -- uvx icloud-mcp==0.1.1. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour io.github.eodozzy/icloud-mcp ?
Oui. Il attend ICLOUD_USERNAME, ICLOUD_APP_PASSWORD, à renseigner dans sa configuration.
io.github.eodozzy/icloud-mcp est-il open source ?
Oui. Son code est sur GitHub sous licence MIT.
Qui maintient io.github.eodozzy/icloud-mcp ?
Il est publié par eodozzy. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.