README
🚀 Google日历MCP服务器
Google日历MCP服务器是一个基于Model Context Protocol(MCP)的服务器,它能够提供对Google Calendar数据的访问。借助该服务器,用户可以方便地列出可用日历、查找空闲时间段以及获取即将进行的事件。
🚀 快速开始
使用本服务器,你可以轻松实现对Google Calendar数据的访问,以下是使用步骤。
✨ 主要特性
- 📜 列出可用的Google日历
- 🕰️ 在日历中查找空闲时间段
- 📅 获取日历中的即将进行的事件
📦 安装指南
先决条件
- Python 3.9+
- 启用了Calendar API的Google Cloud项目
- OAuth2凭证
安装步骤
- 安装依赖项:
pip install -r requirements.txt
- 设置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) |
Scan to contact