Skip to main content
Glama
iCloud MCP Hub

iCloud MCP Hub

by lemilleur
README.md
# iCloud MCP Hub

[English](README.md) · [Русский](README.ru.md)

Self-hosted access to **iCloud Calendar, Contacts and Mail** from AI agents through the Model Context Protocol. Run locally over stdio or provide an HTTPS endpoint with a separate token and permissions for each user.

**Author of this fork: WebCreww. License: MIT.** Based on [Michal Sevcik's original project](https://github.com/eruveo/icloud-mail-calendar-contacts-mcp). Original attribution and Git history are preserved.

> **Development version.** The MCP backend and CLI administration work. Web registration, a personal dashboard and PostgreSQL are planned, not implemented. Real Apple accounts and the production deployment still need acceptance testing. This is an independent project, not an Apple product.

## Features

| Service | Read | Write, when enabled |
| --- | --- | --- |
| Calendar / CalDAV | Calendars, events, recurrences, invitations | Create/update events and calendars, RSVP, delete events |
| Contacts / CardDAV | Contacts and groups | Create/update contacts and groups, delete contacts |
| Mail / IMAP + SMTP | Folders, search, messages | Send/reply/forward, drafts, flags, moves, trash, permanent deletion |

Notes, modern Reminders, iMessage, Safari, Photos, Drive and Keychain are outside this project's supported app-password interfaces.

## Requirements

- Node.js **22.13+**; Docker uses Node.js 24.
- Apple Account with two-factor authentication and a dedicated [app-specific password](https://support.apple.com/en-ie/102654).
- For remote access: persistent storage, a domain and HTTPS.

## Quick start with Docker

```bash
git clone https://github.com/lemilleur/icloud-mcp-hub.git
cd icloud-mcp-hub
cp .env.example .env
node -e "console.log(require('node:crypto').randomBytes(32).toString('hex'))"
```

Paste the generated key into `ICLOUD_MCP_ENCRYPTION_KEY` in `.env`, then:

```bash
docker compose up -d --build
curl http://127.0.0.1:8788/healthz
```

Compose publishes **localhost only**. Place an HTTPS proxy in front for remote access. The `icloud-data` named volume keeps encrypted user records; back it up separately from the encryption key. Losing the key makes stored Apple passwords unreadable.

Create users using the [hosted guide](docs/setup-hosted.md). All writes are **off by default for new hosted users**. Enable only the required operations.

## Connect an agent

For a client supporting Streamable HTTP and custom headers:

```json
{
  "mcpServers": {
    "icloud": {
      "url": "https://icloud.example.com/mcp",
      "headers": { "Authorization": "Bearer YOUR_PERSONAL_TOKEN" }
    }
  }
}
```

The JSON wrapper depends on the agent. Never put tokens in URLs or chat messages. Clients requiring OAuth instead of a configurable Bearer header need an additional authorization integration; OAuth is not implemented here.

## Documentation

| Topic | English | Русский |
| --- | --- | --- |
| Hosted setup, users, permissions, tokens | [Guide](docs/setup-hosted.md) | [Инструкция](docs/setup-hosted.ru.md) |
| EasyPanel | [Guide](docs/easypanel.md) | [Инструкция](docs/easypanel.ru.md) |
| Local stdio | [Guide](docs/setup-local.md) | [Инструкция](docs/setup-local.ru.md) |
| Security | [Policy](SECURITY.md) | [Безопасность](SECURITY.ru.md) |
| Contributing | [Guide](CONTRIBUTING.md) | [Участие](CONTRIBUTING.ru.md) |

## Development

```bash
npm ci
npm run typecheck
npm run lint
npm test
npm run build
npm audit
```

Tests use mocked Apple services and local HTTP servers; no Apple credentials are needed. The build supports Windows, Linux and macOS. No npm package or prebuilt container has been published by this fork; build from source.

## Roadmap

- Registration, email verification, login and account recovery.
- Dashboard for Apple connections, service permissions and tokens.
- PostgreSQL-backed users, browser sessions and indexed token lookup.
- Independent security review before public onboarding.

## Authors and license

**WebCreww** maintains this fork and its security hardening. **Michal Sevcik / [eruveo](https://github.com/eruveo)** created the original integration. Both are credited in [LICENSE](LICENSE). Distributed under MIT, without warranty. Apple and iCloud names belong to their respective owners.