Google Calendar MCP Server

Google Calendar MCP Server

Enables reading, analyzing, creating, and managing Google Calendar events across multiple accounts through natural language, with features like meeting pattern analysis and scheduling preferences.

Category
访问服务器

README

Google Calendar MCP Server

MCP server for accessing and analyzing Google Calendar events through the Model Context Protocol.

Features

  • 📅 Access ALL your calendars - Primary, work, shared calendars, everything!
  • 👥 Multi-account support - Use multiple Google accounts (e.g., personal + work) with automatic account selection
  • Create calendar events - Schedule meetings with invites coming from the correct account
  • Accept/decline invitations - Respond to calendar invites
  • 🗑️ Delete events - Remove calendar entries
  • 🔍 Find when you last met with someone
  • 📊 Analyze meeting patterns and time blocks
  • 🎯 Distinguish between deep work and flexible time blocks
  • ⚡ Answer questions like "What do I need to be prepared for?"
  • 🔗 Integrates with spark-mcp for unified meeting context
  • 📋 List and search events across all your calendars at once

Requirements

  • Python 3.10+
  • Google Cloud project with Calendar API enabled
  • OAuth2 credentials (see setup below)

Installation

# Install in development mode
pip install -e .

Setup

1. Create Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project:
    • Click "Select a project" at the top
    • Click "New Project"
    • Name: Calendar MCP (or your choice)
    • Click "Create"
  3. Enable the Google Calendar API:
    • In left sidebar: "APIs & Services" → "Library"
    • Search for "Google Calendar API"
    • Click on it, then click "Enable"

2. Configure OAuth Consent Screen

Important: Do this BEFORE creating credentials

  1. In left sidebar: "APIs & Services" → "OAuth consent screen"
  2. If you see "Overview" page with metrics, look for navigation in left sidebar
  3. Click on "Audience":
    • Click "ADD USERS"
    • Add your Google email address
    • Click "Add" then "Save"
  4. Click on "Data Access" in left sidebar:
    • Click "Add or Remove Scopes"
    • Search for "Google Calendar API"
    • Check: .../auth/calendar (full access for read/write operations)
    • Click "Update"
    • Click "Save"

3. Create OAuth Client Credentials

  1. In left sidebar: Click "Clients"
  2. Click "CREATE CLIENT" or similar button
  3. Choose:
    • Application type: Desktop app
    • Name: calendar-mcp-client
  4. Click "Create"
  5. You'll see the client created - click on it
  6. In "Client secrets" section:
    • Click "+ Add secret"
    • Copy the new secret OR click download
  7. Download the JSON file (should auto-download or look for download option)
  8. Save as client_secret.json in /Users/feamster/src/calendar-mcp/

Note: The Google Cloud Console interface uses "OAuth Platform" with Audience/Data Access/Clients, not the old consent screen wizard.

4. Authenticate

Run the authentication setup:

python -m calendar_mcp.auth

This will:

  • Open your browser for Google OAuth consent
  • Ask you to grant Calendar read and write permissions
  • Save the refresh token to ~/.mcp-auth/calendar/tokens/

Important: Google will show a warning "Google hasn't verified this app" because this is your personal project. This is normal and safe:

  • Click "Advanced"
  • Click "Go to Calendar MCP (unsafe)"
  • Grant the calendar read and write permissions

4b. Multi-Account Setup (Optional)

To use multiple Google accounts (e.g., personal + work), add each account:

# Add your first account
python -m calendar_mcp.auth add feamster@gmail.com

# Add your work account and set as default
python -m calendar_mcp.auth add feamster@uchicago.edu --default

# List configured accounts
python -m calendar_mcp.auth list

# Change default account
python -m calendar_mcp.auth default feamster@uchicago.edu

How multi-account works:

  • When creating events, the account is automatically selected based on the calendarId
  • If calendarId="feamster@uchicago.edu", invites come FROM that account
  • If calendarId="feamster@gmail.com", invites come FROM that account
  • You can also explicitly specify account parameter to override

Example usage after setup:

