Google Calendar MCP Server

Google Calendar MCP Server

Provides a standardized interface for LLMs to read, create, and manage Google Calendar events. It supports full event lifecycle management and includes advanced capabilities for processing events from screenshots and images.

Category
访问服务器

README

Google Calendar MCP Server

This is a Model Context Protocol (MCP) server that provides integration with Google Calendar. It allows LLMs to read, create, and manage calendar events through a standardized interface.

Features

  • List available calendars
  • List events from a calendar
  • Create new calendar events
  • Update existing events
  • Delete events
  • Process events from screenshots and images

Requirements

  1. Node.js 16 or higher
  2. TypeScript 5.3 or higher
  3. A Google Cloud project with the Calendar API enabled
  4. OAuth 2.0 credentials (Client ID and Client Secret)

Project Structure

google-calendar-mcp/
├── src/           # TypeScript source files
├── build/         # Compiled JavaScript output
├── llm/           # LLM-specific configurations and prompts
├── package.json   # Project dependencies and scripts
└── tsconfig.json  # TypeScript configuration

Google Cloud Setup

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one.
  3. Enable the Google Calendar API for your project. Ensure that the right project is selected from the top bar before enabling the API.
  4. Create OAuth 2.0 credentials:
    • Go to Credentials
    • Click "Create Credentials" > "OAuth client ID"
    • Choose "User data" for the type of data that the app will be accessing
    • Add your app name and contact information
    • Add the following scopes (optional):
      • https://www.googleapis.com/auth/calendar.events
    • Select "Desktop app" as the application type
    • Add your email address as a test user under the OAuth Consent screen
      • Note: it will take a few minutes for the test user to be added. The OAuth consent will not allow you to proceed until the test user has propogated.

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Build the TypeScript code:
    npm run build
    
  4. Download your Google OAuth credentials from the Google Cloud Console (under "Credentials") and rename the file to gcp-oauth.keys.json and place it in the root directory of the project.

Available Scripts

  • npm run build - Build the TypeScript code
  • npm run build:watch - Build TypeScript in watch mode for development
  • npm run dev - Start the server in development mode using ts-node
  • npm run auth - Start the authentication server for Google OAuth flow

Authentication

The server supports both automatic and manual authentication flows:

Automatic Authentication (Recommended)

  1. Place your Google OAuth credentials in a file named gcp-oauth.keys.json in the root directory of the project.
  2. Start the MCP server:
    npm start
    
  3. If no valid authentication tokens are found, the server will automatically:
    • Start an authentication server (on ports 3000-3004)
    • Open a browser window for the OAuth flow
    • Save the tokens securely once authenticated
    • Shut down the auth server
    • Continue normal MCP server operation

The server automatically manages token refresh and re-authentication when needed:

  • Tokens are automatically refreshed before expiration
  • If refresh fails, clear error messages guide you through re-authentication
  • Token files are stored securely with restricted permissions

Manual Authentication

For advanced users or troubleshooting, you can manually run the authentication flow:

npm run auth

This will:

  1. Start the authentication server
  2. Open a browser window for the OAuth flow
  3. Save the tokens and exit

Security Notes

  • OAuth credentials are stored in gcp-oauth.keys.json
  • Authentication tokens are stored in .gcp-saved-tokens.json with 600 permissions
  • Tokens are automatically refreshed in the background
  • Token integrity is validated before each API call
  • The auth server automatically shuts down after successful authentication
  • Never commit OAuth credentials or token files to version control

Usage

The server exposes the following tools:

  • list-calendars: List all available calendars
  • list-events: List events from a calendar
  • create-event: Create a new calendar event
  • update-event: Update an existing calendar event
  • delete-event: Delete a calendar event

Using with Claude Desktop

  1. Add this configuration to your Claude Desktop config file. E.g. /Users/<user>/Library/Application Support/Claude/claude_desktop_config.json:

    {
      "mcpServers": {
        "google-calendar": {
          "command": "node",
          "args": ["path/to/build/index.js"]
        }
      }
    }
    
  2. Restart Claude Desktop

Example Usage

Along with the normal capabilities you would expect for a calendar integration you can also do really dynamic things like add events from screenshots and images and much more.

  1. Add events from screenshots and images:

    Add this event to my calendar based on the attached screenshot.
    

    Supported image formats: PNG, JPEG, GIF Images can contain event details like date, time, location, and description

  2. Check attendance:

    Which events tomorrow have attendees who have not accepted the invitation?
    
  3. Auto coordinate events:

    Here's some available that was provided to me by someone I am interviewing. Take a look at the available times and create an event for me to interview them that is free on my work calendar.
    
  4. Provide your own availability:

    Please provide availability looking at both my personal and work calendar for this upcoming week. Choose times that work well for normal working hours on the East Coast. Meeting time is 1 hour
    

Development

Troubleshooting

Common issues and solutions:

  1. OAuth Token expires after one week (7 days)

    • Apps that are in testing mode, rather than production, will need to go through the OAuth flow again after a week.
  2. OAuth Token Errors

    • Ensure your gcp-oauth.keys.json is correctly formatted
    • Try deleting .gcp-saved-tokens.json and re-authenticating
  3. TypeScript Build Errors

    • Make sure all dependencies are installed: npm install
    • Check your Node.js version matches prerequisites
    • Clear the build directory: rm -rf build/
  4. Image Processing Issues

    • Verify the image format is supported
    • Ensure the image contains clear, readable text

Security Notes

  • The server runs locally and requires OAuth authentication
  • OAuth credentials should be stored in gcp-oauth.keys.json in the project root
  • Authentication tokens are stored in .gcp-saved-tokens.json with restricted file permissions
  • Tokens are automatically refreshed when expired
  • Never commit your OAuth credentials or token files to version control
  • For production use, get your OAuth application verified by Google

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选