kamekamek/googlecalendar-mcp
If you are the rightful owner of googlecalendar-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Google Calendar MCP Server is an Axum-based bridge that enables coding agents to interact with Google Calendar events through the Model Context Protocol (MCP).
Google Calendar MCP Server
|
An Axum-based MCP server that enables AI agents to read and write Google Calendar events. Access the Google Calendar API through OAuth authentication via the Model Context Protocol (MCP).
Features
- 🔐 OAuth 2.0 Authentication with PKCE support
- 📅 Four operations: List, Get, Create, and Update calendar events
- 🚀 Remote MCP Transport via Server-Sent Events (SSE)
- 🔄 Automatic token refresh
- 👥 Multi-user support with per-user token isolation
- 🛡️ Security-first: Delete operations intentionally disabled
- 🔌 Full Claude Code compatibility
Setup Guide
1. Google Cloud Project Setup
1-1. Create a Project
- Go to Google Cloud Console
- Click the project selector dropdown at the top
- Click "New Project"
- Enter a project name (e.g.,
mcp-calendar-server) and click "Create"
1-2. Enable Google Calendar API
- Navigate to "APIs & Services" → "Library" from the sidebar
- Search for "Google Calendar API"
- Click "Google Calendar API"
- Click "Enable"
- Wait for "API enabled" confirmation
1-3. Configure OAuth Consent Screen
- Go to "APIs & Services" → "OAuth consent screen"
- User Type: Select "External" and click "Create"
- Select "Internal" only if using Google Workspace for internal users only
- App information:
- App name:
MCP Calendar Server(or any name) - User support email: Select your email
- Developer contact information: Enter your email
- App name:
- Click "Save and Continue"
1-4. Add Scopes
- Click "Add or Remove Scopes"
- Filter by
calendar - Check
https://www.googleapis.com/auth/calendar - Click "Update" → "Save and Continue"
1-5. Add Test Users
- In "Test users" section, click "ADD USERS"
- Enter your Google account email address
- Click "Add" → "Save and Continue"
- Click "Back to Dashboard"
Important: In testing mode, only users added here can sign in.
1-6. Create OAuth Credentials
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "OAuth client ID"
- Application type: Select "Web application"
- Name:
MCP Calendar OAuth Client(or any name) - Under Authorized redirect URIs, click "Add URI" and add:
http://localhost:8080/oauth/callbackhttps://localhost:8443/proxy/oauth/callback
- Click "Create"
- Copy and save the displayed "Client ID" and "Client secret"
- ❗Save these credentials - you'll need them later
2. Local Environment Setup
2-1. Clone Repository and Install Rust
# Clone repository
git clone https://github.com/kamekamek/mcp-google-calendar.git
cd mcp-google-calendar
# Install Rust nightly (if not already installed)
rustup toolchain install nightly
2-2. Configure Environment Variables
# Copy .env.example to .env
cp .env.example .env
Edit the .env file with your Google OAuth credentials:
APP__OAUTH__CLIENT_ID="<paste your client ID here>"
APP__OAUTH__CLIENT_SECRET="<paste your client secret here>"
APP__SERVER__PUBLIC_URL="https://localhost:8443"
APP__PROXY__ENABLED=true
3. Install and Run Caddy
3-1. Generate Certificates with mkcert
# Install mkcert (using Homebrew)
brew install mkcert
# Install local CA
mkcert -install
# Generate certificates for localhost
mkcert localhost 127.0.0.1 ::1
# → Creates localhost+2.pem and localhost+2-key.pem
3-2. Install and Run Caddy
# Install Caddy
brew install caddy
# Run Caddy (in a separate terminal)
caddy run --config caddyfile
Keep this terminal open as Caddy needs to continue running.
3-3. Start MCP Server
Open a new terminal:
cd mcp-google-calendar
cargo +nightly run
Server starts on 127.0.0.1:8080. Keep this terminal open as well.
4. Claude Code Configuration
4-1. Configure .mcp.json
Edit .mcp.json (create if it doesn't exist):
{
"mcpServers": {
"google_calendar": {
"type": "sse",
"url": "https://localhost:8443/mcp",
"metadata": {
"description": "Google Calendar MCP Server"
}
}
}
}
4-2. Launch Claude Code
# Start Claude Code CLI
claude
After startup, run:
/mcp
The MCP connection menu will appear.
4-3. Authentication Flow
- Select
google_calendarfrom the MCP server list - Click "Authenticate" button
- Browser automatically opens with Google OAuth screen
- Sign in with the Google account added as test user
- Review app permissions and click "Allow"
- When browser shows "Authentication complete", return to Claude Code
- Available tools list will be displayed after connection
5. Verification
Try this in Claude Code:
Show me my calendar events for this week
Or directly invoke tools:
/tools
Select google_calendar_list_events from the list and execute.
Available Tools
All tools require a user_id parameter (automatically set by Claude Code).
google_calendar_list_events
Retrieve a list of calendar events.
Parameters:
time_min: Start time filter (RFC3339:2025-10-20T00:00:00+09:00)time_max: End time filtermax_results: Maximum events to return (1-2500)calendar_id: Calendar ID (defaults to "primary")
google_calendar_get_event
Fetch a single event by ID.
Parameters:
event_id: Event ID (required)calendar_id: Calendar ID (defaults to "primary")
google_calendar_create_event
Create a new calendar event.
Parameters:
summary: Event title (required)start: Start time (required)end: End time (required)description: Description (optional)location: Location (optional)
Date/time format:
"2025-10-20T10:00:00+09:00"
google_calendar_update_event
Update an existing event.
Parameters:
event_id: Event ID (required)summary,start,end,description,location: Fields to update (optional)
Troubleshooting
Authentication Error
Cause: Attempting to sign in with a Google account not added as test user
Solution:
- Google Cloud Console → OAuth consent screen → Test users
- Add the Google account you want to use
Token Refresh Error
Cause: Refresh tokens are only issued on first authorization
Solution:
- Visit https://myaccount.google.com/permissions
- Find "MCP Calendar Server" and remove it
- Re-authenticate through Claude Code
HTTPS Error
Cause: Certificates missing or Caddy not running
Solution:
# Check certificates exist
ls localhost+2*.pem
# → Should see localhost+2.pem and localhost+2-key.pem
# Check if Caddy is running
lsof -i :8443
# → Should see caddy process
EventDateTime Format Error
Use RFC3339 format:
"2025-10-20T10:00:00+09:00"
Or object format:
{
"dateTime": "2025-10-20T10:00:00+09:00",
"timeZone": "Asia/Tokyo"
}
For Developers
Build and Test
# Format
cargo +nightly fmt
# Lint
cargo +nightly clippy -- -D warnings
# Test
cargo +nightly test
Configuration
See config/config.toml for complete configuration options.
Override with environment variables:
APP__OAUTH__CLIENT_IDAPP__OAUTH__CLIENT_SECRETAPP__SERVER__PUBLIC_URLAPP__SECURITY__USE_IN_MEMORY(true/false)APP__PROXY__ENABLED(true/false)
License
MIT License - see for details