Google Calendar MCP server

Integrates with Google Calendar to enable retrieving, creating, updating, and deleting calendar events through OAuth2 authentication and local token storage.
Back to servers
Setup instructions
Provider
Takumi Oyamada
Release date
Mar 19, 2025
Language
TypeScript
Package
Stats
5.1K downloads
49 stars

This MCP server acts as a bridge between Claude Desktop and Google Calendar, allowing you to interact with your calendar through natural language. It enables viewing, creating, updating, and deleting calendar events using the Model Context Protocol.

Installation

Quick Setup

The easiest way to install the Google Calendar MCP server is directly from npm:

npm install -g @takumi0706/google-calendar-mcp

Prerequisites

Before using the server, you need to:

  1. Create a Google Cloud Project and enable the Google Calendar API
  2. Configure OAuth2 credentials in the Google Cloud Console
  3. Set up environment variables

Create a .env file with your Google OAuth credentials:

GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:4153/oauth2callback

Optional environment variables:

# Token encryption key (auto-generated if not provided)
TOKEN_ENCRYPTION_KEY=32-byte-hex-key

# Auth server settings (defaults shown)
AUTH_PORT=4153
AUTH_HOST=localhost

# MCP server settings (defaults shown)
PORT=3000
HOST=localhost

# Enable manual authentication (useful when localhost is not accessible)
USE_MANUAL_AUTH=true

Configuration

Claude Desktop Configuration

Add the server to your claude_desktop_config.json:

{
  "mcpServers": {
    "google-calendar": {
      "command": "npx",
      "args": [
        "-y",
        "@takumi0706/google-calendar-mcp"
      ],
      "env": {
        "GOOGLE_CLIENT_ID": "your_client_id",
        "GOOGLE_CLIENT_SECRET": "your_client_secret",
        "GOOGLE_REDIRECT_URI": "http://localhost:4153/oauth2callback"
      }
    }
  }
}

Usage

Once installed and configured, the MCP server provides the following tools:

Viewing Calendar Events

Use the getEvents tool to retrieve calendar events:

{
  "calendarId": "primary", 
  "timeMin": "2025-03-01T00:00:00Z",
  "timeMax": "2025-03-31T23:59:59Z",
  "maxResults": 10,
  "orderBy": "startTime"
}

Parameters:

  • calendarId (optional): Uses primary calendar if omitted
  • timeMin (optional): Start time in ISO 8601 format
  • timeMax (optional): End time in ISO 8601 format
  • maxResults (optional): Maximum events to retrieve (default: 10)
  • orderBy (optional): Sort order - "startTime" or "updated" (default: "startTime")

Creating Events

Use the createEvent tool to add new events:

{
  "calendarId": "primary",
  "event": {
    "summary": "Team Meeting",
    "description": "Weekly team sync",
    "location": "Conference Room B",
    "start": {
      "dateTime": "2025-03-15T09:00:00+09:00",
      "timeZone": "Asia/Tokyo"
    },
    "end": {
      "dateTime": "2025-03-15T10:00:00+09:00",
      "timeZone": "Asia/Tokyo"
    },
    "attendees": [
      {"email": "[email protected]", "displayName": "Colleague Name"}
    ],
    "colorId": "7",
    "recurrence": ["RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR"]
  }
}

Parameters:

  • calendarId (optional): Uses primary calendar if omitted
  • event: Event details object containing:
    • summary (required): Event title
    • description (optional): Event description
    • location (optional): Event location
    • start: Start time with dateTime (ISO 8601) or date (YYYY-MM-DD for all-day events)
    • end: End time (same format as start)
    • attendees (optional): Array of attendees with email and optional displayName
    • colorId (optional): Event color ID (1-11)
    • recurrence (optional): Array of recurrence rules in RFC5545 format

Updating Events

Use the updateEvent tool to modify existing events:

{
  "calendarId": "primary",
  "eventId": "event123abc",
  "event": {
    "summary": "Updated Meeting Title",
    "description": "New description",
    "location": "New location"
  }
}

Parameters:

  • calendarId (optional): Uses primary calendar if omitted
  • eventId (required): ID of the event to update
  • event: Object with fields to update (only specified fields will be changed)

Deleting Events

Use the deleteEvent tool to remove events:

{
  "calendarId": "primary",
  "eventId": "event123abc"
}

Parameters:

  • calendarId (optional): Uses primary calendar if omitted
  • eventId (required): ID of the event to delete

Authentication

If you need to switch Google accounts without restarting Claude, use the authenticate tool:

{}

This tool takes no parameters and initiates a new authentication flow.

Troubleshooting

Common Issues

  • Authentication Errors: Verify your Google OAuth credentials
  • Invalid state parameter: Update to version 1.0.3+ or restart the application
  • Connection Errors: Ensure only one instance of the server is running
  • Cannot access localhost: Enable manual authentication with USE_MANUAL_AUTH=true
  • Parameter Validation Errors: Update to version 1.0.7+ for proper handling of empty values

Running in Remote Environments

If you're using the server in an environment where localhost is not accessible (like a remote server):

  1. Set USE_MANUAL_AUTH=true in your environment variables
  2. When prompted, manually enter the authorization code shown by Google after authorizing the application

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "google-calendar" '{"command":"npx","args":["-y","@takumi0706/google-calendar-mcp"],"env":{"GOOGLE_CLIENT_ID":"your_client_id","GOOGLE_CLIENT_SECRET":"your_client_secret","GOOGLE_REDIRECT_URI":"http://localhost:4153/oauth2callback"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "google-calendar": {
            "command": "npx",
            "args": [
                "-y",
                "@takumi0706/google-calendar-mcp"
            ],
            "env": {
                "GOOGLE_CLIENT_ID": "your_client_id",
                "GOOGLE_CLIENT_SECRET": "your_client_secret",
                "GOOGLE_REDIRECT_URI": "http://localhost:4153/oauth2callback"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "google-calendar": {
            "command": "npx",
            "args": [
                "-y",
                "@takumi0706/google-calendar-mcp"
            ],
            "env": {
                "GOOGLE_CLIENT_ID": "your_client_id",
                "GOOGLE_CLIENT_SECRET": "your_client_secret",
                "GOOGLE_REDIRECT_URI": "http://localhost:4153/oauth2callback"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later