caldav-mcp
Allows managing iCloud calendars via CalDAV, including creating, reading, updating, and deleting events as well as handling attendees.
Provides read/write access to Nextcloud calendars via CalDAV, enabling event creation, retrieval, updating, deletion, search, and attendee management.
Provides read/write access to ownCloud calendars via CalDAV, enabling event creation, retrieval, updating, deletion, search, and attendee management.
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., "@caldav-mcpWhat events do I have this week?"
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.
caldav-mcp
Give your AI assistant a calendar. An MCP server that provides read/write access to any CalDAV-compatible calendar — Nextcloud, Radicale, Baikal, ownCloud, iCloud, Fastmail, and more — via 14 purpose-built tools.
Why caldav-mcp?
Dockerized | Multi-stage Alpine-based image, non-root execution, built-in healthcheck. Deploy anywhere Docker runs. |
Python 3.13 | Clean, typed codebase with Pydantic validation. Easy to read, easy to extend. |
Single container | One |
Stateless | No session state between requests. Credentials travel per-request in HTTP headers, enabling multi-tenant use without server restarts. |
Secure by default | Constant-time token comparison, per-IP rate limiting with exponential backoff, input sanitization, structured audit logging, no secrets in error responses. |
Two-layer auth | Optional API key protects the MCP endpoint; CalDAV credentials are injected per-request. Independent, composable, zero surprises. |
Related MCP server: mcp-labrat
Where it shines
AI-powered calendar management — Let Claude, Codex, or any MCP client create, update, search, and delete events through natural language.
Multi-tenant access — Send different
X-Caldav-*headers per request to access different CalDAV accounts from a single server instance.Self-hosted calendar automation — Pairs with your existing Nextcloud, Radicale, or Baikal server. No cloud dependency.
Enterprise / team deployments — Centralized, stateless, containerized. Deploy behind a reverse proxy, scale horizontally, rotate credentials without downtime.
Quick start
# 1. Clone the repo
git clone https://git.gelse.net/werner/caldav-mcp.git && cd caldav-mcp
# 2. Create your .env file
cp .env.example .env
# Edit .env — at minimum set CALDAV_MCP_API_KEY, CALDAV_URL, CALDAV_USERNAME, CALDAV_PASSWORD
# 3. Launch
docker compose up -d
# 4. Verify
curl -s http://localhost:8600/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Caldav-Url: https://cloud.example.com/remote.php/dav/calendars/user/" \
-H "X-Caldav-Username: user" \
-H "X-Caldav-Password: app-password" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1"}}}'The server is now reachable at http://localhost:8600/mcp (Streamable HTTP).
Tools
The server exposes 14 MCP tools across three categories.
Queries (read-only)
Tool | Description |
List all available calendars | |
Get events in a date range | |
Get events for today | |
Get events for the next 7 days | |
Get a specific event by UID (including attendees) | |
Search events by text across summary, description, location, and categories | |
Get free/busy information for a time range |
Mutations (write)
Tool | Description |
Create a new event — supports RRULE, priority, categories, attendees | |
Partially update an existing event by UID | |
Delete an event by UID | |
Move an event between calendars |
Attendees
Tool | Description |
Add an attendee to an event | |
Remove an attendee from an event | |
List attendees of an event |
Deployment
Docker
The project ships with a multi-stage Dockerfile:
Builder stage — installs Python dependencies from
requirements.txtinto a clean prefix.Runtime stage — copies pre-built packages into a minimal Alpine image, runs as a non-root
appuser, exposes port8080.
docker build -t caldav-mcp:latest .
docker run -p 8600:8080 \
-e CALDAV_MCP_API_KEY=YOUR_KEY \
-e CALDAV_URL=https://cloud.example.com/remote.php/dav/calendars/user/ \
-e CALDAV_USERNAME=user \
-e CALDAV_PASSWORD=app-password \
caldav-mcp:latestDocker Compose
docker-compose.yaml maps host port 8600 to
container port 8080 and reads environment variables from a local .env
file:
services:
caldav-mcp:
build: .
image: caldav-mcp:latest
restart: unless-stopped
ports:
- "8600:8080"
environment:
CALDAV_MCP_API_KEY: "${CALDAV_MCP_API_KEY:-}"
TZ: Europe/Viennadocker compose up -dA docker-compose.test.yaml is also available for
integration testing — it includes a Radicale CalDAV server.
TLS / HTTPS
The server supports built-in TLS without a reverse proxy. Set these environment variables to enable HTTPS directly:
CALDAV_MCP_TLS_CERT=/path/to/cert.pem
CALDAV_MCP_TLS_KEY=/path/to/key.pem
CALDAV_MCP_TLS_CA_BUNDLE=/path/to/ca.pem # optionalWhen TLS is enabled, the server listens on HTTPS. When unset, run it behind a reverse proxy (Traefik, Caddy, nginx) that terminates TLS.
Authentication
Two independent layers — both optional but recommended.
Layer 1: MCP endpoint auth
When CALDAV_MCP_API_KEY is set, every request to the /mcp
endpoint must include one of:
Authorization: Bearer <token>X-Api-Key: <token>
The token is compared using constant-time comparison to prevent timing side-channel attacks. Failed attempts are tracked per client IP using a sliding-window rate limiter with exponential backoff.
When CALDAV_MCP_API_KEY is unset, the endpoint is open — do not expose it
to the public internet without authentication.
Layer 2: CalDAV credentials
CalDAV credentials are resolved per-request:
HTTP headers (preferred):
X-Caldav-Url,X-Caldav-Username,X-Caldav-PasswordEnvironment variables (fallback):
CALDAV_URL,CALDAV_USERNAME,CALDAV_PASSWORD
HTTP headers take precedence. This enables multi-tenant usage — different clients can target different CalDAV accounts without restarting the server.
Configuration
All configuration is via environment variables, validated at startup with Pydantic.
Server
Variable | Default | Description |
|
| Listen port (inside container) |
|
| Streamable HTTP endpoint path |
|
| Shared secret for MCP endpoint auth |
|
| IANA timezone (e.g. |
CalDAV
Variable | Default | Description |
|
| CalDAV server URL (fallback for |
|
| CalDAV username (fallback for |
|
| CalDAV password (fallback for |
|
| Verify TLS certs on CalDAV connections. Set |
Rate limiting
Variable | Default | Description |
|
| Max failed auth attempts per IP within the sliding window |
|
| Sliding window duration in seconds |
TLS
Variable | Default | Description |
|
| Path to TLS certificate PEM file |
|
| Path to TLS private key PEM file |
|
| Optional CA bundle for custom certificate authorities |
Logging
Variable | Default | Description |
|
| Audit log format: |
Security
Put the server behind a reverse proxy that terminates TLS, or enable built-in TLS.
Set a strong
CALDAV_MCP_API_KEY.Restrict access at the network/firewall layer to trusted hosts or a VPN.
Prefer binding to
127.0.0.1unless you explicitly need remote access.Never place CalDAV app passwords in public configuration or logs.
Development
Commands
make test # Run unit tests
make test-integration # Run integration tests (requires docker-compose.test.yaml)
make test-performance # Run performance benchmarks
make lint # Lint with ruff (check + format)
make typecheck # Type check with mypy
make check # All checks: lint + typecheck + deps-check + test
make deps-check # Verify pyproject.toml and requirements.txt are in sync
make build # Build Docker imageProject structure
caldav-mcp/
├── server.py # Thin entrypoint, launches FastMCP HTTP server
├── caldav_mcp/ # Core package
│ ├── tools/ # MCP tool handlers
│ │ ├── queries.py # Read-only tools (7)
│ │ ├── mutations.py # Write tools (4)
│ │ └── attendees.py # Attendee management (3)
│ ├── auth.py # Two-layer auth (API key + CalDAV creds)
│ ├── calendar.py # CalDAV calendar selection & serialization
│ ├── client_cache.py # Thread-safe LRU cache for DAVClient
│ ├── config.py # Env var parsing, header constants
│ ├── config_schema.py # Pydantic startup validation
│ ├── datetime_utils.py # Date/time parsing, timezone helpers
│ ├── errors.py # Typed exceptions, ToolResult dataclass
│ ├── event_builder.py # Pure iCalendar VEVENT construction
│ ├── sanitizers.py # Input sanitization, field length limits
│ ├── rate_limit.py # Sliding-window rate limiter
│ ├── audit.py # Structured JSON audit logging
│ ├── constants.py # Shared string constants
│ └── types.py # CalDAVClient Protocol definition
├── tests/ # Unit, integration, performance
├── docs/ # Architecture, API, contributing docs
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yaml # Production compose
├── docker-compose.test.yaml # Test compose with Radicale
├── requirements.txt # Runtime dependencies (pinned)
├── pyproject.toml # Dev config and dependencies
└── Makefile # Build/test shortcutsDependencies
Package | Version | Purpose |
3.4.7 | MCP server framework, Streamable HTTP transport | |
3.2.1 | CalDAV client library | |
7.2.2 | iCalendar RFC 5545 parsing/generation | |
>=2.28.0 | HTTP transport layer |
Troubleshooting
Symptom | Cause | Fix |
| CalDAV server unreachable | Verify |
| Self-signed or invalid TLS cert | Import the server's CA into the system trust store, or use a valid certificate |
| Missing or invalid API token | Set |
| No CalDAV headers or env vars | Provide |
| Typo or wrong calendar name | Run |
Events show wrong time | Server timezone not set | Set the |
FAQ
Q: Can I use this with multiple CalDAV accounts?
A: Yes — send different X-Caldav-Url / X-Caldav-Username / X-Caldav-Password headers per request. The client cache keys on (url, username).
Q: What CalDAV servers are supported? A: Any server implementing the CalDAV standard: Nextcloud, ownCloud, iCloud, Fastmail, Baikal, Radicale, and others.
Q: Is the API token transmitted securely? A: Only when using HTTPS. Enable built-in TLS or place the server behind a TLS-terminating reverse proxy.
Q: How do I generate a CalDAV app password? A: Depends on your provider. Nextcloud: Settings → Security → App Passwords. iCloud: Use an app-specific password from appleid.apple.com.
Q: Can I use this over stdio instead of HTTP?
A: The current server uses Streamable HTTP transport only. To use stdio, modify server.py to call mcp.run() instead of mcp.run_http_async().
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
- AlicenseNot gradedqualityAmaintenanceAn MCP server that exposes CalDAV calendar operations as tools for AI assistants. It enables users to connect to CalDAV servers to create and list calendar events within specific timeframes.43297MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with CalDAV calendars to manage events and check availability through natural language or voice commands. It provides specific tools for listing, searching, and creating calendar entries using an OpenAI-compatible interface.
- AlicenseNot gradedqualityFmaintenanceProvider-agnostic CalDAV calendar MCP server that connects any CalDAV calendar to AI assistants, enabling calendar operations like listing, creating, updating, and deleting events.AGPL 3.0
- AlicenseNot gradedqualityFmaintenanceA comprehensive MCP server that provides AI assistants with natural language access to Apple Calendar, enabling reading, searching, creating, and managing calendar events.3MIT
Related MCP Connectors
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
Calendar API for AI agents: events, availability, Google/Microsoft setup, scheduling, and iCal.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
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/gelse/caldav-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server