# Creates event on UChicago calendar, invite FROM feamster@uchicago.edu
create_event(summary="Meeting", calendarId="feamster@uchicago.edu", attendees=["someone@example.com"])

# Creates event on Gmail calendar, invite FROM feamster@gmail.com
create_event(summary="Personal", calendarId="feamster@gmail.com", attendees=["friend@example.com"])

Calendar display names: calendarId accepts a calendar's display name in addition to its raw id. create_event(calendarId="Chemster Events") resolves to the underlying ...@group.calendar.google.com id by matching against the summary/summaryOverride fields returned by list_all_calendars (case- insensitive, trimmed). If a name is shared across accounts pass account=... to disambiguate; an unknown name returns a structured error listing the available calendars. primary and raw ids are passed through unchanged.

5. Configure Meeting Preferences (Optional)

Create ~/.mcp-config/calendar/config.json to customize your scheduling preferences:

{
  "preferences": {
    "timezone": "America/New_York",
    "meetingPreferences": {
      "preferAdjacentToMeetings": true,
      "preferredMeetingDuration": 30,
      "avoidDeepWorkBlocks": true,
      "deepWorkBlockUsage": "end",
      "neverAvailablePatterns": ["kids"],
      "preferredDays": {
        "Wednesday-PM": 100,
        "Thursday": 100,
        "Monday-PM": 70,
        "Tuesday": 40,
        "Friday": 40
      },
      "afternoonStartHour": 12,
      "notes": "SCHEDULING PRIORITY: 1. BEST (100): Wed PM & Thu. 2. GOOD (70): Mon PM. 3. LAST RESORT (40): Tue & Fri. Prefer 30-min slots adjacent to meetings. Avoid deep work blocks. Never schedule over 'kids' blocks."
    },
    "flexibleBlockPatterns": ["flexible", "optional", "buffer", "hold"],
    "deepWorkPatterns": ["deep work", "focus time", "writing", "research", "reading"]
  }
}

Meeting Preference Options:

  • preferAdjacentToMeetings: Suggest times next to existing meetings
  • preferredMeetingDuration: Default meeting length in minutes
  • avoidDeepWorkBlocks: Try not to suggest deep work time
  • deepWorkBlockUsage: "end" = use end of block if needed, "start" = use start, "avoid" = never use
  • neverAvailablePatterns: Keywords for completely unavailable blocks
  • preferredDays: Day-of-week ranking system (0-100 scale)
    • Higher scores = stronger preference (100 = most preferred, 40 = least preferred, 0 = avoid)
    • Use full day names: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"
    • For afternoon-only preferences: "Monday-PM", "Wednesday-PM", etc.
    • Example ranking:
      • "Wednesday-PM": 100 and "Thursday": 100 = BEST days (strongly prefer)
      • "Monday-PM": 70 = GOOD day (acceptable)
      • "Tuesday": 40 and "Friday": 40 = LAST RESORT (avoid if better options exist)
    • The MCP will prioritize suggesting times on higher-scored days
  • afternoonStartHour: Hour when afternoon starts (default: 12 = noon)
  • notes: Human-readable description explaining your preferences for Claude to understand

6. Configure Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "calendar": {
      "command": "python",
      "args": ["-m", "calendar_mcp.server"],
      "cwd": "/Users/feamster/src/calendar-mcp"
    }
  }
}

If you have other MCP servers (like spark-mcp), add the "calendar" section to your existing "mcpServers" object.

7. Test the Installation (Optional but Recommended)

Before configuring Claude Desktop, verify everything works:

python test_calendar.py

You should see:

  • ✓ Credentials loaded successfully
  • ✓ Calendar client initialized
  • ✓ Found X events
  • ✓ All tests completed

8. Restart Claude Desktop

Restart Claude Desktop to load the new MCP server.

Usage

Once configured, ask Claude questions like:

Meeting Queries:

  • "What meetings do I have today?"
  • "Show me my calendar for the next week"
  • "What do I need to be prepared for?"
  • "Tell me about my 2pm meeting"

Relationship Tracking:

  • "When was the last time I met with john@example.com?"
  • "Show me all my meetings with the engineering team"
  • "Who do I meet with most often?"

