返回 MCP 目录
public公开dns本地运行

google-calendar-mcp-server-6eb

Google日历MCP服务

article

README

🚀 Google日历MCP服务器

Google日历MCP服务器是一个基于Model Context Protocol(MCP)的服务器,它能够提供对Google Calendar数据的访问。借助该服务器,用户可以方便地列出可用日历、查找空闲时间段以及获取即将进行的事件。

🚀 快速开始

使用本服务器,你可以轻松实现对Google Calendar数据的访问,以下是使用步骤。

✨ 主要特性

  • 📜 列出可用的Google日历
  • 🕰️ 在日历中查找空闲时间段
  • 📅 获取日历中的即将进行的事件

📦 安装指南

先决条件

  • Python 3.9+
  • 启用了Calendar API的Google Cloud项目
  • OAuth2凭证

安装步骤

  1. 安装依赖项:
pip install -r requirements.txt
  1. 设置Google Calendar API凭证:
python setup_credentials.py

按照提示使用Google进行身份验证。 3. 运行服务器:

python google_calendar_server.py

💻 使用示例

与Claude Desktop一起使用

通过编辑配置文件将Claude Desktop配置为使用此服务器:

{
  "mcpServers": {
    "google-calendar": {
      "command": "python",
      "args": ["/full/path/to/google_calendar_server.py"],
      "env": {
        "GOOGLE_TOKEN_FILE": "/path/to/token/file.json"
      }
    }
  }
}

可用工具

list_calendars

列出所有可用的Google日历。

get_available_slots

查找日历中的空闲时间段。 | 参数 | 详情 | | ---- | ---- | | calendar_id | 要检查的日历ID | | days_ahead | 向前检查的天数(默认:7) | | slot_duration_minutes | 每个时间段的持续时间,以分钟为单位(默认:30) | | start_hour | 一天中的开始小时(24小时制,默认:9) | | end_hour | 一天中的结束小时(24小时制,默认:17) |

get_upcoming_events

获取日历中的即将进行的事件。 | 参数 | 详情 | | ---- | ---- | | calendar_id | 要检查的日历ID | | days_ahead | 向前检查的天数(默认:7) | | max_events | 要返回的最大事件数(默认:10) |

help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端