
关于
轻量级 Google Calendar 集成,带独立 OAuth 认证。无需 MCP 服务器,支持日历事件的创建、读取、更新和删除。
name: google-calendar-automation description: "轻量级 Google Calendar 集成,带独立 OAuth 认证。无需 MCP 服务器。" license: Apache-2.0 risk: critical source: community metadata: author: sanjay3290 version: "1.0"
Google Calendar
轻量级 Google Calendar 集成,带独立 OAuth 认证。无需 MCP 服务器。
⚠️ 需要 Google Workspace 账户。 不支持个人 Gmail 账户。
适用场景
- 需要从本地脚本列出、创建、查看或更新 Google Calendar 事件。
- 任务需要基于 OAuth 的日历自动化,无需搭建 MCP 服务器。
- 需要在 Workspace 环境中快速操作日历、日程、参会者或事件详情。
首次设置
使用 Google 认证(会打开浏览器):
python scripts/auth.py login
检查认证状态:
python scripts/auth.py status
需要时登出:
python scripts/auth.py logout
命令
所有操作通过 scripts/gcal.py 执行。首次使用时如未登录会自动认证。
列出日历
python scripts/gcal.py list-calendars
列出事件
# 列出主日历事件(默认:未来30天)
python scripts/gcal.py list-events
# 指定时间范围
python scripts/gcal.py list-events --time-min 2024-01-15T00:00:00Z --time-max 2024-01-31T23:59:59Z
# 指定日历
python scripts/gcal.py list-events --calendar "work@example.com"
# 限制结果数量
python scripts/gcal.py list-events --max-results 10
获取事件详情
python scripts/gcal.py get-event EVENT_ID
python scripts/gcal.py get-event EVENT_ID --calendar "work@example.com"
创建事件
# 基本事件
python scripts/gcal.py create-event "Team Meeting" "2024-01-15T10:00:00Z" "2024-01-15T11:00:00Z"
# 带描述和地点
python scripts/gcal.py create-event "Team Meeting" "2024-01-15T10:00:00Z" "2024-01-15T11:00:00Z" \
--description "Weekly sync" --location "Conference Room A"
# 带参会者
python scripts/gcal.py create-event "Team Meeting" "2024-01-15T10:00:00Z" "2024-01-15T11:00:00Z" \
--attendees user1@example.com user2@example.com
# 指定日历
python scripts/gcal.py create-event "Meeting" "2024-01-15T10:00:00Z" "2024-01-15T11:00:00Z" \
--calendar "work@example.com"
更新事件
# 更新标题
python scripts/gcal.py update-event EVENT_ID --summary "New Title"
# 更新时间
python scripts/gcal.py update-event EVENT_ID --start "2024-01-15T14:00:00Z" --end "2024-01-15T15:00:00Z"
# 更新多个字段
python scripts/gcal.py update-event EVENT_ID \
--summary "Updated Meeting" --description "New agenda" --location "Room B"
# 更新参会者
python scripts/gcal.py update-event EVENT_ID --attendees user1@example.com user3@example.com
删除事件
python scripts/gcal.py delete-event EVENT_ID
python scripts/gcal.py delete-event EVENT_ID --calendar "work@example.com"
查找空闲时间
查找与指定参会者的第一个可用会议时段:
# 为自己查找30分钟时段
python scripts/gcal.py find-free-time \
--attendees me \
--time-min "2024-01-15T09:00:00Z" \
--time-max "2024-01-15T17:00:00Z" \
--duration 30
# 为多人查找60分钟时段
python scripts/gcal.py find-free-time \
--attendees me user1@example.com user2@example.com \
--time-min "2024-01-15T09:00:00Z" \
--time-max "2024-01-19T17:00:00Z" \
--duration 60
回复事件邀请
# 接受邀请
python scripts/gcal.py respond-to-event EVENT_ID accepted
# 拒绝邀请
python scripts/gcal.py respond-to-event EVENT_ID declined
# 标记为暂定
python scripts/gcal.py respond-to-event EVENT_ID tentative
# 回复但不通知组织者
python scripts/gcal.py respond-to-event EVENT_ID accepted --no-notify
日期/时间格式
所有时间使用 ISO 8601 格式并带时区:
- UTC:
2024-01-15T10:30:00Z - 带偏移量:
2024-01-15T10:30:00-05:00(美东时间)
日历 ID 格式
- 主日历:使用
primary或省略--calendar参数 - 其他日历:使用
list-calendars返回的日历 ID(通常是邮箱地址)
令牌管理
令牌使用系统密钥环安全存储:
- macOS:钥匙串
- Windows:Windows 凭据保管库
- Linux:Secret Service API(GNOME 密钥环、KDE 钱包等)
服务名称:google-calendar-skill-oauth
令牌过期时会通过 Google 云函数自动刷新。
使用限制
- 仅在任务明确匹配上述范围时使用此技能。
- 不要将输出视为环境特定验证、测试或专家审查的替代品。
- 如果所需输入、权限、安全边界或成功标准不明确,请停下来寻求澄清。
兼容工具
Claude CodeCursor
标签
前端开发