Time Analysis:

  • "How many hours of meetings did I have this week?"
  • "Analyze my calendar blocks for today"
  • "Summarize my meetings from the past week"
  • "Am I free tomorrow at 2pm?"

Finding Meeting Times (with preferences):

  • "Find me times for a 30-minute meeting this week"
  • "When should I schedule a call with John?"
  • "What are my best meeting times next week?"
  • "Suggest times for a 1-hour meeting"

When finding meeting times, the MCP will:

  • Prioritize your preferred days (e.g., Wed PM & Thu over Tue & Fri)
  • Look for slots adjacent to existing meetings (if enabled)
  • Avoid deep work blocks (but use them as last resort if needed)
  • Never suggest times with "kids" or other never-available patterns

Managing Calendar Events:

  • "Create a meeting titled 'Project Review' tomorrow at 2pm for 1 hour"
  • "Schedule a 30-minute call with john@example.com on Thursday at 3pm"
  • "Add a meeting on Friday at 10am with sarah@example.com and bob@example.com"
  • "Delete the meeting about quarterly planning"
  • "Accept the invitation for tomorrow's standup"
  • "Decline the Friday afternoon meeting"
  • "Mark the project kickoff as tentative"

Integration with spark-mcp: If you have both calendar-mcp and spark-mcp installed:

  • "Show me the transcript from my meeting with X last Tuesday"
  • "Summarize all my meetings and their transcripts from last week"
  • "What were the action items from recent meetings?"

Available Tools

1. list_accounts

List all configured Google accounts for multi-account calendar access. Shows which accounts are set up and which is the default.

2. list_all_calendars

List all calendars you have access to (primary, work, shared, etc.)

3. list_calendar_events

List calendar events from ALL your calendars with filtering by time range, search query, etc. Each event shows which calendar it's from.

4. get_upcoming_meetings

Get upcoming meetings for preparation, includes time until meeting and attendee info.

5. find_meetings_with_person

Find when you last met with someone (by email or name).

6. get_meeting_by_id

Get full details of a specific calendar event.

7. analyze_time_blocks

Analyze calendar blocks and distinguish between deep work and flexible time.

8. summarize_meetings

Get summaries of meetings grouped by day, week, or person.

9. check_availability

Check if you're available at a proposed time.

10. find_meeting_times

Find best available meeting times based on your preferences (day ranking, adjacent to meetings, avoid deep work).

11. create_event

Create a new calendar event with optional attendees and automatic invitation emails. Multi-account: Automatically selects the correct Google account based on calendarId. Recurring events: Pass recurrence (structured) or recurrenceRrule (raw RFC 5545) to create a series:

# MWF for 3 weeks
recurrence = {"freq": "WEEKLY", "by_day": ["MO", "WE", "FR"], "until": "2026-07-24"}

# First Monday of every month, for a year
recurrence = {"freq": "MONTHLY", "by_day": ["MO"], "by_set_pos": [1], "count": 12}

# MWF for 3 weeks, skipping July 13
recurrence = {"freq": "WEEKLY", "by_day": ["MO", "WE", "FR"], "until": "2026-07-24", "exceptions": ["2026-07-13"]}

