Google Calendar

Interact with Google Calendar APIs to manage events and calendars.

๐Ÿ—“๏ธ Google Calendar MCP Server

This project integrates the Google Calendar v3 APIs with a custom MCP (Model Context Protocol) Server, enabling natural language interaction with your calendar via tools like Claude Desktop.

It acts as a bridge between your calendar data and an LLM using MCP-compatible HTTP streaming.


๐Ÿง  Overview

This project contains two core servers:

1. ๐Ÿ” Google OAuth Server

  • Handles OAuth 2.0 flow
  • Stores and refreshes access tokens in a local session file

2. ๐Ÿค– MCP Server


๐Ÿš€ Getting Started

Step 1: ๐Ÿ”ง Set Up Google API Credentials

  1. Go to the Google Cloud Console
  2. Create or select a project
  3. Enable the Google Calendar API
  4. Go to Credentials โ†’ Create OAuth 2.0 Client ID
    • Choose Desktop App
    • Set branding and add test user emails in audience
  5. Download the OAuth credentials as client_secret.json
  6. Place this file in the root directory of the project

Step 2: ๐Ÿ“ฆ Install Dependencies

poetry install

Step 3: ๐Ÿšช Start the OAuth Server

poetry run uvicorn src.main:app --host 0.0.0.0 --port 8000
  • This should automatically open a browser for OAuth authentication.
  • If not, visit http://0.0.0.0:8000/google_oauth/
  • Upon successful authentication, you'll see a success page.
  • A session.json file will be created with your access/refresh tokens.

OAuth Success Page


Step 4: ๐Ÿงฉ Run the MCP Server

poetry run python src/server.py

This launches a streamable MCP-compatible HTTP server at http://localhost:8080/mcp


Step 5: ๐Ÿง  Connect MCP Client (Claude Desktop)

Update the config file at:

~/Library/Application Support/Claude/claude_desktop_config.json

Add the following entry:

{
  "mcpServers": {
    "google-calendar-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8080/mcp"
      ]
    }
  }
}

Step 6: โœ… Verify Integration

  • Open Claude Desktop settings.
  • If the MCP server was added correctly, it will appear under Settings -> integrations

MCP client integrations

๐Ÿง  Demo

https://github.com/user-attachments/assets/27a8e5ee-8f2f-40c7-bdfc-1caa93767efb

๐Ÿงฑ Project Structure

project-root/
โ”œโ”€โ”€ client_secret.json         # Google OAuth credentials
โ”œโ”€โ”€ session.json               # Access/refresh token storage
โ”œโ”€โ”€ pyproject.toml             # Poetry project config
โ”œโ”€โ”€ README.md                  

โ””โ”€โ”€ src/
    โ”œโ”€โ”€ main.py                # FastAPI app for OAuth server
    โ”œโ”€โ”€ server.py              # MCP-compatible server
    โ”œโ”€โ”€ settings.py            # App settings and constants

    โ”œโ”€โ”€ api/
    โ”‚   โ””โ”€โ”€ oauth_callback.py  # OAuth endpoint logic

    โ”œโ”€โ”€ core/
    โ”‚   โ”œโ”€โ”€ calendar_client.py # Google Calendar API wrapper
    โ”‚   โ”œโ”€โ”€ mcp_tools.py       # Tools exposed to MCP clients
    โ”‚   โ”œโ”€โ”€ oauth_manager.py   # OAuth initiation and flow
    โ”‚   โ””โ”€โ”€ session_manager.py # Token handling

    โ””โ”€โ”€ gcalendar_types/       # Typed definitions for Calendar v3 API

๐Ÿงฉ Dependencies


Server Terkait

NotebookLM Web Importer

Impor halaman web dan video YouTube ke NotebookLM dengan satu klik. Dipercaya oleh 200.000+ pengguna.

Instal Ekstensi Chrome