Sponsored by Deepsite.site

Google Calendar

Created By
takumi07069 months ago
Content

Google Calendar MCP Server

Version License

A Model Context Protocol (MCP) server implementation for Google Calendar integration with Claude Desktop.

Features

  • Google Calendar event management (get, create, update, delete)
  • OAuth2 authentication with Google Calendar API
  • MCP SDK integration for Claude Desktop
  • Automatic browser opening for authorization
  • In-memory token management (no file-based storage)
  • Simple setup and configuration

Installation

npx @takumi0706/google-calendar-mcp

Usage

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:
# 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:3000/oauth2callback

Claude Desktop Configuration

Add the server to your claude_desktop_config.json:

{
  "globalShortcut": "Shift+Alt+Space",
  "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:3000/oauth2callback"
      }
    }
  }
}

API

This MCP server provides the following functions for Google Calendar:

  • getEvents: Retrieve events from the user's calendar
  • createEvent: Create a new calendar event
  • updateEvent: Update an existing calendar event
  • deleteEvent: Delete a calendar event

Implementation Details

This server uses:

  • MCP SDK: @modelcontextprotocol/sdk for Claude Desktop integration
  • Google APIs: googleapis for Google Calendar API access
  • TypeScript: For type-safe code
  • Zod: For schema validation
  • Open: For automatic browser opening during auth

Storage and Logging

The server stores the following data:

  • OAuth Token: Stored in memory only (no file-based storage in v0.3.3+)
  • Logs: Stored in ~/.google-calendar-mcp/logs/ in the user's home directory

Troubleshooting

If you encounter any issues:

  1. Check the logs in your home directory at ~/.google-calendar-mcp/logs/
  2. Make sure your Google OAuth credentials are correctly configured
  3. Ensure you have sufficient permissions for Google Calendar API access
  4. Verify your Claude Desktop configuration is correct

Common Errors

  • JSON Parsing Errors: If you see errors like Unexpected non-whitespace character after JSON at position 4 (line 1 column 5), it's typically due to malformed JSON-RPC messages. This has been fixed in version 0.2.6+.
  • Authentication Errors: Verify your Google OAuth credentials
  • Connection Errors: Make sure only one instance of the server is running
  • Disconnection Issues: Ensure your server is properly handling MCP messages without custom TCP sockets

Version History

Version 0.3.3 Changes

  • Removed file-based token storage and improved in-memory token management
  • Fixed various memory leaks and improved resource management
  • Enhanced stability and error handling

Version 0.3.2 Changes

  • Added automatic browser opening for Google Calendar authorization
  • Improved user experience during authentication flow

Version 0.3.1 Changes

  • Updated server version indicator
  • Fixed minor bugs in event handling

Version 0.2.7 Fixes

  • Fixed JSON-RPC message processing to handle malformed messages
  • Improved message processing between client and server with more robust parsing
  • Enhanced logging format with better context information
  • Added debug mode support for troubleshooting JSON-RPC messages

Version 0.2.6 Fixes

  • Fixed JSON-RPC message handling that was causing parsing errors
  • Removed custom TCP socket server which was causing connection issues
  • Added proper error handling for transport errors
  • Improved logging of message exchanges between client and server

Version 0.2.0 Changes

  • Updated to use the latest MCP SDK API (v1.7.0+)
  • Migrated from Server class to the modern McpServer class
  • Improved type safety with properly typed tool handlers
  • Fixed update operations to handle partial event updates properly
  • Enhanced error handling with detailed error messages
  • Optimized performance when handling calendar operations
  • Simplified implementation with direct API calls

Development

To contribute to this project:

# Clone the repository
git clone https://github.com/takumi0706/google-calendar-mcp.git
cd google-calendar-mcp

# Install dependencies
npm install

# Run in development mode
npm run dev

License

MIT

Server Config

{
  "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:3000/oauth2callback"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp