Google Calendar MCP Server
A Model Context Protocol (MCP) server that allows Claude and other MCP clients to interact with Google Calendar. This server enables AI assistants to manage your calendar events, check availability, and handle scheduling tasks.
README
Google Calendar MCP Server
A Model Context Protocol (MCP) server that allows Claude and other MCP clients to interact with Google Calendar. This server enables AI assistants to manage your calendar events, check availability, and handle scheduling tasks.
Features
Calendar Management
-
List Events (
get-events)- View events from any calendar
- Filter by time range
- Limit number of results
-
List Calendars (
list-calendars)- View all available calendars
- Access calendar IDs and settings
-
Get Timezone Info (
get-timezone-info)- Get user's timezone information
-
Get Current Date (
get-current-date)- Get current date and time in user's timezone
- Useful for AI models with outdated knowledge cutoff dates
Event Operations
-
Create Events (
create-event)- Schedule new events with full feature support
- Add attendees and set reminders
- Include conference links and attachments
- Set visibility, transparency, and colors
- Configure recurring events
- Automatic timezone detection and conflict checking
-
Update Events (
update-event)- Modify existing events
- Change time/date with conflict checking
- Add/remove attendees
- Update any event details
- Control notification settings
-
Delete Events (
delete-event)- Remove events from calendar
- Control notification settings for attendees
Availability Management
- Check Availability (
check-availability)- Check free/busy status for multiple calendars
- Time zone awareness
- Support for checking other users' availability
System Architecture
flowchart TD
subgraph Client["🤖 MCP Client"]
Claude["Claude Desktop<br/>(STDIO)"]
Web["Web App / Other MCP Client<br/>(HTTP + SSE)"]
end
subgraph STDIO["📥 STDIO Server — server.py"]
direction TB
S1["mcp.server.stdio.stdio_server()"]
S2["Server('mcp-server-google-calendar')"]
S3["@server.list_tools()<br/>handle_list_tools()"]
S4["@server.call_tool()<br/>handle_call_tool(name, arguments)"]
S1 --> S2 --> S3
S2 --> S4
end
subgraph SSE["🌐 SSE Server — server_sse.py"]
direction TB
E1["uvicorn.run(app)"]
E2["FastMCP('Google Calendar MCP Server')"]
E3["mcp.sse_app()<br/>/sse endpoint"]
E4["@mcp.tool() decorated<br/>functions"]
E1 --> E3 --> E2
E2 --> E4
end
subgraph AUTH["🔐 auth/auth.py"]
direction TB
A1["authorize()"]
A2{"token.json<br/>exists & valid?"}
A3["load_saved_credentials()"]
A4["Refresh via<br/>Request()"]
A5["InstalledAppFlow<br/>.from_client_secrets_file(credentials.json)"]
A6["Browser OAuth 2.0<br/>consent screen"]
A7["save_credentials()<br/>→ token.json"]
A1 --> A3 --> A2
A2 -- "expired, has refresh_token" --> A4 --> A7
A2 -- "missing/invalid" --> A5 --> A6 --> A7
A2 -- "valid" --> Return["Return Credentials"]
A7 --> Return
end
subgraph GAPI["📅 Google Calendar API v3"]
direction TB
Build["googleapiclient.discovery.build()"]
Ops["events().list / insert / update / delete<br/>calendarList().list<br/>freebusy().query<br/>settings().get('timezone')"]
Build --> Ops
end
subgraph TOOLS["🛠️ Validated Tool Operations — schemas.py + tools/tools.py"]
direction LR
T1["get-events"]
T2["list-calendars"]
T3["get-timezone-info"]
T4["get-current-date"]
T5["check-availability<br/>(conflict detection)"]
T6["create-event"]
T7["update-event"]
T8["delete-event"]
end
Claude -->|"JSON-RPC over stdio"| S4
Web -->|"HTTP/SSE request"| E4
S4 -->|"Pydantic validation<br/>(ListEventsRequest, CreateEventRequest, etc.)"| TOOLS
E4 -->|"Pydantic validation"| TOOLS
S4 --> A1
E4 --> A1
Return --> Build
TOOLS --> Build
Ops -->|"JSON response"| S4
Ops -->|"JSON response"| E4
S4 -->|"TextContent result"| Claude
E4 -->|"SSE stream result"| Web
Key architectural notes:
- Both the STDIO and SSE servers are independent implementations that share the same
auth,schemas, and Google Calendar API logic, but use different MCP transports — STDIO for local Claude Desktop integration, SSE/HTTP for remote or web-based clients. - The authorization flow (
authorize()) checks for a cachedtoken.json; if it's missing, invalid, or expired, it either silently refreshes the token or triggers a one-time browser-based OAuth 2.0 consent flow usingcredentials.json, then persists the resulting token for future runs. - Every tool call is validated against a Pydantic schema (
schemas.py) before hitting the Google Calendar API, and includes built-in conflict detection (viafreebusy().query) for event creation/updates.
Requirements
- Python >= 3.12
- Google Cloud Console Project with Calendar API enabled
- OAuth 2.0 credentials
Installation
1. Set up Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google Calendar API
- Create OAuth 2.0 credentials (Desktop Application type)
- Download credentials and save as
credentials.jsonin the \mcp_server_google_calendar folder
2. Install the Package
# Clone or download the project
cd mcp-google-calendar
# Install the package
pip install -e .
3. Authentication Setup
On first run, the server will automatically open your browser for OAuth authentication. Your credentials will be saved for future use.
Usage
This server can run in two modes:
STDIO Mode (for Claude Desktop)
Configure Claude Desktop:
Add the following to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"google_calendar": {
"command": "mcp-server-google-calendar"
}
}
}
Alternative using Python module:
{
"mcpServers": {
"google_calendar": {
"command": "python",
"args": ["-m", "mcp_server_google_calendar"]
}
}
}
Restart Claude Desktop after configuration changes.
SSE Mode (for web applications and other clients)
Run the server with SSE transport:
# Using the installed command
mcp-server-google-calendar-sse
# Or using Python module
python -m mcp_server_google_calendar.server_sse
# With custom host/port
python -m mcp_server_google_calendar.server_sse --host 0.0.0.0 --port 8001
The SSE server will be available at:
- Server:
http://localhost:8000 - SSE Endpoint:
http://localhost:8000/sse
Example Commands
Here are some things you can ask Claude:
Event Creation
- "Create an event called 'Team Meeting' for tomorrow at 2pm"
- "Schedule a recurring meeting every Monday at 10am"
- "Set up a video call with John for next Tuesday afternoon"
Event Management
- "Move my 2pm meeting to 4pm"
- "Add Jane (jane@example.com) to tomorrow's team meeting"
- "Cancel my meeting with John"
- "Update the location of today's team lunch"
Calendar Queries
- "What meetings do I have this week?"
- "When am I free tomorrow afternoon?"
- "Check if both Alice and Bob are available next Monday at 3pm"
- "List all my recurring events"
Date/Time Information
- "What's today's date?" (useful for models with outdated knowledge)
- "What day of the week is it?"
- "What's my current timezone?"
Advanced Features
Time Conflict Detection
The server automatically checks for time conflicts when creating or updating events and will warn you about overlapping events.
Timezone Support
- Automatic timezone detection from your Google Calendar settings
- Manual timezone specification for events
- Proper handling of timezone conversions
Recurring Events
Full support for recurring events using iCalendar RRULE format:
- Daily, weekly, monthly, yearly patterns
- Custom recurrence rules
- Exception dates and rules
Attendee Management
- Add/remove attendees with email validation
- Set optional vs required attendees
- Control response status and notifications
- Support for additional guests
Troubleshooting
Authentication Issues
- Ensure
credentials.jsonis in the project root directory - Check if OAuth consent screen is configured in Google Cloud Console
- Verify Calendar API is enabled
- Delete
token.jsonto force re-authentication if needed
Server Connection Issues
- Verify Python version (>= 3.12 required)
- Check Claude Desktop configuration file syntax
- Restart Claude Desktop after configuration changes
- For SSE mode, ensure the port is not in use
Event Creation Problems
- Confirm calendar permissions in Google Calendar
- Check for time conflicts with existing events
- Verify attendee email addresses are valid
- Ensure timezone format is correct
File Structure
mcp-google-calendar/
├── mcp_server_google_calendar/
│ ├── __init__.py
│ ├── __main__.py # STDIO mode entry point
│ ├── __main_sse__.py # SSE mode entry point
│ ├── credentials.json # Google OAuth credentials (you provide)
│ ├── server.py # STDIO server implementation
│ ├── server_sse.py # SSE server implementation
│ ├── schemas.py # Pydantic schemas
│ ├── auth/ # Authentication module
│ ├── tools/ # Tool definitions
│ └── utils/ # Utility functions
├── token.json # Saved auth token (auto-generated)
├── pyproject.toml # Project configuration
└── README.md
Notes
- The server maintains separate implementations for STDIO and SSE modes with identical features
- Both modes support automatic timezone detection and conflict checking
- All times should be specified in YYYY-MM-DDTHH:MM:SS format or RFC3339
- Calendar ID 'primary' refers to the user's default calendar
- Event updates maintain existing data for unspecified fields
- The server automatically handles timezone detection and conversion
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。