Google Calendar MCP Server

Google Calendar MCP Server

Provides comprehensive Google Calendar integration capabilities allowing AI assistants to list, create, update, and delete calendar events through a standardized Model Context Protocol.

Category
访问服务器

README

Google Calendar MCP Server

A Model Context Protocol (MCP) server that provides comprehensive Google Calendar integration capabilities. This server allows AI assistants and applications to interact with Google Calendar through a standardized protocol.

Features

  • List Events: Retrieve events from Google Calendar with filtering options
  • Create Events: Create new calendar events with full customization
  • Update Events: Modify existing calendar events
  • Delete Events: Remove events from calendars
  • List Calendars: Get available calendars for the authenticated user
  • OAuth Authentication: Secure Google Calendar API access

Tools Available

list_events

Retrieve events from a Google Calendar with various filtering options.

Parameters:

  • calendarId (optional): Calendar ID (default: "primary")
  • timeMin (optional): Lower bound for event start time (RFC3339 timestamp)
  • timeMax (optional): Upper bound for event start time (RFC3339 timestamp)
  • maxResults (optional): Maximum number of events (default: 250)
  • singleEvents (optional): Expand recurring events (default: true)
  • orderBy (optional): Order events by "startTime" or "updated"

create_event

Create a new event in Google Calendar.

Parameters:

  • calendarId (optional): Calendar ID (default: "primary")
  • summary (required): Event title
  • description (optional): Event description
  • start (required): Start date/time object with dateTime and optional timeZone
  • end (required): End date/time object with dateTime and optional timeZone
  • location (optional): Event location
  • attendees (optional): Array of attendee objects with email and displayName
  • recurrence (optional): Array of RRULE strings for recurring events

update_event

Update an existing calendar event.

Parameters:

  • calendarId (optional): Calendar ID (default: "primary")
  • eventId (required): ID of the event to update
  • summary (optional): New event title
  • description (optional): New event description
  • start (optional): New start date/time
  • end (optional): New end date/time
  • location (optional): New event location
  • attendees (optional): New attendees list

delete_event

Delete an event from Google Calendar.

Parameters:

  • calendarId (optional): Calendar ID (default: "primary")
  • eventId (required): ID of the event to delete

list_calendars

List available Google Calendars for the authenticated user.

Parameters:

  • minAccessRole (optional): Minimum access role filter
  • showDeleted (optional): Include deleted calendars (default: false)
  • showHidden (optional): Include hidden calendars (default: false)

Setup

Prerequisites

  1. Google Cloud Project: Create a project in Google Cloud Console
  2. Enable Google Calendar API: Enable the Calendar API for your project
  3. Service Account: Create a service account and download the JSON key file

Installation

  1. Clone this repository

  2. Install dependencies:

    npm install
    
  3. Copy the environment file and configure:

    copy .env.example .env
    
  4. Edit .env and set your Google Service Account key file path:

    GOOGLE_SERVICE_ACCOUNT_KEY_FILE=./path/to/your/service-account-key.json
    

Building

# Build the TypeScript code
npm run build

# Development mode with hot reload
npm run dev

# Type checking
npm run type-check

# Clean build artifacts
npm run clean

Usage

Running the Server

# Start the compiled server
npm start

# Or run in development mode
npm run dev

Integrating with MCP Clients

Add this server to your MCP client configuration:

{
  "servers": {
    "google-calendar": {
      "type": "stdio",
      "command": "node",
      "args": ["./dist/index.js"]
    }
  }
}

For VS Code with MCP extension, add to .vscode/mcp.json:

{
  "servers": {
    "google-calendar-mcp-server": {
      "type": "stdio",
      "command": "node",
      "args": ["./dist/index.js"]
    }
  }
}

Authentication Setup

  1. Create a Service Account:

    • Go to Google Cloud Console
    • Navigate to IAM & Admin > Service Accounts
    • Create a new service account
    • Download the JSON key file
  2. Share Calendar Access:

    • Open Google Calendar
    • Go to calendar settings
    • Share your calendar with the service account email
    • Grant "Make changes to events" permission
  3. Configure Environment:

    • Place the JSON key file in your project directory
    • Update the .env file with the correct path

Development

Project Structure

src/
├── index.ts          # Main MCP server implementation
├── types/            # TypeScript type definitions
└── utils/            # Utility functions

.env.example          # Environment variable template
tsconfig.json         # TypeScript configuration
package.json          # Node.js dependencies and scripts

Adding New Tools

  1. Define a Zod schema for input validation
  2. Create a ToolSchema definition
  3. Implement the async handler function
  4. Register the tool in the server
  5. Add comprehensive error handling

Error Handling

All tools return structured responses:

// Success response
{
  content: [{ type: "text", text: JSON.stringify(result) }]
}

// Error response
{
  content: [{ type: "text", text: JSON.stringify(error) }],
  isError: true
}

Security Considerations

  • Never commit service account keys to version control
  • Use environment variables for all sensitive configuration
  • Implement proper error handling to avoid information leakage
  • Regularly rotate service account keys
  • Follow Google Cloud security best practices

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with proper tests
  4. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For issues and questions:

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选