Back to MCP directory
publicPublicdnsLocal runtime

GongRzhe_Calendar-MCP-Server

一个为Claude Desktop设计的Google日历集成MCP服务器,支持通过自然语言交互管理日历事件,包括创建、查询、更新和删除等功能。

article

README

🚀 Google Calendar MCP 服务器

Google Calendar MCP 服务器是一个用于 Google 日历集成的 Claude Desktop 模型上下文协议(MCP)服务器。借助该服务器,AI 助手能够通过自然语言交互来管理 Google 日历事件,为用户提供便捷的日历管理体验。

smithery badge npm 版本 许可证: ISC

🚀 快速开始

本服务器允许 AI 助手通过自然语言交互管理 Google 日历事件,你可以按照以下步骤进行安装和设置。

✨ 主要特性

  • 创建日历事件:可创建带有标题、时间、描述和位置的日历事件。
  • 检索事件信息:通过事件 ID 检索事件详细信息。
  • 更新事件内容:能够更新现有事件的标题、时间、描述和位置。
  • 删除事件操作:支持删除指定事件。
  • 列出指定时段事件:可在指定时间段内列出事件。
  • 集成 Google 日历 API:与 Google 日历 API 完全集成。
  • 安全认证机制:采用安全的 OAuth2 身份验证。

📦 安装指南

通过 Smithery 安装

要通过 Smithery 自动安装 Claude Desktop 的 Google 日历集成,可使用以下命令:

npx -y @smithery/cli install @gongrzhe/server-calendar-mcp --client claude

手动安装

使用以下命令进行手动安装:

npm install @gongrzhe/server-calendar-mcp

📚 详细文档

设置步骤

  1. 创建 Google Cloud 项目并获取凭证
    • 创建 Google Cloud 项目
      • 访问 Google Cloud Console
      • 创建新项目或选择现有项目。
      • 启用项目的 Google 日历 API。
    • 创建 OAuth 2.0 凭证
      • 转到“APIs & Services” > “Credentials”。
      • 点击“创建凭据” > “OAuth 客户端 ID”。
      • 选择“桌面应用”作为应用程序类型。
      • 输入名称并点击“创建”。
      • 获取您的 GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
    • 获取刷新令牌
      • 访问 OAuth 2.0 Playground
      • 点击右上角的齿轮图标(设置)。
      • 启用“使用自己的 OAuth 凭证”。
      • 输入您的 OAuth 客户端 ID 和客户端密钥。
      • 在左侧面板中找到“Calendar API v3”并选择 "https://www.googleapis.com/auth/calendar"。
      • 点击“授权 API”并完成 OAuth 流程。
      • 点击“交换授权代码以获取令牌”。
      • 复制“刷新令牌”,这就是您的 GOOGLE_REFRESH_TOKEN
  2. 在 Claude Desktop 中配置
{
  "calendar": {
    "command": "npx",
    "args": [
      "@gongrzhe/server-calendar-mcp"
    ],
    "env": {
      "GOOGLE_CLIENT_ID": "your_client_id_here",
      "GOOGLE_CLIENT_SECRET": "your_client_secret_here",
      "GOOGLE_REFRESH_TOKEN": "your_refresh_token_here"
    }
  }
}

💻 使用示例

基础用法

创建日历事件

# 创建新日历
curl -X POST http://localhost:3000/calendars \
  -H 'Content-Type: application/json' \
  -d '{"name": "My Calendar"}'

# 在指定日历中创建事件
curl -X POST http://localhost:3000/calendars/[CALENDAR_ID]/events \
  -H 'Content-Type: application/json' \
  -d '{"summary": "Meeting", "start": {"dateTime": "2024-01-01T10:00:00"}, "end": {"dateTime": "2024-01-01T11:00:00"}}'

获取事件

# 获取所有日历
curl http://localhost:3000/calendars

# 获取特定日历的事件
curl http://localhost:3000/calendars/[CALENDAR_ID]/events

⚠️ 重要提示

  • 刷新令牌提供对您的 Google 日历的访问权限,请妥善保管。
  • 不要将凭证提交到版本控制系统。
  • 定期更新和管理 API 密钥以确保安全。

💡 使用建议

欢迎贡献!请随意提交 Pull Request。

📄 许可证

本项目使用 ISC 许可证。

👨‍💻 作者

gongrzhe

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client