icloud-calendar-mcp
Enables secure integration with Apple's iCloud Calendar service via CalDAV, allowing AI assistants to list calendars and manage event entries.
Provides tools to manage iCloud calendars and events, including listing available calendars, fetching events within date ranges, and performing create, update, and delete operations.
An MCP (Model Context Protocol) server that gives AI assistants access to iCloud Calendar via CalDAV, with security controls aligned with the OWASP MCP Top 10.
Never use your main Apple ID password. This server requires an app-specific password which can be revoked independently without affecting your Apple ID.
Features
MCP Tools
Tool | Description | Read-Only | Destructive |
| List all calendars from iCloud account | Yes | No |
| Get events within a date range from a calendar | Yes | No |
| Create a new calendar event | No | No |
| Update an existing event | No | No |
| Delete an event by ID | No | Yes |
MCP Resources
Resource | Description |
| Browse available calendars |
Security Features
Credential Protection - Environment variables only, never in code or config
Input Validation - All parameters validated with SSRF protection
Rate Limiting - 60 reads/min, 20 writes/min per MCP specification
Secure Error Handling - No sensitive data leakage in error messages
OWASP MCP Top 10 Compliance - 282 security tests covering all major risks
ReDoS Protection - All regex patterns tested against catastrophic backtracking
Unicode Security - Protection against homoglyph and encoding attacks
Related MCP server: iCloud CalDAV MCP Connector
Quick Start
Prerequisites
Java 17+ (for all installation methods)
iCloud account with app-specific password
Installation
Choose your preferred installation method:
Option 1: npm (Recommended)
npx @icloud-calendar-mcp/serverOption 2: Python (uvx)
uvx icloud-calendar-mcpOption 3: Direct JAR
# Download from GitHub Releases
curl -LO https://github.com/icloud-calendar-mcp/icloud-calendar-mcp/releases/latest/download/icloud-calendar-mcp-3.1.0-all.jar
# Run
java -jar icloud-calendar-mcp-3.1.0-all.jarOption 4: Build from Source
git clone https://github.com/icloud-calendar-mcp/icloud-calendar-mcp.git
cd icloud-calendar-mcp
./gradlew fatJar
java -jar build/libs/icloud-calendar-mcp-3.1.0-all.jarConfiguration
Set your iCloud credentials as environment variables:
export ICLOUD_USERNAME="your-apple-id@icloud.com"
export ICLOUD_PASSWORD="your-app-specific-password"Security Note: Use an app-specific password, not your main Apple ID password.
Claude Desktop Integration
Add to your Claude Desktop configuration:
Platform | Config Path |
macOS |
|
Linux |
|
Windows |
|
{
"mcpServers": {
"icloud-calendar": {
"command": "npx",
"args": ["@icloud-calendar-mcp/server"],
"env": {
"ICLOUD_USERNAME": "your-apple-id@icloud.com",
"ICLOUD_PASSWORD": "your-app-specific-password"
}
}
}
}{
"mcpServers": {
"icloud-calendar": {
"command": "uvx",
"args": ["icloud-calendar-mcp"],
"env": {
"ICLOUD_USERNAME": "your-apple-id@icloud.com",
"ICLOUD_PASSWORD": "your-app-specific-password"
}
}
}
}{
"mcpServers": {
"icloud-calendar": {
"command": "java",
"args": ["-jar", "/path/to/icloud-calendar-mcp-3.1.0-all.jar"],
"env": {
"ICLOUD_USERNAME": "your-apple-id@icloud.com",
"ICLOUD_PASSWORD": "your-app-specific-password"
}
}
}
}Usage Examples
Once configured, you can ask Claude:
"What's on my calendar this week?"
"Create a meeting with John tomorrow at 2pm"
"Show me all my calendars"
"Delete the dentist appointment on Friday"
"Move my 3pm meeting to 4pm"
Tool Parameters
list_calendars
No parameters required.
get_events
Parameter | Type | Required | Description |
| string | Yes | Calendar identifier |
| string | Yes | Start date (YYYY-MM-DD) |
| string | Yes | End date (YYYY-MM-DD) |
create_event
Parameter | Type | Required | Description |
| string | Yes | Target calendar |
| string | Yes | Event title |
| string | Cond. | ISO 8601 datetime (required for timed events) |
| string | Cond. | ISO 8601 datetime (required for timed events) |
| string | Cond. | Start date YYYY-MM-DD (required for all-day events) |
| string | Cond. | End date YYYY-MM-DD, inclusive (required for all-day events) |
| boolean | No | All-day event flag |
| string | No | Event description |
| string | No | Event location |
| string | No | IANA timezone (e.g., |
| string | No | Recurrence rule (e.g., |
update_event
Parameter | Type | Required | Description |
| string | Yes | Event UID to update |
| string | No | New title |
| string | No | New start time (ISO 8601) |
| string | No | New end time (ISO 8601) |
| string | No | New start date for all-day events (YYYY-MM-DD) |
| string | No | New end date for all-day events (YYYY-MM-DD) |
| boolean | No | Change to all-day event |
| string | No | New description |
| string | No | New location |
| string | No | IANA timezone (e.g., |
| string | No | Recurrence rule (e.g., |
delete_event
Parameter | Type | Required | Description |
| string | Yes | Event to delete |
Note — resolving an event by
event_id:update_eventanddelete_eventlocate the target event in the current session's in-memory cache, which is populated byget_events(and by thecreate_eventthat created it). Within a session the usual flow —get_events→update_event/delete_event— works without any extra step. If you start a fresh session and want to act on an existing event, callget_eventsfor its calendar first so the event is cached. There is no per-request server-side lookup by UID: iCloud rejects a CalDAVcalendar-queryUIDprop-filter(HTTP 412), and an unfiltered query would return the entire calendar, so a stateless UID lookup is not practical.
Security
This server is designed with security as a primary concern, following the OWASP MCP Top 10 guidelines.
Security Controls
Control | Implementation |
Credential Storage | Environment variables only, never logged or exposed |
Input Validation | All inputs validated (calendar IDs, dates, times, text fields) |
SSRF Protection | Blocks internal IPs, localhost, and dangerous URI schemes |
Rate Limiting | Sliding window: 60 reads/min, 20 writes/min |
Error Handling | Passwords, tokens, paths, emails sanitized from errors |
Injection Prevention | ICS content properly escaped, command injection tested |
ETag Normalization | RFC 7232 compliant, strips quotes/W/ prefix/XML entities |
Content-Length Guard | Early rejection of oversized responses before buffering |
Circuit Breaker | Prevents cascading failures with automatic recovery |
Audit Logging | CUD operations logged via MCP logging protocol (MCP08) |
ReDoS Protection | All regex patterns tested for catastrophic backtracking |
Unicode Security | Homoglyph, normalization, and encoding bypass protection |
OWASP MCP Top 10 Coverage
Risk | Mitigation | Tests |
MCP01: Token Mismanagement | Credentials masked in logs/errors, secure storage | 14 |
MCP02: Privilege Escalation | Fixed tool set, no dynamic registration | 5 |
MCP03: Tool Argument Injection | Input validation, parameterized operations | 8 |
MCP04: Sensitive Data Exposure | Error sanitization, credential masking | 10 |
MCP05: Command Injection | Input treated as data, not executed | 3 |
MCP06: Prompt Injection | Malicious text stored as data, not interpreted | 3 |
MCP08: Insecure Logging | Rate limiting, sensitive data sanitization | 31 |
MCP09: Resource Exhaustion | Rate limiting, input size limits, DoS protection | 25 |
MCP10: Context Over-sharing | Isolated state, no cross-request data leakage | 3 |
See SECURITY.md for full security documentation and vulnerability disclosure process.
Testing
The MCP server has 843 tests. The vendored icaldav-core iCalendar library has a
further 1714 tests. Both run with:
./gradlew testTest Coverage (MCP server)
Category | Tests | Description |
Security | 282 | Adversarial inputs, OWASP MCP Top 10, ReDoS, Unicode |
CalDAV Protocol | 181 | XML parsing, HTTP client, models, ETag normalization |
ICS Format | 150 | RFC 5545 parsing, building, patching |
Error Handling | 56 | Secure error responses, credential sanitization |
Integration | 45 | End-to-end tools, MCP spec compliance, annotations |
Input Validation | 44 | All parameter validation rules |
Service Layer | 26 | Calendar operations, caching |
Rate Limiting | 18 | Concurrent access, window reset |
Cancellation | 12 | Operation cancellation, cleanup |
Logging | 9 | MCP logging compliance |
Progress | 9 | Progress reporting |
E2E | 11 | Live CalDAV + end-to-end integration |
Security Test Categories
Category | Tests | Coverage |
Adversarial Inputs | 53 | SQL/NoSQL injection, XSS, path traversal |
ICS Patcher Security | 43 | CRLF injection, property injection, encoding attacks |
Unicode Security | 38 | Homoglyphs, normalization, RTL override |
Logger Security | 31 | Log injection, credential sanitization |
OWASP MCP Risks | 29 | MCP01-10 specific attack vectors |
Progress Security | 27 | Token enumeration, injection |
ReDoS Protection | 25 | Catastrophic backtracking, resource exhaustion |
Cancellation Security | 22 | Replay attacks, race conditions |
Credential Security | 14 | Token masking, secure storage |
Running Specific Tests
# All tests
./gradlew test
# Security tests only
./gradlew test --tests "*SecurityTest*"
./gradlew test --tests "AdversarialTest"
# OWASP MCP specific tests
./gradlew test --tests "OwaspMcpSecurityTest"
# Unicode security tests
./gradlew test --tests "UnicodeSecurityTest"
# ReDoS protection tests
./gradlew test --tests "ReDoSSecurityTest"
# CalDAV tests
./gradlew test --tests "*CalDav*"
# ICS tests
./gradlew test --tests "*Ics*"Architecture
+------------------------------------------------------------------+
| MCP Server (STDIO Transport) |
| |
| +----------------+ +----------------+ +----------------------+ |
| | Rate Limiter | | Input | | Secure Error | |
| | 60r/20w/min | | Validator | | Handler | |
| +----------------+ +----------------+ +----------------------+ |
| |
| +----------------+ +----------------+ +----------------------+ |
| | MCP Logger | | Cancellation | | Progress | |
| | (RFC 5424) | | Manager | | Reporter | |
| +----------------+ +----------------+ +----------------------+ |
| |
| Tools: list_calendars | get_events | create_event | |
| update_event | delete_event |
| |
| Resources: calendar://calendars |
+------------------------------------------------------------------+
|
v
+------------------------------------------------------------------+
| CalendarService |
| Orchestrates CalDAV operations, caches calendar metadata |
+------------------------------------------------------------------+
|
v
+------------------------------------------------------------------+
| CalDAV Client Layer |
| |
| +-------------------+ +-------------------+ +----------------+ |
| | OkHttpCalDav | | IcsParser | | IcsBuilder | |
| | Client | | (icaldav-core) | | (icaldav-core)| |
| +-------------------+ +-------------------+ +----------------+ |
| |
| +-------------------+ +-------------------+ +----------------+ |
| | ICloudXml | | IcsPatcher | | EtagUtils | |
| | Parser | | (event edits) | | (RFC 7232) | |
| +-------------------+ +-------------------+ +----------------+ |
| |
| +-------------------+ |
| | Credential | |
| | Manager | |
| +-------------------+ |
+------------------------------------------------------------------+
|
v
+------------------------------------------------------------------+
| iCloud CalDAV API |
| caldav.icloud.com |
+------------------------------------------------------------------+Development
Build
# Build
./gradlew build
# Build fat JAR
./gradlew fatJar
# Run tests
./gradlew test
# Clean build
./gradlew clean buildProject Structure
src/main/kotlin/org/onekash/mcp/calendar/
├── Main.kt # MCP server entry point
├── caldav/ # CalDAV protocol implementation
│ ├── CalDavClient.kt # Client interface
│ ├── CalDavModels.kt # Domain models
│ ├── OkHttpCalDavClient.kt
│ ├── ICloudXmlParser.kt
│ └── EtagUtils.kt # RFC 7232 ETag normalization
├── ics/ # ICS format handling (via icaldav-core)
│ ├── IcsParser.kt # Parse iCalendar data
│ ├── IcsBuilder.kt # Generate iCalendar data
│ └── IcsPatcher.kt # Patch existing events (CRLF-safe)
├── service/ # Business logic
│ └── CalendarService.kt # CalDAV orchestration + event cache
├── security/ # Security controls
│ └── CredentialManager.kt
├── validation/ # Input validation
│ └── InputValidator.kt
├── error/ # Error handling
│ └── SecureErrorHandler.kt
├── ratelimit/ # Rate limiting
│ └── RateLimiter.kt
├── logging/ # MCP logging
│ └── McpLogger.kt
├── progress/ # Progress reporting
│ └── ProgressReporter.kt
└── cancellation/ # Operation cancellation
└── CancellationManager.ktTesting with MCP Inspector
ICLOUD_USERNAME="test@icloud.com" \
ICLOUD_PASSWORD="test-app-password" \
npx @mcp-use/inspector java -jar build/libs/icloud-calendar-mcp-3.1.0-all.jarContributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Security Issues
For security vulnerabilities, please see SECURITY.md for our responsible disclosure process. Do not open public issues for security vulnerabilities.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Acknowledgments
Model Context Protocol by Anthropic
MCP Kotlin SDK by Anthropic & JetBrains
ical4j for low-level ICS parsing (via the bundled icaldav-core library)
OkHttp for HTTP client
OWASP MCP Top 10 for security guidance
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
- Alicense-qualityDmaintenanceMCP server for accessing macOS Calendar eventsLast updated2MIT
- Alicense-qualityDmaintenanceAn HTTP Model Context Protocol (MCP) server exposing iCloud Calendar (CalDAV) tools so MCP-aware clients can list calendars, read events, and create/update/delete events using an iCloud app-specific password.Last updated2MIT
- Alicense-qualityDmaintenanceMCP server for Apple Calendar via native EventKit API with proper recurring event support.Last updated456MIT
- AlicenseAqualityBmaintenanceMCP server for Apple Calendar and CalDAV providers. Enables listing, creating, updating, deleting events, and checking free/busy status with per-calendar write protection.Last updated2946MIT
Related MCP Connectors
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
MCP server for Withings health data — sleep, activity, heart, and body metrics.
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/icloud-calendar-mcp/icloud-calendar-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server