Google Calendar MCP Server

Integrations

  • Provides tools for managing Google Calendar, including listing calendars, creating/reading/updating/deleting events, and fetching events between specified dates with OAuth 2.0 authentication.

Google 日历 MCP 服务器

使用 TypeScript 构建的与 Google 日历集成的模型上下文协议 (MCP) 服务器。

特征

  • Google 日历与 OAuth 2.0 身份验证无缝集成
  • 用于自动身份验证的持久令牌存储
  • 通过全面的事件操作列出和管理日历
  • 创建、读取、更新和删除日历事件
  • 获取指定日期之间的日历事件
  • 用于实时更新的服务器发送事件 (SSE) 传输选项
  • 与 Claude 和其他兼容 MCP 的 AI 助手轻松集成

安装

npm install -g mcp-google-calendar

或者直接运行:

npx -y mcp-google-calendar

先决条件

  1. Node.js(v16 或更高版本)
  2. Google 云端平台帐户
  3. 已启用 Google 日历 API
  4. OAuth 2.0 凭证

设置

1. Google Cloud 配置

  1. 前往Google Cloud Console
  2. 创建新项目或选择现有项目
  3. 启用 Google 日历 API:
    • 导航至“API 和服务”>“库”
    • 搜索“Google 日历 API”
    • 点击“启用”
  4. 配置 OAuth 同意屏幕:
    • 前往“API 和服务”>“OAuth 同意屏幕”
    • 选择“外部”用户类型(对于 Google Workspace,则选择“内部”)
    • 填写必填信息:
      • 应用程序名称:mcp-日历
      • 用户支持电子邮件:(您的电子邮件)
      • 开发者联系信息:(您的电子邮件)
    • 添加范围:
    • 完成设置
  5. 创建 OAuth 凭证:
    • 前往“凭证”
    • 点击“创建凭证”>“OAuth 客户端 ID”
    • 选择“桌面应用”作为应用程序类型
    • 为其命名(例如,“MCP 日历桌面客户端”)
    • 下载 JSON 文件并将其保存为项目目录中的credentials.json

2.环境配置

在项目根目录中创建一个.env文件:

# Server configuration PORT=3420 # Google Calendar API configuration CREDENTIALS_PATH=./credentials.json

用法

启动服务器

从标准 WebSocket 开始:

npx -y mcp-google-calendar

从服务器发送事件(SSE)开始:

npx -y mcp-google-calendar --sse

使用 Claude Desktop

将其添加到您的claude_desktop_config.json中:

{ "mcpServers": { "mcp-google-calendar": { "command": "npx", "args": ["-y", "mcp-google-calendar"], "env": { "CREDENTIALS_PATH": "/path/to/your/credentials.json" } } } }

身份验证过程

第一次运行服务器:

  1. 浏览器窗口将自动打开
  2. 使用您的 Google 帐户登录
  3. 授予请求的日历权限
  4. 身份验证令牌保存到token.json

在后续发布中:

  • 服务器自动使用保存的令牌
  • 除非令牌过期,否则无需浏览器交互

可用工具

工具描述
list_calendars获取所有可用日历
list_calendar_events检索指定日期之间的事件
create_calendar_event向日历添加新事件
get_calendar_event获取特定事件的详细信息
edit_calendar_event修改现有日历事件
delete_calendar_event从日历中删除事件

发展

克隆并设置项目:

git clone https://github.com/am2rican5/mcp-google-calendar.git cd mcp-google-calendar npm install

构建项目:

npm run build

以开发模式运行:

npm start

安全注意事项

⚠️重要安全警告⚠️

  • credentials.jsontoken.json包含敏感的身份验证信息
  • 切勿将这些文件提交到版本控制或公开共享
  • 每个用户都应该创建自己的 OAuth 凭证
  • 如果您怀疑凭据被泄露,请立即在 Google Cloud Console 中撤销它们
  • 该令牌授予您访问 Google 日历数据的权限

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求
-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

通过模型上下文协议将 Google 日历与 AI 助手集成,让用户可以通过自然语言交互查看和管理日历事件。

  1. 特征
    1. 安装
      1. 先决条件
        1. 设置
          1. 1. Google Cloud 配置
          2. 2.环境配置
        2. 用法
          1. 启动服务器
          2. 使用 Claude Desktop
          3. 身份验证过程
        3. 可用工具
          1. 发展
            1. 安全注意事项
              1. 执照
                1. 贡献

                  Related MCP Servers

                  • -
                    security
                    F
                    license
                    -
                    quality
                    Google Calendar integration in Cursor IDE. This server enables AI assistants to manage Google Calendar events through natural language interactions.
                    Last updated -
                    5
                    0
                    5
                    JavaScript
                  • -
                    security
                    A
                    license
                    -
                    quality
                    Server for Google Calendar integration in Cluade Desktop with auto authentication support. This server enables AI assistants to manage Google Calendar events through natural language interactions.
                    Last updated -
                    22
                    6
                    JavaScript
                    MIT License
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Allows interaction with Google Calendar through Claude Desktop using the Model Context Protocol, enabling calendar event management and schedule analysis.
                    Last updated -
                    2
                    JavaScript
                    • Apple
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that integrates Google Calendar with Claude Desktop, enabling users to manage calendar events (view, create, update, delete) through natural language.
                    Last updated -
                    133
                    21
                    TypeScript
                    MIT License

                  View all related MCP servers

                  ID: 0j32839h00