Google Calendar MCP server

Integrates with Google Calendar to enable natural language management of events, appointments, and schedules.
Back to servers
Provider
gongrzhe
Release date
Dec 26, 2024
Language
TypeScript
Stats
7 stars

This MCP server integrates Google Calendar functionality with Claude Desktop, allowing AI assistants to create, view, update, and delete calendar events through natural language interactions. The server handles authentication and provides a seamless interface between Claude and your Google Calendar.

Installation and Authentication

Prerequisites

You need to create a Google Cloud Project and obtain OAuth credentials:

  1. Go to Google Cloud Console and create/select a project
  2. Enable the Google Calendar API for your project
  3. Create OAuth 2.0 Credentials:
    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "OAuth client ID"
    • Choose "Desktop app" or "Web application" as application type
    • Give it a name and click "Create"
    • For Web applications, add http://localhost:3000/oauth2callback to the authorized redirect URIs
    • Download the JSON file and rename it to gcp-oauth.keys.json

Installing via Smithery

The easiest way to install is using Smithery:

npx -y @smithery/cli install @gongrzhe/server-calendar-autoauth-mcp --client claude

Authentication Process

You can authenticate in two ways:

Global Authentication (Recommended)

# Create directory and move your OAuth keys
mkdir -p ~/.calendar-mcp
mv gcp-oauth.keys.json ~/.calendar-mcp/

# Run authentication
npx @gongrzhe/server-calendar-autoauth-mcp auth

Local Authentication

# Place gcp-oauth.keys.json in your current directory
npx @gongrzhe/server-calendar-autoauth-mcp auth

The authentication process will:

  • Find your OAuth keys file
  • Open your browser for Google authentication
  • Save credentials in ~/.calendar-mcp/credentials.json

Configure in Claude Desktop

Add this to your Claude Desktop configuration:

{
  "mcpServers": {
    "calendar": {
      "command": "npx",
      "args": [
        "@gongrzhe/server-calendar-autoauth-mcp"
      ]
    }
  }
}

Docker Support

If you prefer using Docker:

  1. Authentication:
docker run -i --rm \
  --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
  -v mcp-calendar:/calendar-server \
  -e CALENDAR_OAUTH_PATH=/gcp-oauth.keys.json \
  -e "CALENDAR_CREDENTIALS_PATH=/calendar-server/credentials.json" \
  -p 3000:3000 \
  mcp/calendar auth
  1. Configuration in Claude Desktop:
{
  "mcpServers": {
    "calendar": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "mcp-calendar:/calendar-server",
        "-e",
        "CALENDAR_CREDENTIALS_PATH=/calendar-server/credentials.json",
        "mcp/calendar"
      ]
    }
  }
}

Using the MCP Server

The Calendar MCP server provides several functions that Claude can use:

Creating Calendar Events

Example input format:

{
  "summary": "Team Meeting",
  "start": {
    "dateTime": "2024-01-20T10:00:00Z"
  },
  "end": {
    "dateTime": "2024-01-20T11:00:00Z"
  },
  "description": "Weekly team sync",
  "location": "Conference Room A"
}

Listing Events

Example input format:

{
  "timeMin": "2024-01-01T00:00:00Z",
  "timeMax": "2024-12-31T23:59:59Z",
  "maxResults": 10,
  "orderBy": "startTime"
}

Updating Events

Example input format:

{
  "eventId": "event123",
  "summary": "Updated Meeting Title",
  "start": {
    "dateTime": "2024-01-20T11:00:00Z"
  },
  "end": {
    "dateTime": "2024-01-20T12:00:00Z"
  }
}

Deleting Events

Example input format:

{
  "eventId": "event123"
}

Troubleshooting

Common Issues

  • OAuth Keys Not Found: Ensure gcp-oauth.keys.json is in the current directory or ~/.calendar-mcp/

  • Invalid Credentials Format: Verify your OAuth keys file contains either web or installed credentials and that redirect URIs are correctly configured

  • Port Already in Use: Free up port 3000 before running authentication

Security Considerations

  • OAuth credentials are stored in ~/.calendar-mcp/
  • Never share or commit your credentials
  • Regularly review access in your Google Account settings

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