jnpacker/gcal-mcp-server
If you are the rightful owner of gcal-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Google Calendar MCP Server is a comprehensive Model Context Protocol server designed to integrate Google Calendar functionalities with AI assistants, enabling advanced calendar management and intelligent scheduling.
Google Calendar MCP Server
A comprehensive Model Context Protocol (MCP) server that provides intelligent Google Calendar integration for AI assistants. This server enables advanced calendar management, smart event scheduling, attendee coordination, availability checking, RSVP management, and day organization through a standardized interface.
š Latest Updates
- Advanced RSVP Management: Accept, decline, or mark meetings as tentative using simple commands
- Smart Day Organization: Automatically reorganize your calendar for optimal productivity
- Timeline Visualization: Gantt chart-style timeline view for better schedule visualization
- Intelligent Conflict Detection: Automatic overlap detection with visual indicators
- Enhanced AI Integration: Command-based integrations for Claude and Gemini (TODO: Cursor)
- Attendee Availability Validation: Mandatory free/busy checking before event creation
- Meeting Filtering: Smart filtering for "remaining today" events and time-based queries
Features
šļø Event Management
- Create Events: Full-featured event creation with all Google Calendar options
- Edit Events: Update any aspect of existing events with true PATCH semantics
- Delete Events: Remove events with proper attendee notifications
- Recurring Events: Support for complex recurrence patterns
- RSVP Management: Accept, decline, or mark meetings as tentative using meeting numbers
- Event Filtering: Smart filtering for "remaining today" and time-based queries
š„ Attendee Management
- Attendee Search: Find and validate attendee email addresses
- Free/Busy Checking: Mandatory availability checking across multiple calendars
- Smart Scheduling: Automatic conflict detection and resolution
- Availability Validation: Pre-event creation availability verification for all attendees
š§ Advanced Features
- Google Meet Integration: Automatic conference link generation
- Custom Reminders: Email and popup notifications
- Timezone Support: Handle multi-timezone meetings
- Guest Permissions: Control attendee capabilities
- Privacy Controls: Manage event visibility
- Timeline Visualization: Gantt chart-style calendar views
- Day Organization: Intelligent calendar reorganization for productivity
- Conflict Detection: Visual overlap indicators and automatic resolution
Quick Start
Prerequisites
- Go 1.21 or later
- Google Cloud Project with Calendar API enabled
- Google OAuth 2.0 credentials
Installation
-
Clone the repository
git clone <repository-url> cd gcal-mcp-server
-
Install dependencies
go mod tidy
-
Build the server
go build -o gcal-mcp-server cmd/server/main.go
Google Calendar API Setup
Step 1: Create Google Cloud Project
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API:
- Navigate to "APIs & Services" > "Library"
- Search for "Google Calendar API"
- Click "Enable"
Step 2: Create OAuth 2.0 Credentials
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth 2.0 Client IDs"
- Set application type to "Desktop application"
- Name your OAuth client (e.g., "Calendar MCP Server")
- Download the credentials JSON file
Step 3: Configure Credentials
Option 1: Repository Root (Recommended) Place your credentials file in the repository root directory:
cp path/to/downloaded/credentials.json /path/to/gcal-mcp-server/credentials.json
Option 2: User Configuration Directory
mkdir -p ~/.config/gcal-mcp-server
cp path/to/downloaded/credentials.json ~/.config/gcal-mcp-server/credentials.json
The server will automatically detect the repository root and use credentials from there, making it work regardless of where you launch the server from.
Step 4: Initial Authentication
-
Run the server for the first time:
./gcal-mcp-server
-
The server will prompt you to visit a URL for authentication
-
Complete the OAuth flow in your browser
-
The server will save your token for future use
Configuration
Credentials Location
The server automatically detects the repository root by looking for go.mod
or .git
files and uses credentials from there. This ensures the server works regardless of where you launch it from.
Search order:
- Repository root:
<repo-root>/credentials.json
(automatically detected) - Fallback: Current working directory
./credentials.json
Token Storage
Authentication tokens are stored alongside credentials:
- Repository root:
<repo-root>/token.json
(automatically detected) - Fallback: Current working directory
./token.json
This approach ensures consistent credential access regardless of launch location.
š¤ AI Integration
This MCP server is designed to work seamlessly with multiple AI assistants. Each platform has specific setup instructions and capabilities.
š AI Command Integrations
This repository ships command definitions for multiple assistants instead of a single system prompt. Use the platform-specific command files to enable rich calendar workflows.
šµ Claude Code Integration
Configuration
Add the following to your Claude Code or Gemini CLI configuration file:
macOS: .mcp.json
{
"mcpServers": {
"gcal-mcp-server": {
"command": "/path/to/gcal-mcp-server",
"args": [],
"env": {}
}
}
}
Using Claude Commands
- Open Claude Desktop ā Commands
- Create a new command and paste the contents of
.claude/commands/events.md
- Optionally import additional commands from the
.claude/commands/
directory - Customize placeholders (e.g., email) as needed
See CLAUDE.md
for detailed Claude-specific instructions and examples.
š” Gemini-CLI Integration
Using Gemini Commands
- Use the provided TOML command set in
.gemini/commands/events.toml
- Follow
GEMINI.md
for importing or referencing commands with your Gemini CLI setup - Customize placeholders (e.g., email) as needed
See GEMINI.md
for detailed Gemini-CLI specific instructions and examples.
š£ Cursor IDE Integration
Status
- TODO: Provide Cursor command definitions analogous to Claude/Gemini.
MCP Server Configuration in Cursor
MCP Server Configuration in Cursor
Add to your Cursor workspace settings (.cursor/settings.json
):
{
"mcp.servers": {
"gcal-mcp-server": {
"command": "/path/to/gcal-mcp-server",
"args": [],
"env": {}
}
}
}
Using in Cursor
Once configured, you can:
- Use the integrated chat with calendar management capabilities
- Access calendar functions through the command palette
- Get intelligent suggestions for meeting scheduling
- Use RSVP management and day organization features
šÆ Example Usage Across All Platforms
Once configured with any AI assistant, you can use natural language commands like:
Create a meeting titled "Project Review" tomorrow at 2 PM for 1 hour with john@company.com and jane@company.com. Include a Google Meet link.
Check if alice@company.com and bob@company.com are available Friday between 9 AM and 5 PM.
Show me my remaining meetings for today in timeline format.
Accept meeting 3 and decline meetings 5 and 7.
Organize my day tomorrow for optimal productivity.
Reschedule the "Team Standup" event from 10 AM to 11 AM and add charlie@company.com as an attendee.
Available Tools
The MCP server provides five core tools for comprehensive calendar management:
1. create_event
Create a new calendar event with comprehensive options and automatic availability checking.
Required Parameters:
summary
: Event titlestart_time
: Start time (RFC3339 format)end_time
: End time (RFC3339 format)
Optional Parameters:
calendar_id
: Target calendar (default: "primary")description
: Event descriptionlocation
: Event locationtimezone
: Event timezone (default: "UTC")all_day
: All-day event flag (default: false)attendees
: Array of attendee email addresses or objects with RSVP statusrecurrence
: Recurrence rules (RRULE format)visibility
: Event visibility ("default", "public", "private", "confidential")send_notifications
: Send email notifications (default: true)guest_can_modify
: Allow guests to modify event (default: false)guest_can_invite_others
: Allow guests to invite others (default: true)guest_can_see_other_guests
: Allow guests to see other guests (default: true)create_meet_link
: Create Google Meet link (default: false)reminders
: Custom reminder settingseventType
: Event classification ("default" | "focusTime" | "workingLocation"). Default: "default".workingLocation
: Only wheneventType
= "workingLocation". Object:{ "type": "home|office|custom", "label": "<text>" }
.focusTimeProperties
: Only wheneventType
= "focusTime". Object with:autoDeclineMode
: "declineOnlyNew" | "declineAll"chatStatus
: "doNotDisturb" | "available"declineMessage
: Optional custom decline message
Enhanced Features:
- Automatic Availability Checking: Validates all attendee availability before creation
- Conflict Prevention: Prevents double-booking by checking free/busy status
- Smart Defaults: Applies intelligent defaults based on meeting context
Example:
{
"summary": "Team Meeting",
"start_time": "2024-01-15T10:00:00-08:00",
"end_time": "2024-01-15T11:00:00-08:00",
"description": "Weekly team sync meeting",
"location": "Conference Room A",
"attendees": ["alice@company.com", "bob@company.com"],
"create_meet_link": true,
"reminders": {
"use_default": false,
"overrides": [
{"method": "email", "minutes": 1440},
{"method": "popup", "minutes": 15}
]
}
}
Event Type Examples
Focus Time block (auto-decline and DND):
{
"summary": "Deep Work - Roadmap Planning",
"start_time": "2024-01-16T13:00:00-08:00",
"end_time": "2024-01-16T15:00:00-08:00",
"visibility": "private",
"eventType": "focusTime",
"focusTimeProperties": {
"autoDeclineMode": "declineOnlyNew",
"chatStatus": "doNotDisturb",
"declineMessage": "I'm in focus time and will respond after."
}
}
Working Location (all-day indicator):
{
"summary": "Working from Home",
"all_day": true,
"start_time": "2024-01-17T00:00:00-08:00",
"end_time": "2024-01-18T00:00:00-08:00",
"eventType": "workingLocation",
"workingLocation": { "type": "home", "label": "Working from Home" }
}
2. edit_event
Update an existing calendar event using true PATCH semantics (only provided fields are modified).
Required Parameters:
event_id
: ID of the event to edit
Optional Parameters:
- All parameters from create_event (only provided parameters are updated)
Supports updating event-type specific fields: eventType
, workingLocation
, and focusTimeProperties
.
Enhanced Features:
- True PATCH Semantics: Only modifies fields that are explicitly provided
- RSVP Management: Update attendance status using attendee objects with
response_status
- Attendee Format Flexibility: Supports both legacy string arrays and enhanced object format
- Availability Validation: Checks attendee availability when rescheduling
RSVP Status Values:
"accepted"
: Attendee has accepted the invitation"declined"
: Attendee has declined the invitation"tentative"
: Attendee has marked as maybe/tentative"needsAction"
: Attendee has not yet responded (default)
RSVP Example:
{
"event_id": "abc123def456",
"attendees": [{"email": "user@example.com", "response_status": "accepted"}]
}
3. delete_event
Delete a calendar event.
Required Parameters:
event_id
: ID of the event to delete
Optional Parameters:
calendar_id
: Calendar ID (default: "primary")send_notifications
: Send cancellation notifications (default: true)
4. search_attendees
Search for potential meeting attendees with email validation.
Required Parameters:
query
: Search query (email address or name)
Optional Parameters:
max_results
: Maximum results (default: 10)domain
: Limit to specific domain
Enhanced Features:
- Email Format Validation: Ensures valid email address format
- Domain Filtering: Supports organization-specific searches
- Smart Suggestions: Provides relevant attendee recommendations
5. get_attendee_freebusy
Check free/busy status for attendees with intelligent conflict detection.
Required Parameters:
attendee_emails
: Array of attendee email addressestime_min
: Start time for query (RFC3339 format)time_max
: End time for query (RFC3339 format)
Optional Parameters:
timezone
: Query timezone (default: "UTC")
Enhanced Features:
- Intelligent Conflict Detection: Accurately identifies overlapping time periods
- Multi-timezone Support: Handles attendees across different time zones
- Availability Recommendations: Suggests optimal meeting times
- Comprehensive Analysis: Shows busy periods and available time slots
Time Format
All times must be in RFC3339 format:
- With timezone:
2024-01-15T10:00:00-08:00
- UTC:
2024-01-15T18:00:00Z
- All-day events: Use
00:00:00
time with appropriate date
Recurrence Patterns
Use RRULE format for recurring events:
- Daily:
["RRULE:FREQ=DAILY;COUNT=10"]
- Weekly:
["RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR"]
- Monthly:
["RRULE:FREQ=MONTHLY;BYMONTHDAY=15"]
- Yearly:
["RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=25"]
Development
Project Structure
gcal-mcp-server/
āāā cmd/server/ # Main server entry point
āāā internal/
ā āāā auth/ # OAuth authentication
ā āāā calendar/ # Calendar API client and tools
ā āāā mcp/ # MCP protocol implementation
āāā bin/ # Compiled binaries
āāā .claude/commands/ # Claude command definitions (e.g., events.md)
āāā .gemini/commands/ # Gemini command definitions (e.g., events.toml)
āāā README.md # Main documentation (this file)
āāā Makefile # Build automation
āāā go.mod # Go module dependencies
āāā go.sum # Go module checksums
āāā token.json # OAuth token storage (auto-generated)
Key Files
.claude/commands/events.md
: Claude commands for calendar operations.gemini/commands/events.toml
: Gemini CLI commands for calendar operationsCLAUDE.md
: Claude Desktop integration guideGEMINI.md
: Gemini-CLI integration guideREADME.md
: This file - comprehensive documentation covering installation, configuration, and usageMakefile
: Build automation for easy compilation and deployment
Building from Source
# Clone repository
git clone <repository-url>
cd gcal-mcp-server
# Install dependencies
go mod tidy
# Build
make build
# Run
./bin/gcal-mcp-server
Testing
# Run tests
go test ./...
# Run with verbose output
go test -v ./...
Troubleshooting
Common Issues
-
Authentication Failed
- Ensure
credentials.json
is in the correct location - Check that Google Calendar API is enabled in your project
- Verify OAuth consent screen is properly configured
- Ensure
-
Permission Denied
- Make sure the OAuth client has the correct scopes
- Check that the user has granted calendar access
- Re-authenticate if tokens have expired
-
Invalid Time Format
- Use RFC3339 format for all times
- Include timezone information
- Ensure end time is after start time
-
Attendee Lookup Issues
- Provide full email addresses
- Check that attendees have Google accounts
- Verify domain restrictions if applicable
Debug Mode
Run with debug logging:
export GCAL_DEBUG=true
./gcal-mcp-server
Log Files
Server logs are written to stderr and can be captured:
./gcal-mcp-server 2> gcal-server.log
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
- Check the troubleshooting section
- Review Google Calendar API documentation
- Open an issue on GitHub
š§ Advanced AI Features
The Google Calendar MCP Server includes sophisticated AI-driven features that enhance calendar management:
šÆ Smart Event Management
- Automatic Conflict Detection: Visual indicators (ā ļø) for overlapping meetings
- RSVP Command Processing: Natural language commands like "accept meeting 3" or "decline meetings 2,4,6"
- Timeline Visualization: Gantt chart-style views when users request "timeline" format
- Meeting Filtering: Smart filtering for "remaining today" events based on current time
š Intelligent Scheduling
- Day Organization: Automatically reorganize calendar for optimal productivity with 2-hour meeting blocks
- Availability Validation: Mandatory free/busy checking before any event creation
- Meeting Immutability Rules: Respects shared calendars and external attendee constraints
- Break Optimization: Ensures 1-hour breaks between meeting blocks for focused work time
šØ Enhanced User Experience
- Numbered Meeting References: All meetings displayed with numbers for easy action commands
- Status Visualization: Clear attendance status indicators (ā ā ā³ ā)
- Strikethrough Formatting: Declined meetings shown with crossed-out styling
- PII Protection: Automatic obfuscation of personal information in timeline views
š Workflow Automation
- Batch RSVP Operations: Handle multiple meeting responses in single commands
- Smart Defaults: Context-aware default values for meeting creation
- Notification Management: Intelligent notification sending based on change significance
- Error Recovery: Graceful handling of scheduling conflicts with alternative suggestions
š AI Commands Overview
Use the provided command files to enable rich calendar workflows without a monolithic system prompt:
- Claude: see
.claude/commands/events.md
andCLAUDE.md
- Gemini CLI: see
.gemini/commands/events.toml
andGEMINI.md
- Cursor: TODO to provide command definitions; MCP server configuration is supported today