这是一个用于将Google Calendar集成到Claude Desktop的Model Context Protocol (MCP) 服务器,支持自动身份验证。该服务器具备创建、读取、更新和删除日历事件的功能,极大地提升了日历管理的便捷性。
从GitHub仓库下载MCP服务器:
git clone https://github.com/yourusername/calendar-mcp-server.git
cd calendar-mcp-server
安装所需的Python包:
pip install google-auth google-auth-oauthlib googleapis-common-protos google-resumable-media
在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访问权限。
💡 使用建议
检查网络是否正常,确认日历API已正确启用,并且服务账户有适当的权限。
💡 使用建议
确保所有时间字段都遵循ISO 8601标准格式(例如:"2024-01-20T10:00:00Z")。
欢迎任何贡献!请通过提交Pull Request的方式参与项目开发。
本项目采用ISC许可证。
gongrzhe