Google Calendar AutoAuth MCP Server

Google 日历 AutoAuth MCP 服务器

一个用于在 Claude Desktop 中集成 Google 日历的模型上下文协议 (MCP) 服务器,并支持自动身份验证。该服务器使 AI 助手能够通过自然语言交互来管理 Google 日历。

特征

  • 创建带有标题、描述、位置和参加者的日历事件
  • 更新现有日历事件
  • 删除日历事件
  • 检索事件详细信息
  • 列出指定时间范围内的事件
  • 按关键字搜索活动
  • 列出所有可用的日历
  • 支持自然语言日期/时间输入(例如“明天下午 2 点”、“下周一”)
  • 与 Google 日历 API 完全集成
  • 具有自动浏览器启动功能的简单 OAuth2 身份验证流程
  • 支持桌面和 Web 应用程序凭证
  • 全球凭证存储,方便快捷

安装和认证

手动安装

  1. 创建 Google Cloud 项目并获取凭据:a.创建 Google Cloud 项目:
    • 前往Google Cloud Console
    • 创建新项目或选择现有项目
    • 为您的项目启用 Google 日历 API

    b.创建 OAuth 2.0 凭证:

    • 前往“API 和服务”>“凭证”
    • 点击“创建凭证”>“OAuth 客户端 ID”
    • 选择“桌面应用程序”或“Web 应用程序”作为应用程序类型
    • 命名并点击“创建”
    • 对于 Web 应用程序,将http://localhost:3000/oauth2callback添加到授权重定向 URI
    • 下载客户端 OAuth 密钥的 JSON 文件
    • 将密钥文件重命名为gcp-oauth.keys.json
  2. 运行身份验证:您可以通过两种方式进行身份验证:a.全局认证(推荐):
    # First time: Place gcp-oauth.keys.json in your home directory's .calendar-mcp folder mkdir -p ~/.calendar-mcp mv gcp-oauth.keys.json ~/.calendar-mcp/ # Run authentication from anywhere npx @nchufa/calendar auth
    b. 本地身份验证:
    # Place gcp-oauth.keys.json in your current directory # The file will be automatically copied to global config npx @nchufa/calendar auth
    身份验证过程将:
    • 在当前目录或~/.calendar-mcp/中查找gcp-oauth.keys.json
    • 如果在当前目录中找到,则将其复制到~/.calendar-mcp/
    • 打开默认浏览器进行 Google 身份验证
    • 将凭证保存为~/.calendar-mcp/credentials.json

    笔记

    • 身份验证成功后,凭证将全局存储在~/.calendar-mcp/中,可从任何目录使用
    • 支持桌面应用程序和 Web 应用程序凭据
    • 对于 Web 应用程序凭证,请确保将http://localhost:3000/oauth2callback添加到授权重定向 URI
  3. 在 Claude Desktop 中配置:

将以下内容添加到您的 Claude Desktop 配置文件中:

{ "mcpServers": { "calendar": { "command": "npx", "args": [ "@nchufa/calendar" ] } } }

可用工具

服务器提供了以下可以通过Claude Desktop使用的工具:

1. 创建事件( create_event

创建一个新的日历事件。

{ "summary": "Team Meeting", "description": "Weekly team sync to discuss project progress", "location": "Conference Room A", "start": "2025-04-01T14:00:00", "end": "2025-04-01T15:00:00", "attendees": ["colleague@example.com", "manager@example.com"], "reminders": { "useDefault": false, "overrides": [ { "method": "email", "minutes": 30 }, { "method": "popup", "minutes": 10 } ] } }

还支持自然语言日期/时间:

{ "summary": "Coffee with John", "location": "Starbucks Downtown", "start": "tomorrow at 2:30pm", "end": "tomorrow at 3:30pm" }

2. 获取事件( get_event

检索特定日历事件的详细信息。

{ "eventId": "abc123xyz456", "calendarId": "primary" }

3. 更新事件( update_event

更新现有的日历事件。

{ "eventId": "abc123xyz456", "summary": "Updated Meeting Title", "location": "New Location", "start": "2025-04-01T15:00:00", "end": "2025-04-01T16:00:00" }

4.删除事件( delete_event

删除日历事件。

{ "eventId": "abc123xyz456", "calendarId": "primary" }

5.列出事件( list_events

列出指定时间范围内的日历事件。

{ "calendarId": "primary", "timeMin": "2025-04-01T00:00:00", "timeMax": "2025-04-07T23:59:59", "maxResults": 10, "orderBy": "startTime" }

6. 搜索事件( search_events

搜索与查询匹配的事件。

{ "query": "meeting", "calendarId": "primary", "timeMin": "2025-04-01T00:00:00", "maxResults": 5 }

7.列出日历( list_calendars

列出所有可用的日历。

{}

自然语言日期/时间支持

服务器支持各种自然语言格式的日期和时间:

  • 具体日期:“2025-04-01T14:00:00”(ISO 格式)
  • 简单引用:“今天”、“明天”、“现在”
  • 相对时间:“2 小时后”、“3 天后”
  • 日期引用:“下周一”、“下周二”
  • 组合格式:“明天下午 2 点”、“星期一 15:30”

这使得使用自然语言指令创建和更新事件变得容易。

安全说明

  • OAuth 凭证安全地存储在您的本地环境中( ~/.calendar-mcp/
  • 服务器使用离线访问来维持持久身份验证
  • 切勿共享或提交您的凭据以进行版本控制
  • 定期检查并撤销 Google 帐户设置中未使用的访问权限

故障排除

  1. 未找到 OAuth 密钥
    • 确保gcp-oauth.keys.json位于当前目录或~/.calendar-mcp/
    • 检查文件权限
  2. 凭证格式无效
    • 确保您的 OAuth 密钥文件包含webinstalled凭据
    • 对于 Web 应用程序,验证重定向 URI 是否配置正确
  3. 端口已被使用
    • 如果端口 3000 已被使用,请在运行身份验证之前释放它
    • 您可以找到并停止使用该端口的进程

贡献

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

执照

麻省理工学院

致谢

特别感谢GongRzhe和他的Calendar-Autoauth-MCP-Server项目,该项目为此次实现奠定了基础。

支持

如果您遇到任何问题或有疑问,请在 GitHub 存储库上提交问题。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

使 AI 助手能够通过自然语言交互来管理 Google 日历,其功能包括创建、更新和删除事件、搜索日历以及支持自然语言日期/时间输入。

  1. 特征
    1. 安装和认证
      1. 手动安装
    2. 可用工具
      1. 1. 创建事件( create_event )
      2. 2. 获取事件( get_event )
      3. 3. 更新事件( update_event )
      4. 4.删除事件( delete_event )
      5. 5.列出事件( list_events )
      6. 6. 搜索事件( search_events )
      7. 7.列出日历( list_calendars )
    3. 自然语言日期/时间支持
      1. 安全说明
        1. 故障排除
          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
                    Enables AI assistants to interact with Metabase databases and dashboards, allowing users to list and execute queries, access data visualizations, and interact with database resources through natural language.
                    Last updated -
                    9
                    JavaScript
                    • Apple
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Enables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.
                    Last updated -
                    JavaScript
                    • Apple

                  View all related MCP servers

                  ID: cyxk705ub0