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
Provider
Takumi Oyamada
Release date
Mar 19, 2025
Language
TypeScript
Package
Stats
4.2K downloads
33 stars

This server integrates Google Calendar with Claude Desktop through the Model Context Protocol (MCP), enabling you to manage calendar events using natural language commands.

Installation

Prerequisites

  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 in a .env file:
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 configuration (defaults shown)
AUTH_PORT=4153
AUTH_HOST=localhost
# MCP server configuration (defaults shown)
PORT=3000
HOST=localhost
# Enable manual authentication (useful when localhost is not accessible)
USE_MANUAL_AUTH=true

Installation via NPX

Run the server directly using npx:

npx @takumi0706/[email protected]

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

Available Tools

1. getEvents

Retrieves calendar events with filtering options:

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

2. createEvent

Creates a new calendar event:

{
  "calendarId": "primary",
  "event": {
    "summary": "Team Meeting",
    "description": "Weekly team sync",
    "location": "Conference Room A",
    "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": "John Doe"}
    ],
    "colorId": "7",
    "recurrence": ["RRULE:FREQ=WEEKLY;BYDAY=MO"]
  }
}

For all-day events, use the date format instead:

{
  "calendarId": "primary",
  "event": {
    "summary": "Company Holiday",
    "start": {
      "date": "2025-03-15"
    },
    "end": {
      "date": "2025-03-16"
    }
  }
}

3. updateEvent

Updates an existing calendar event (partial updates supported):

{
  "calendarId": "primary",
  "eventId": "abc123xyz",
  "event": {
    "summary": "Updated Meeting Title",
    "location": "Virtual Meeting Room",
    "recurrence": ["RRULE:FREQ=WEEKLY;BYDAY=TU,TH"]
  }
}

4. deleteEvent

Deletes a calendar event:

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

5. authenticate

Re-authenticates with Google Calendar (useful for switching accounts):

{}

Event Colors

When creating or updating events, you can set colors using the colorId parameter:

  • 1: Lavender
  • 2: Sage
  • 3: Grape
  • 4: Flamingo
  • 5: Banana
  • 6: Tangerine
  • 7: Peacock
  • 8: Graphite
  • 9: Blueberry
  • 10: Basil
  • 11: Tomato

Recurring Events

Create recurring events using the recurrence parameter with RFC5545 RRULE format:

"recurrence": ["RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR"]

Common recurrence patterns:

  • Daily: RRULE:FREQ=DAILY
  • Weekly on Monday: RRULE:FREQ=WEEKLY;BYDAY=MO
  • Monthly on the 15th: RRULE:FREQ=MONTHLY;BYMONTHDAY=15
  • Yearly on January 1: RRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1
  • Every weekday: RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR

Troubleshooting

Common Issues

  • Authentication Errors: Verify your Google OAuth credentials
  • Invalid state parameter: Update to version 1.0.3+ or restart the application to fix OAuth server lifecycle issues
  • Cannot access localhost: Set USE_MANUAL_AUTH=true if running in an environment where localhost is not accessible
  • JSON Parsing Errors: Update to the latest version (1.0.6+)

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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