Google Calendar MCP Server
An MCP (Model Context Protocol) server that connects to Google Calendar API to answer natural language questions about appointments and events.
Features
- Natural Language Queries: Ask questions like "What's on my schedule today?" or "Do I have any meetings tomorrow?"
- Flexible Time Ranges: Query events for specific dates, date ranges, or upcoming periods
- Availability Checking: Check if specific time slots are free or conflicted
- Timezone Support: Handle different timezones for accurate scheduling
- Structured Responses: Get formatted, easy-to-read calendar information
Setup
1. Google Calendar API Setup
Option A: Service Account (Recommended - No OAuth redirects needed)
- Go to the Google Cloud Console
- Create a new project or select existing one
- Enable the Google Calendar API
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "Service Account"
- Create the service account and download the JSON key file
- Important: Share your Google Calendar with the service account email address (found in the JSON file as
client_email)
Option B: OAuth 2.0 (Traditional method)
- Go to the Google Cloud Console
- Create a new project or select existing one
- Enable the Google Calendar API
- Create credentials (OAuth 2.0 client ID) for a desktop application
- Download the credentials JSON file
2. Configuration
For Service Account:
- Copy the service account JSON file to
service-account-key.json, OR - Set as environment variable:
export GOOGLE_SERVICE_ACCOUNT_KEY='{"type": "service_account", ...}'
For OAuth 2.0:
- Copy the downloaded credentials file to
credentials.json, OR - Set as environment variable:
export GOOGLE_CREDENTIALS_JSON='{"installed": {...}}'
3. Installation
Install required dependencies:
pip install google-auth google-auth-oauthlib google-api-python-client mcp python-dateutil pytz