Supported keys: freq (DAILY/WEEKLY/MONTHLY/YEARLY), interval, by_day, by_month_day, by_month, by_set_pos, count (mutually exclusive with until), until (ISO date or datetime — bare dates interpreted as end-of-day in start's timezone), exceptions (list of ISO dates to skip via EXDATE). The response includes an occurrence_count so you can verify the series size without listing instances.

12. update_event_recurrence

Modify the recurrence rule of an existing event without deleting and recreating:

  • scope="series" (default): replace the RRULE on the master event (pass recurrence=null to clear).
  • scope="this_and_following": split the series at splitAt — shortens the original's UNTIL to just before splitAt and inserts a new event with the new rule starting at splitAt.
  • scope="single": apply the change to a single instance (pass the instance event id, not the master id).

13. delete_event

Delete a calendar event with optional cancellation notifications to attendees.

14. respond_to_event

Accept, decline, or tentatively accept a calendar invitation.

Block Type Detection

The server can distinguish between different types of calendar blocks:

  • Deep Work: Focus time, writing, research (hard blocks)
  • Flexible: Buffer time, optional blocks (can accommodate last-minute requests)
  • Meetings: Scheduled meetings
  • Out of Office: Hard blocks

Configure patterns in ~/.mcp-config/calendar/config.json:

{
  "preferences": {
    "flexibleBlockPatterns": ["flexible", "optional", "buffer"],
    "deepWorkPatterns": ["deep work", "focus time", "writing", "research"]
  }
}

Integration with spark-mcp

If you have spark-mcp installed, the calendar MCP can cross-reference calendar events with meeting transcripts to provide unified context.

Troubleshooting

Authentication errors

  1. Check credentials file exists:

    ls ~/.mcp-auth/calendar/credentials.json
    
  2. Re-run authentication:

    python -m calendar_mcp.auth
    
  3. Verify API is enabled in Google Cloud Console

No events returned

  1. Check date range in your query
  2. Verify you have events in your Google Calendar
  3. Check token has proper scopes

Server not connecting

  1. Check Claude Desktop logs:

    tail -f ~/Library/Logs/Claude/mcp-server-calendar.log
    
  2. Verify config syntax in claude_desktop_config.json

  3. Make sure Python path is correct in config

  4. Try running server directly to check for errors:

    cd /Users/feamster/src/calendar-mcp
    python -m calendar_mcp.server
    # Should start without errors (Ctrl+C to exit)
    

"Google hasn't verified this app" warning

This is normal for personal projects. Your app is safe because you created it.

Solution:

  • Click "Advanced" on the warning page
  • Click "Go to Calendar MCP (unsafe)"
  • Grant the permissions

API quota exceeded

Google Calendar API has rate limits (1M queries/day). If you hit limits:

  • Wait a few minutes
  • Most queries use only 1-2 quota units
  • Normal usage won't hit limits

Testing & Development

Test Installation

# Test authentication status
python -m calendar_mcp.auth --test

# Run full test suite
python test_calendar.py

Development Mode

# Install in development mode
pip install -e .

# Make changes to calendar_mcp/*.py files
# Restart Claude Desktop to reload changes

Project Structure

calendar-mcp/
├── calendar_mcp/
│   ├── __init__.py
│   ├── auth.py              # OAuth2 authentication (multi-account support)
│   ├── calendar_client.py   # Google Calendar API wrapper
│   └── server.py            # MCP server implementation
├── test_calendar.py         # Test script
├── setup.py                 # Package installer
├── README.md               # This file
├── SETUP.md                # Detailed setup instructions
├── QUICKSTART.md           # Quick start guide
└── SPEC.md                 # Technical specification

~/.mcp-config/calendar/
├── accounts.json            # Multi-account configuration
└── config.json              # User preferences (ignored calendars, meeting prefs)

~/.mcp-auth/calendar/
├── credentials.json         # OAuth client credentials
└── tokens/                  # Per-account OAuth tokens
    ├── feamster_at_gmail_com.json
    └── feamster_at_uchicago_edu.json

Privacy & Security

  • Full calendar access: Requests calendar scope for read and write operations
  • Local credentials: Tokens stored locally in ~/.mcp-auth/calendar/
  • No data caching: Doesn't cache calendar data
  • Secure token handling: Automatic refresh token management
  • Notification control: You can disable email notifications when creating/deleting events

Documentation

  • README.md (this file) - Overview and usage
  • QUICKSTART.md - Get started in 10 minutes
  • SETUP.md - Detailed setup instructions with troubleshooting
  • SPEC.md - Complete technical specification

Future Enhancements

See SPEC.md for detailed roadmap, including:

  • Action item extraction from meeting descriptions
  • Update existing events (modify time, location, description)
  • Smart scheduling suggestions
  • Advanced meeting analytics
  • Recurring meeting instance management (list/override individual instances of a series)
  • Cross-referencing with spark-mcp transcripts

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选