Enables interaction with Google Calendar to list events, create and update meetings, delete events, and find available time slots within a specified time range.
Google Calendar MCP Server
This MCP server allows Claude to interact with your Google Calendar, enabling capabilities like listing events, creating meetings, and finding free time slots.
Prerequisites
Node.js (v16 or higher)
Claude Desktop App
A Google Cloud Project
Google Calendar API enabled
OAuth 2.0 credentials
Setup Instructions
1. Create a Google Cloud Project
Go to the Google Cloud Console
Create a new project or select an existing one
Enable the Google Calendar API:
Go to "APIs & Services" > "Library"
Search for "Google Calendar API"
Click "Enable"
2. Configure OAuth Consent Screen
Go to "APIs & Services" > "OAuth consent screen"
Select "External" user type (unless you have a Google Workspace organization)
Fill in the required information:
App name
User support email
Developer contact information
Add the following scopes:
https://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/calendar.events
Add your email address as a test user
3. Create OAuth 2.0 Credentials
Go to "APIs & Services" > "Credentials"
Click "Create Credentials" > "OAuth client ID"
Select "Desktop app" as the application type
Name your client (e.g., "MCP Calendar Client")
Click "Create"
Download the client configuration file (you'll need the client ID and client secret)
4. Get Refresh Token
Create a new file named
getToken.js:
Install required dependency:
Update the script with your OAuth credentials:
Replace
your-client-idwith your actual client IDReplace
your-client-secretwith your actual client secret
Run the script:
Follow the instructions in the console:
Copy the provided URL
Paste it into your browser
Complete the Google authentication process
Copy the refresh token that appears in the console
5. Configure Claude Desktop
Open your Claude Desktop configuration file:
For MacOS:
For Windows:
Add or update the configuration:
Save the file and restart Claude Desktop
Initial Project Setup
Create a new directory for your project:
Initialize a new npm project:
Install dependencies:
Create a tsconfig.json file:
Update package.json:
Create your source directory:
Create a .env file for local development (don't commit this file):
Building and Running
Build the server:
The server will automatically start when you open Claude Desktop
Available Tools
The server provides the following tools:
list_events: List calendar events within a specified time rangecreate_event: Create a new calendar eventupdate_event: Update an existing calendar eventdelete_event: Delete a calendar eventfind_free_time: Find available time slots in the calendar
Example Usage in Claude
After setup, you can use commands like:
"Show me my calendar events for next week"
"Schedule a meeting with [email_id] tomorrow at 2 PM for 1 hour"
"Find a free 30-minute slot this afternoon"
"Update my 3 PM meeting to 4 PM"
"Cancel my meeting with ID [event_id]"
Troubleshooting
Common Issues
Tools not appearing in Claude:
Check Claude Desktop logs:
tail -f ~/Library/Logs/Claude/mcp*.logVerify all environment variables are set correctly
Ensure the path to index.js is absolute and correct
Authentication Errors:
Verify your OAuth credentials are correct
Check if refresh token is valid
Ensure required scopes are enabled
Server Connection Issues:
Check if the server built successfully
Verify file permissions on build/index.js (should be 755)
Try running the server directly:
node /path/to/build/index.js
Viewing Logs
To view server logs:
Environment Variables
If you're getting environment variable errors, verify each one:
GOOGLE_CLIENT_ID: Should start with something like "123456789-..."
GOOGLE_CLIENT_SECRET: Usually ends in ".apps.googleusercontent.com"
GOOGLE_REDIRECT_URI: Should be "http://localhost"
GOOGLE_REFRESH_TOKEN: A long string that doesn't expire
Security Considerations
Keep your OAuth credentials secure
Don't commit credentials to version control
Use environment variables for sensitive data
Regularly rotate refresh tokens
Monitor API usage in Google Cloud Console
License
MIT License - See LICENSE file for details.
Support
If you encounter any issues:
Check the troubleshooting section above
Review Claude Desktop logs
Open an issue on GitHub
Contact the maintainer