Back to MCP directory
publicPublicdnsLocal runtime

GongRzhe_Calendar-Autoauth-MCP-Server

一个为Claude桌面应用提供Google日历集成的MCP服务器,支持自动认证和自然语言交互管理日历事件

article

README

🚀 Google日历AutoAuth MCP服务器

这是一个用于将Google Calendar集成到Claude Desktop的Model Context Protocol (MCP) 服务器,支持自动身份验证。该服务器具备创建、读取、更新和删除日历事件的功能,极大地提升了日历管理的便捷性。

✨ 主要特性

  • 创建事件:支持指定标题、开始时间、结束时间、描述和位置。
  • 列出事件:可以根据时间范围查询特定时间段内的日历事件,并支持按开始时间排序。
  • 更新事件:允许修改事件的标题、时间和其他属性。
  • 删除事件:可以指定事件ID进行删除。

📦 安装指南

1. 下载服务器

从GitHub仓库下载MCP服务器:

git clone https://github.com/yourusername/calendar-mcp-server.git
cd calendar-mcp-server

2. 安装依赖

安装所需的Python包:

pip install google-auth google-auth-oauthlib googleapis-common-protos google-resumable-media

3. 配置日历API

在Google Cloud Console中创建项目并启用日历API。下载service-account.json文件,并将其置于项目的根目录。

💻 使用示例

基础用法

创建事件

{
  "summary": "团队会议",
  "start": {
    "dateTime": "2024-01-20T10:00:00Z"
  },
  "end": {
    "dateTime": "2024-01-20T11:00:00Z"
  },
  "description": "每周一次的团队同步",
  "location": "A会议室"
}

列出事件

{
  "timeMin": "2024-01-01T00:00:00Z",
  "timeMax": "2024-12-31T23:59:59Z",
  "maxResults": 10,
  "orderBy": "startTime"
}

更新事件

{
  "eventId": "event123",
  "summary": "更新后的会议标题",
  "start": {
    "dateTime": "2024-01-20T11:00:00Z"
  },
  "end": {
    "dateTime": "2024-01-20T12:00:00Z"
  }
}

删除事件

{
  "eventId": "event123"
}

📚 详细文档

安全注意事项

⚠️ 重要提示

  • OAuth凭证安全:确保service-account.json文件不会被泄露或提交到版本控制系统。
  • 权限管理:定期检查并清理不再使用的API访问权限。

故障排除

问题1:无法连接到Google Calendar

💡 使用建议

检查网络是否正常,确认日历API已正确启用,并且服务账户有适当的权限。

问题2:时间格式错误

💡 使用建议

确保所有时间字段都遵循ISO 8601标准格式(例如:"2024-01-20T10:00:00Z")。

贡献

欢迎任何贡献!请通过提交Pull Request的方式参与项目开发。

📄 许可证

本项目采用ISC许可证。

作者

gongrzhe

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client