Google 日历 AutoAuth MCP 服务器
一个用于在 Claude Desktop 中集成 Google 日历的模型上下文协议 (MCP) 服务器,并支持自动身份验证。该服务器使 AI 助手能够通过自然语言交互来管理 Google 日历。
特征
- 创建带有标题、描述、位置和参加者的日历事件
- 更新现有日历事件
- 删除日历事件
- 检索事件详细信息
- 列出指定时间范围内的事件
- 按关键字搜索活动
- 列出所有可用的日历
- 支持自然语言日期/时间输入(例如“明天下午 2 点”、“下周一”)
- 与 Google 日历 API 完全集成
- 具有自动浏览器启动功能的简单 OAuth2 身份验证流程
- 支持桌面和 Web 应用程序凭证
- 全球凭证存储,方便快捷
安装和认证
手动安装
- 创建 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
- 运行身份验证:您可以通过两种方式进行身份验证:a.全局认证(推荐):b. 本地身份验证:身份验证过程将:
- 在当前目录或
~/.calendar-mcp/
中查找gcp-oauth.keys.json
- 如果在当前目录中找到,则将其复制到
~/.calendar-mcp/
- 打开默认浏览器进行 Google 身份验证
- 将凭证保存为
~/.calendar-mcp/credentials.json
笔记:
- 身份验证成功后,凭证将全局存储在
~/.calendar-mcp/
中,可从任何目录使用 - 支持桌面应用程序和 Web 应用程序凭据
- 对于 Web 应用程序凭证,请确保将
http://localhost:3000/oauth2callback
添加到授权重定向 URI
- 在当前目录或
- 在 Claude Desktop 中配置:
将以下内容添加到您的 Claude Desktop 配置文件中:
可用工具
服务器提供了以下可以通过Claude Desktop使用的工具:
1. 创建事件( create_event
)
创建一个新的日历事件。
还支持自然语言日期/时间:
2. 获取事件( get_event
)
检索特定日历事件的详细信息。
3. 更新事件( update_event
)
更新现有的日历事件。
4.删除事件( delete_event
)
删除日历事件。
5.列出事件( list_events
)
列出指定时间范围内的日历事件。
6. 搜索事件( search_events
)
搜索与查询匹配的事件。
7.列出日历( list_calendars
)
列出所有可用的日历。
自然语言日期/时间支持
服务器支持各种自然语言格式的日期和时间:
- 具体日期:“2025-04-01T14:00:00”(ISO 格式)
- 简单引用:“今天”、“明天”、“现在”
- 相对时间:“2 小时后”、“3 天后”
- 日期引用:“下周一”、“下周二”
- 组合���式:“明天下午 2 点”、“星期一 15:30”
这使得使用自然语言指令创建和更新事件变得容易。
安全说明
- OAuth 凭证安全地存储在您的本地环境中(
~/.calendar-mcp/
) - 服务器使用离线访问来维持持久身份验证
- 切勿共享或提交您的凭据以进行版本控制
- 定期检查并撤销 Google 帐户设置中未使用的访问权限
故障排除
- 未找到 OAuth 密钥
- 确保
gcp-oauth.keys.json
位于当前目录或~/.calendar-mcp/
- 检查文件权限
- 确保
- 凭证格式无效
- 确保您的 OAuth 密钥文件包含
web
或installed
凭据 - 对于 Web 应用程序,验证重定向 URI 是否配置正确
- 确保您的 OAuth 密钥文件包含
- 端口已被使用
- 如果端口 3000 已被使用,请在运行身份验证之前释放它
- 您可以找到并停止使用该端口的进程
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
执照
麻省理工学院
致谢
特别感谢GongRzhe和他的Calendar-Autoauth-MCP-Server项目,该项目为此次实现奠定了基础。
支持
如果您遇到任何问题或有疑问,请在 GitHub 存储库上提交问题。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
使 AI 助手能够通过自然语言交互来管理 Google 日历,其功能包括创建、更新和删除事件、搜索日历以及支持自然语言日期/时间输入。
Related MCP Servers
- -securityFlicense-qualityGoogle Calendar integration in Cursor IDE. This server enables AI assistants to manage Google Calendar events through natural language interactions.Last updated -505JavaScript
- -securityAlicense-qualityServer 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 -226JavaScriptMIT License
- -securityFlicense-qualityEnables 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
- -securityAlicense-qualityIntegrates Google Calendar with AI assistants through the Model Context Protocol, allowing users to view and manage calendar events through natural language interaction.Last updated -404TypeScriptMIT License