Google Calendar MCP server

Integrates with Google Calendar API to enable event management through specialized tools for listing, creating, and deleting calendar events with timezone-aware handling and robust error management.
Back to servers
Setup instructions
Provider
Amorn Apichattanakul
Release date
Mar 20, 2025
Language
Python
Stats
1 star

This MCP (Model Context Protocol) server integrates with Google Calendar API, allowing you to efficiently manage calendar events through a standardized interface. It supports asynchronous operations for optimal performance and seamless interaction with Claude and other AI systems.

Installation Requirements

Prerequisites

  • Python 3.9 or higher
  • Internet connection
  • Google Cloud Console project with Google Calendar API enabled

Installation Steps

  1. Clone the project
git clone https://github.com/yourusername/GCalendar.git
cd GCalendar
  1. Create a virtual environment (recommended)
python -m venv gcalendar_venv

# For Windows
gcalendar_venv\Scripts\activate

# For macOS/Linux
source gcalendar_venv/bin/activate
  1. Install required packages
pip install -r requirements.txt
  1. Prepare necessary folders
mkdir -p credentials logs

Authentication Setup

  1. Create a Google Cloud Console project

    • Go to Google Cloud Console
    • Create a new project
    • Enable the Google Calendar API
    • Create an OAuth 2.0 Client ID
    • Download credentials.json to the credentials/ folder
  2. Generate token

python src/create_token.py
  • Follow the browser prompts to grant access permissions
  • The token will be saved in the credentials/ folder as token.json

Configuration

MCP Server Configuration

Add to your claude_desktop_config.json file:

{
  "mcpServers": {
    "gcalendar": {
      "command": "YOUR_PYTHON_PATH",
      "args": [
        "YOUR_PATH/GCalendar/src/mcp_server.py"
      ]
    }
  }
}

Replace placeholders:

  • YOUR_PYTHON_PATH: Path to your Python interpreter (from venv or conda)
  • YOUR_PATH: Full path to the cloned folder

Usage

Starting the Server

  1. Start server manually
python src/mcp_server.py
  1. Using with Claude Desktop
    • Configure as described in the configuration section above
    • Claude will automatically start the server when needed

Available API Tools

  • list: Retrieve calendar events (2 years back to 1 year ahead)
  • create-event: Create a new calendar event
  • delete-duplicates: Remove duplicate events
  • delete-event: Delete a specified event

Example Commands

  • View calendar events

    • "Show events in my calendar"
  • Create a new event

    • "Create a meeting called 'Team Meeting' on March 25, 2025 from 2:00 PM to 3:00 PM"
  • Delete duplicate events

    • "Delete duplicate 'Team Meeting' events on March 25, 2025"

Troubleshooting

Authentication Issues

  • Verify that credentials.json and token.json exist in the credentials/ folder
  • Delete token.json and regenerate it using create_token.py

Timezone Problems

  • Check that timezone libraries are installed:
pip install pytz tzdata

Log Inspection

  • View log files for more information about errors:
cat logs/calendar_service.log

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 "gcalendar" '{"command":"YOUR_PYTHON_PATH","args":["YOUR_PATH/GCalendar/src/mcp_server.py"]}'

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": {
        "gcalendar": {
            "command": "YOUR_PYTHON_PATH",
            "args": [
                "YOUR_PATH/GCalendar/src/mcp_server.py"
            ]
        }
    }
}

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": {
        "gcalendar": {
            "command": "YOUR_PYTHON_PATH",
            "args": [
                "YOUR_PATH/GCalendar/src/mcp_server.py"
            ]
        }
    }
}

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