loading…
Search for a command to run...
loading…
MCP server for Apple Calendar using compiled Swift to bypass macOS Sequoia TCC restrictions
MCP server for Apple Calendar using compiled Swift to bypass macOS Sequoia TCC restrictions
Sealjay/mcp-ical-swift MCP server Bun Swift MCP License: MIT macOS GitHub issues GitHub stars
A local MCP server for Apple Calendar that uses a compiled Swift binary to bypass macOS TCC restrictions blocking headless processes from accessing calendars.
mcp-ical-swift has two parts: a Bun/TypeScript MCP server that exposes calendar tools over stdio, and a compiled Swift binary that accesses EventKit directly. The Swift binary works because swiftc-compiled executables are Apple-signed and inherit Calendar TCC from the system toolchain — bypassing the restrictions that block Node, Bun, Python, and AppleScript in headless contexts. Everything runs locally — no network, no API keys, no cloud.
ICAL_ALLOW_WRITE=true)xcode-select --install) for swiftcClone this repository
git clone https://github.com/Sealjay/mcp-ical-swift.git
cd mcp-ical-swift
Install dependencies and build
bun install
bun run build
The build step compiles src/calendar-reader.swift into bin/calendar-reader.
All clients use the same command/args shape. On macOS, you may need the absolute path to bun — see macOS: bun PATH below.
The quickest route is the CLI:
claude mcp add --transport stdio ical --scope user -- bun run /absolute/path/to/mcp-ical-swift/src/index.ts
With write operations enabled:
claude mcp add --transport stdio ical --scope user -e ICAL_ALLOW_WRITE=true -- bun run /absolute/path/to/mcp-ical-swift/src/index.ts
Alternatively, add to .mcp.json at your project root (or ~/.claude.json for user scope):
{
"mcpServers": {
"ical": {
"type": "stdio",
"command": "bun",
"args": ["run", "/absolute/path/to/mcp-ical-swift/src/index.ts"]
}
}
}
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ical": {
"command": "bun",
"args": ["run", "/absolute/path/to/mcp-ical-swift/src/index.ts"]
}
}
}
Restart Claude Desktop. You should see ical listed as an available integration.
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"ical": {
"command": "bun",
"args": ["run", "/absolute/path/to/mcp-ical-swift/src/index.ts"]
}
}
}
Restart Cursor.
bun PATHGUI apps (Claude Desktop, Cursor) don't always inherit PATH from your interactive terminal, so bun may fail with spawn bun ENOENT. Fix by using the absolute path in command:
/opt/homebrew/bin/bun/usr/local/bin/bunwhich bun in your terminalWrite tools (ical__create_event, ical__update_event, ical__delete_event) are disabled by default. Set ICAL_ALLOW_WRITE=true to enable them:
ICAL_ALLOW_WRITE=true bun run start
Or in your MCP client config:
{
"mcpServers": {
"ical": {
"command": "bun",
"args": ["run", "/absolute/path/to/mcp-ical-swift/src/index.ts"],
"env": { "ICAL_ALLOW_WRITE": "true" }
}
}
}
| Component | Description |
|---|---|
| MCP server | Bun/TypeScript, stdio transport, Zod input validation |
| Swift binary | Compiled with swiftc, accesses EventKit framework |
| Communication | execFileSync with array args (no shell interpolation) |
| Output | JSON via JSONSerialization (prevents injection from user strings) |
MCP Client (Claude, Cursor, etc.)
→ stdio → Bun MCP server (src/index.ts)
→ execFileSync → compiled Swift binary (bin/calendar-reader)
→ EventKit → Apple Calendar
The Swift binary is compiled once (bun run build) and called synchronously for each tool invocation. It outputs JSON to stdout, which the MCP server wraps in tool results.
mcp-ical-swift/
src/
index.ts # MCP server entry point, tool definitions, Zod schemas
calendar-reader.swift # Swift EventKit binary source
bin/
calendar-reader # Compiled binary (gitignored)
package.json
On macOS Sequoia and later, headless processes cannot obtain Calendar access through TCC (Transparency, Consent, and Control):
kTCCServiceCalendar, which needs a system dialog that headless processes cannot trigger.osascript requires kTCCServiceAppleEvents, attributed to the calling binary (node/bun). Direct TCC database edits are silently ignored.A swiftc-compiled binary produces an Apple-signed Mach-O executable that inherits Calendar TCC from the system Swift toolchain. When spawned via execFileSync, EventKit reports authorizationStatus = .fullAccess.
7 tools in two groups.
| Tool | Purpose |
|---|---|
ical__list_calendars |
List all Apple Calendar calendars |
ical__list_events |
List events within a date range (YYYY-MM-DD); optional calendar filter and include_notes |
ical__search_events |
Search events by keyword (default: 30 days ahead); optional calendar filter and include_notes |
ical__get_event |
Get full details of an event by UID; optional include_notes |
ICAL_ALLOW_WRITE=true)| Tool | Purpose |
|---|---|
ical__create_event |
Create a new event (title, start, end, calendar, location, notes, all-day) |
ical__update_event |
Update an existing event by UID |
ical__delete_event |
Delete an event by UID |
calendar parameter on list_events and search_events.include_notes: true per-request to opt in. Notes may contain sensitive data (meeting PINs, passwords, personal details).ICAL_ALLOW_WRITE=true (off by default). Even when enabled, there is no per-operation confirmation step — an MCP client (or a prompt injection within one) could modify your calendar data.See SECURITY.md for how to report vulnerabilities.
.thisEvent span), not the series.The compiled binary needs to be run at least once from a context that has Calendar TCC. Build and test:
bun run build
bin/calendar-reader list-events $(date +%Y-%m-%d)
If this returns events, the binary has Calendar access. If not, try running from Terminal.app (which typically has Calendar TCC granted).
Check that you have calendars configured in Apple Calendar:
bin/calendar-reader list-calendars
Ensure Xcode Command Line Tools are installed:
xcode-select --install
args must use an absolute path, not relative. If bun itself fails with spawn bun ENOENT, see macOS: bun PATH.
Contributions welcome via pull request. Please:
feat, fix, docs, refactor, test).bun test passes.Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-ical-swift": {
"command": "npx",
"args": []
}
}
}