This is a Model Context Protocol (MCP) server that integrates with Google Calendar API, allowing AI assistants to manage calendars, create and update events, find available time slots, and more.
- List all available calendars
- List events with filtering options
- Create, update, and delete events
- Get detailed information about specific events
- Find available time slots in a calendar
- Get upcoming meetings with status (ongoing, upcoming, past)
- Support for recurring events
- Meeting attendees management
- Node.js 16+
- A Google Cloud project with Calendar API enabled
- OAuth 2.0 client credentials
- Clone this repository
git clone https://github.com/daemonX10/Google-Calendar-MCP-Server.git cd Google-Calendar-MCP-Server
- Install dependencies:
npm install
- Create a
.env
file with your Google API credentials (you can copy from.env.example
):GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=http://localhost:3000/auth/callback
- Clone this repository
git clone https://github.com/daemonX10/Google-Calendar-MCP-Server.git cd Google-Calendar-MCP-Server
- Copy the example environment file:
cp .env.example .env
- Edit the
.env
file with your Google API credentials - Build and start the Docker container:
docker-compose up -d
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API in the API Library
- Create OAuth 2.0 credentials:
- Go to APIs & Services > Credentials
- Click "Create Credentials" > "OAuth client ID"
- Select "Web application" as the application type
- Add
http://localhost:3000/auth/callback
as an authorized redirect URI - Copy the Client ID and Client Secret to your
.env
file
- Set up the OAuth consent screen:
- Go to APIs & Services > OAuth consent screen
- Fill in the required information (app name, user support email, etc.)
- Add the necessary scopes (
https://www.googleapis.com/auth/calendar
andhttps://www.googleapis.com/auth/calendar.events
) - Add your email address as a test user
- Start the server:
npx ts-node src/index.ts
- You'll see a URL in the console output. Open this URL in your browser to authorize the application.
- After authorization, you'll be redirected to a URL with a code parameter. Copy this code.
- Use the authentication helper to save your refresh token:
This will automatically save the refresh token to your
npx ts-node src/auth-helper.ts "YOUR_AUTH_CODE"
.env
file and test the connection. - You're now ready to use the MCP server!
If you encounter authentication issues:
- Make sure your Google Cloud OAuth credentials are set up correctly with the exact redirect URI
- If you're getting "invalid_grant" errors, the authorization code has likely expired - they only last a few minutes
- If you've previously authorized the app, you might need to revoke access from Google Account Permissions and try again
- Ensure you've added your email as a test user in the Google Cloud Console OAuth consent screen
npm run dev
- Build the server:
npm run build
- Start the server:
npm start
# Build and start the container
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the container
docker-compose down
You can also use our pre-built Docker image:
# Pull the image
docker pull daemonx10/google-calendar-mcp:latest
# Run the container (create a .env file first)
docker run -d -p 3000:3000 --name google-calendar-mcp --env-file ./.env daemonx10/google-calendar-mcp:latest
{
"mcp": {
"servers": {
"google-calendar": {
"command": "node",
"args": ["/absolute/path/to/mcp-google-calendar/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your_client_id",
"GOOGLE_CLIENT_SECRET": "your_client_secret",
"GOOGLE_REDIRECT_URI": "http://localhost:3000/auth/callback",
"GOOGLE_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
}
For Claude Desktop, you'll need to build the project first with npm run build
.
For Claude.ai web, you'll need to:
- Keep the server running locally on your machine
- Use a solution like Claude MCP Browser Extension that connects Claude.ai to local MCP servers
For other AI assistants that support the Model Context Protocol:
- Keep the server running on port 3000
- Configure the assistant to connect to
http://localhost:3000
for the Google Calendar MCP server - Consult your assistant's documentation for specific MCP integration steps
Once integrated with your AI assistant of choice, you can interact with your Google Calendar using natural language commands. For example:
- "Show me my calendar for today"
- "Create a meeting with John tomorrow at 2pm about project planning"
- "Find available 30-minute slots in my calendar this week"
- "Reschedule my 3pm meeting to 4pm"
- "Cancel my meeting with Sarah"
List all available calendars.
List events in a calendar with filtering options. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')maxResults
(optional): Maximum number of events to returntimeMin
(optional): Start time in ISO format (default: now)timeMax
(optional): End time in ISO formatq
(optional): Search term to find events
Create a new event in a calendar. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')summary
: Event titledescription
(optional): Event descriptionlocation
(optional): Event locationstart
: Start time in ISO formatend
: End time in ISO formatattendees
(optional): List of email addresses of attendeesreminders
(optional): Event reminders configurationrecurrence
(optional): Recurrence rules for recurring events
Get details for a specific event. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')eventId
: Event ID
Update an existing event in a calendar. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')eventId
: Event IDsummary
(optional): Event titledescription
(optional): Event descriptionlocation
(optional): Event locationstart
(optional): Start time in ISO formatend
(optional): End time in ISO formatattendees
(optional): List of email addresses of attendeesreminders
(optional): Event reminders configuration
Delete an event from a calendar. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')eventId
: Event ID
Find available time slots in a calendar. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')timeMin
(optional): Start time in ISO format (default: now)timeMax
(optional): End time in ISO formatduration
(optional): Duration in minutesworkingHoursStart
(optional): Working hours start time (e.g., "09:00")workingHoursEnd
(optional): Working hours end time (e.g., "17:00")
Get upcoming meetings for today or a specific day. Parameters:
calendarId
(optional): Calendar ID (default: 'primary')date
(optional): Date in ISO format (default: today)
- This MCP server runs locally on your machine, so your calendar data never passes through external servers
- OAuth refresh tokens are stored in your .env file - keep this secure
- The server uses HTTPS when communicating with Google's APIs
- Be careful when exposing this server to external networks
- Check if Node.js is installed and up to date
- Verify that all dependencies are installed with
npm install
- Make sure your .env file has the correct credentials
- Check for TypeScript errors with
npx tsc --noEmit
- Ensure your Google Cloud OAuth credentials match what's in your .env file
- Revoke app access from Google Account Permissions and try again
- Make sure your email is added as a test user in the Google Cloud Console
- Check that your redirect URI exactly matches what's in the Google Cloud Console
- Verify that the paths in your configuration files are absolute and correct
- Make sure the server is running before attempting to use it with an AI assistant
- Check the assistant's logs for connection errors
- For Claude Desktop, ensure you've built the project with
npm run build
MIT