mcpField
G
Google Calendar MCP Server

Google Calendar MCP Server

本地服务
github.com/highlight-ing生产力082 周前更新

关于 Google Calendar MCP Server

Google Calendar MCP Server 通过 MCP 提供 Google Calendar 事件管理工具,适用于需要以程序化方式维护日程的用户。它支持按日期范围查询事件,以及创建、更新和删除事件。

主要功能

  1. 01按日期范围列出事件
  2. 02创建带参与者的事件
  3. 03更新现有事件
  4. 04删除日历事件

适用场景

  1. 01查看指定时间段的日程
  2. 02创建包含参与者的会议
  3. 03修改会议时间或地点
  4. 04删除不再需要的事件

MCP 相关

该 MCP 服务将 Google Calendar API 的查询和事件管理功能作为工具提供给 MCP 客户端。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

Google Calendar MCP 服务

一个用于与 Google Calendar API 交互的模型上下文协议(MCP)服务。此服务可让你通过 MCP 接口以编程方式管理日历事件。

功能

日历工具
  • list_events:列出即将发生的日历事件,并按日期范围筛选
  • create_event:创建包含参会者的新日历事件
  • update_event:更新现有日历事件
  • delete_event:删除日历事件

前提条件

  1. Node.js:安装 14 或更高版本的 Node.js
  2. Google Cloud Console 设置:
    • 前往 Google Cloud Console
    • 创建新项目或选择现有项目
    • 启用 Google Calendar API:
      1. 前往“APIs & Services” > “Library”
      2. 搜索并启用“Google Calendar API”
    • 设置 OAuth 2.0 凭据:
      1. 前往“APIs & Services” > “Credentials”
      2. 点击“Create Credentials” > “OAuth client ID”
      3. 选择“Web application”
      4. 将 http://localhost:3000/code 添加到“Authorized redirect URIs”
      5. 记下 Client ID 和 Client Secret

设置说明

  1. 克隆并安装:

    git clone https://github.com/yourusername/google-calendar-mcp-server.git
    cd google-calendar-mcp-server
    npm install
    
  2. 创建 OAuth 凭据: 在根目录中创建 credentials.json 文件:

    {
        "web": {
            "client_id": "YOUR_CLIENT_ID",
            "client_secret": "YOUR_CLIENT_SECRET",
            "redirect_uris": ["http://localhost:3000/code"],
            "auth_uri": "https://accounts.google.com/o/oauth2/auth",
            "token_uri": "https://oauth2.googleapis.com/token"
        }
    }
    
  3. 获取刷新令牌:

    node get-refresh-token.js
    

    此操作将:

    • 打开浏览器,以进行 Google OAuth 身份验证
    • 请求以下权限:
      • https://www.googleapis.com/auth/calendar
    • 将凭据保存到 token.json
    • 在控制台中显示刷新令牌
  4. 配置 MCP 设置: 将服务配置添加到 MCP 设置文件中:

    • 对于 VSCode Claude 扩展:~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
    • 对于 Claude 桌面应用:~/Library/Application Support/Claude/claude_desktop_config.json

    将以下内容添加到 mcpServers 对象中:

    {
      "mcpServers": {
        "google-calendar": {
          "command": "node",
          "args": ["/path/to/google-calendar-server/build/index.js"],
          "env": {
            "GOOGLE_ACCESS_TOKEN": "your_access_token",
          }
        }
      }
    }
    
  5. 构建并运行:

    npm run build
    

使用示例

日历操作
  1. 列出事件:

    {
      "maxResults": 10,
      "timeMin": "2024-01-01T00:00:00Z",
      "timeMax": "2024-12-31T23:59:59Z"
    }
    
  2. 创建事件:

    {
      "summary": "Team Meeting",
      "location": "Conference Room",
      "description": "Weekly sync-up",
      "start": "2024-01-24T10:00:00Z",
      "end": "2024-01-24T11:00:00Z",
      "attendees": ["[email protected]"]
    }
    
  3. 更新事件:

    {
      "eventId": "event_id",
      "summary": "Updated Meeting",
      "location": "Virtual",
      "description": "Rescheduled weekly sync-up",
      "start": "2024-01-25T10:00:00Z",
      "end": "2024-01-25T11:00:00Z"
    }
    
  4. 删除事件:

    {
      "eventId": "event_id"
    }
    

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。