Skip to content

Fix Calendar permissions for VS Code and other IDE-based MCP clients - #1

Open
jackrichins wants to merge 1 commit into
harriscarl:mainfrom
jackrichins:main
Open

Fix Calendar permissions for VS Code and other IDE-based MCP clients#1
jackrichins wants to merge 1 commit into
harriscarl:mainfrom
jackrichins:main

Conversation

@jackrichins

Copy link
Copy Markdown

Summary

  • Fix macOS 14+ Calendar permissions: Use requestFullAccessToEventsWithCompletion_ and requestFullAccessToRemindersWithCompletion_ instead of the deprecated requestAccessToEntityType_completion_, which silently fails for Calendar when run from IDE subprocesses (VS Code, Cursor, etc.)
  • Auto-grant Calendar to IDE apps via TCC database: macOS TCC requires both the direct binary (uv/python) AND the responsible app (e.g., VS Code) to have permission. IDEs cannot trigger the Calendar permission dialog, but if they already have Reminders permission, the setup script now copies that TCC entry to Calendar for all known MCP clients.
  • Handle WRITE_ONLY status (macOS 14+): Calendar can have write-only access (status 4) which is insufficient — the code now correctly detects this and requests full access.

Problem

On macOS 14+, the deprecated requestAccessToEntityType_completion_ API silently fails to show a Calendar permission dialog when run from IDE integrated terminals (VS Code, Cursor, Windsurf). Reminders still works with the old API, but Calendar does not. Additionally, macOS TCC has a dual-requirement: both the binary AND the parent app need permission, which IDEs cannot obtain for Calendar on their own.

Solution

  1. permissions.py: Updated to use macOS 14+ full-access APIs, handle WRITE_ONLY status, and direct users to run setup from Terminal.app
  2. setup_permissions.py: Major rewrite to:
    • Use macOS 14+ APIs with NSApplication event loop for dialog presentation
    • Automatically detect and grant Calendar permission to all known MCP clients (VS Code, Cursor, Claude Desktop, Windsurf) by copying their Reminders TCC entry
    • Use schema-agnostic TCC database queries (PRAGMA table_info) for forward compatibility

Test plan

  • Run uv run python scripts/setup_permissions.py from Terminal.app — should show Calendar/Reminders dialogs and grant permissions
  • After granting, verify Calendar works from VS Code integrated terminal via the MCP server
  • Verify check_permissions MCP tool reports both Calendar and Reminders as authorized
  • Test on macOS 14+ (Sonoma/Sequoia/Tahoe) to confirm full-access APIs are used

🤖 Generated with Claude Code

macOS TCC (Transparency, Consent, and Control) has two requirements
that prevent Calendar from working in IDE terminals:

1. On macOS 14+, the deprecated requestAccessToEntityType_completion_
   silently fails for Calendar. Switch to requestFullAccessToEvents-
   WithCompletion_ and requestFullAccessToRemindersWithCompletion_.

2. TCC requires BOTH the direct binary (uv/python) AND the responsible
   app (VS Code, Cursor, etc.) to have permission. IDEs cannot trigger
   the Calendar permission dialog, so the setup script must be run from
   Terminal.app to grant permission to the uv binary.

After the dialog grants permission to uv, the script automatically
detects the parent IDE (via TERM_PROGRAM, VSCODE_PID) and copies its
existing Reminders TCC entry to Calendar — no manual database
manipulation needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jackrichins

Copy link
Copy Markdown
Author

Just sharing what I got to work - feel free to reject or modify heavily, but since I found this project so useful just wanted to share back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant