iCloud MCP
Provides a local MCP integration for iCloud Mail, enabling AI agents to access and manage email through iCloud.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@iCloud MCPHow do I contribute to this project?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
iCloud MCP
An open-source project for a local iCloud Mail MCP integration.
The current implementation includes a local, read-only Apple Mail adapter and four typed MCP tools exposed over authenticated stdio and loopback-only Streamable HTTP. Every client has an explicit tool and Mail-folder policy, and every allowed adapter call or authorization denial is written to a local audit log.
Read-only Mail adapter
src/mail/index.ts exports a typed adapter with exactly four operations:
listFoldersreturns concise account and mailbox names with opaque folder locators;searchMailsearches one selected folder by subject, sender, or recipient and returns concise metadata;getMessageMetadatareturns headers and Mail status for explicitly selected message locators;getMessageBodiesreturns body content only for explicitly selected message locators.
Searches scan at most 500 messages and return at most 50 results. Folder, metadata, body, query, output-size, and execution-time limits are also enforced by the adapter. Missing Apple Mail fields are represented as null, while missing message locators are returned separately from successful results.
The adapter selects fixed AppleScript source for each operation, invokes /usr/bin/osascript directly without a shell, and passes all caller input through on run argv. It exposes no Mail write operation and does not accept script source, script paths, shell fragments, or raw AppleScript predicates. Tests use a fake runner and synthetic data; no personal Mail data is stored or emitted by the test suite.
Related MCP server: local-apple-data
MCP tools and transports
The server discovers exactly four read-only tools:
list_folderssearch_mailget_message_metadataget_message_bodies
Only get_message_bodies returns message body content. Every successful call returns the validated structured result plus one JSON text block containing the same result for compatibility.
For private ChatGPT Web access, follow the Secure MCP Tunnel connector guide.
Access policy
Set ICLOUD_MCP_POLICY_PATH to an absolute path for a versioned JSON policy stored outside this repository. The policy file and its parent directory must be owned by the current user; the file must have no group or world permissions, and the parent directory must not be group- or world-writable. The server refuses to start for a missing, relative, repository-local, malformed, or insecure policy. Copy policy.example.json to a private configuration directory, set the file mode to 0600, and replace the synthetic IDs and locators.
Each client entry requires:
a stable
id;exactly one
transport, eitherstdioorhttp;an exact subset of the four read-only tools;
mailScopeset explicitly to"*"or an allowlist of opaque folder locators;an explicit
allowBodiesboolean;for HTTP only, a
bearerTokenEnvnaming an environment variable that contains the token at launch.
Token values never belong in the policy. Unknown keys, duplicate client IDs, duplicate tools or locators, unknown tools, invalid locators, HTTP token environment variables missing at HTTP startup, and transport-specific field mismatches all fail startup. Stdio startup does not resolve unused HTTP secrets from a shared policy. Account IDs and every mailbox-path segment are compared exactly and case-sensitively. Account display names, MCP client metadata, headers other than Authorization, and arbitrary request metadata never establish identity.
get_message_bodies requires both tool permission and allowBodies: true. Folder listing is filtered to authorized locators before the requested limit is applied. Search is authorized before execution, and metadata or body batches containing any denied locator are rejected atomically.
Run the local stdio server with:
ICLOUD_MCP_POLICY_PATH=/absolute/private/policy.json \
ICLOUD_MCP_CLIENT_ID=local-desktop-client \
bun run mcp:stdioStdio identity comes only from ICLOUD_MCP_CLIENT_ID. A missing, unknown, or HTTP-only client ID fails startup. The name and version reported by the MCP client are treated only as optional untrusted audit metadata.
Run the Streamable HTTP server with:
ICLOUD_MCP_POLICY_PATH=/absolute/private/policy.json \
ICLOUD_MCP_EXAMPLE_HTTP_TOKEN='replace-with-a-random-secret' \
bun run mcp:httpThe HTTP endpoint is exactly http://127.0.0.1:3000/mcp and every request requires Authorization: Bearer <token>. The token is compared in constant time and maps to the configured HTTP client ID before MCP dispatch. Missing, malformed, or invalid authentication receives a fixed 401 with a Bearer challenge. Set a different local port with PORT, for example:
PORT=3100 bun run mcp:httpHTTP always binds to 127.0.0.1, accepts only loopback or localhost Host headers, and does not enable permissive CORS. Both transports support the MCP 2025 legacy era and the 2026-07-28 modern era through the official stable TypeScript SDK compatibility entry points.
Do not expose the HTTP server through a tunnel, proxy, DNS record, or public listener. OAuth and remote connector configuration remain separately scoped work.
Local audit log
Audit entries are JSON Lines in ~/Library/Logs/icloud-mcp by default. Set ICLOUD_MCP_AUDIT_DIR to a non-empty absolute path to use another local directory. Files roll over at UTC midnight as audit-YYYY-MM-DD.jsonl; the directory is mode 0700, files are mode 0600, and the latest 30 daily files are retained.
Each record contains only a schema version, UTC timestamp, random event ID, authenticated client ID, transport, tool, allow or deny decision, fixed reason code, and protocol era. Untrusted MCP client metadata is omitted. Audit entries never contain bearer tokens, headers, policy scopes, queries, locators, Mail identifiers or content, adapter output, stack traces, or raw errors. If an allow record cannot be durably appended, the adapter is not invoked.
Requirements
Bun 1.3.14
Install dependencies with:
bun install --frozen-lockfileQuality checks
Run the full local quality suite before opening a pull request:
bun run qualityThe suite checks formatting, lint rules, TypeScript types, and tests. Individual commands are also available:
bun run format:check
bun run lint
bun run typecheck
bun testGitHub Actions runs the same suite for every pull request and every push to master.
Contributing
Read CONTRIBUTING.md for development conventions and the pull request process.
Security
Do not report vulnerabilities in public issues. Follow the private reporting process in SECURITY.md.
License
Licensed under the MIT License.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceLocal MCP server for multi-account IMAP/SMTP email (iCloud + Gmail via app-specific passwords). Never marks mail read. Cross-folder search, idempotent sends, TLS verified.8MIT
- AlicenseAqualityCmaintenanceMCP server for privacy-gated local Apple data access including Mail, Messages, Notes, Calendar, Contacts, Photos, Reminders, Voice Memos, and iCloud Drive.301MIT
- Alicense-qualityDmaintenanceA high-fidelity IMAP/SMTP MCP server that enables reading, searching, and sending emails from providers like iCloud and Gmail, handling real-world IMAP quirks automatically.MIT
- Flicense-qualityDmaintenanceA Model Context Protocol (MCP) server that enables Claude Desktop to interact with iCloud email accounts. This server provides full email functionality including reading, sending, and managing emails through your iCloud account.1
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jerichosequitin/icloud-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server