跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Google Calendar,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 使用 Google Calendar:查看你的日历,列出和搜索任意时间段的活动,读取活动详情和邀请对象,创建和改期带邀请对象和 Google Meet 链接的会议,回复邀请,用一句话添加活动,并查看他人何时有空。支持个人 Google 账户和 Google Workspace。
试试这样问
Google Calendar 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Google Calendar、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Google Calendar + Gemini
让你的 AI 使用 Google Calendar:查看你的日历,列出和搜索任意时间段的活动,读取活动详情和邀请对象,创建和改期带邀请对象和 Google Meet 链接的会议,回复邀请,用一句话添加活动,并查看他人何时有空。支持个人 Google 账户和 Google Workspace。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET
步骤 1 — 获取凭证
- 打开 console.cloud.google.com,选择或创建一个项目,然后进入 APIs & Services → Library 启用 Google Calendar API。
- 打开 APIs & Services → OAuth consent screen。如果你使用 Google Workspace,选择 Internal(最简单),否则选择 External。选择 External 时,请把发布状态设为 In production:应用处于 Testing 状态时,Google 会在 7 天后撤销它的刷新令牌,连接器每周都会停止工作。如果只供你自己的账户使用,可以直接跳过“unverified app”警告继续。
- 打开 APIs & Services → Credentials → Create credentials → OAuth client ID,应用类型选择 Web application,并添加已授权的重定向 URI
https://cloud.anythingmcp.com/api/mcp-oauth/callback。如果你自行托管 AnythingMCP,请改填https://your-anythingmcp-host/api/mcp-oauth/callback。 - 把客户端 ID 填入
GOOGLE_CLIENT_ID,把客户端密钥填入GOOGLE_CLIENT_SECRET,然后安装连接器。 - 在连接器页面点击 Authorize with Provider,用 AI 要使用其日历的 Google 账户登录。刷新令牌会加密存储,访问令牌会自动续期。
一个 Google 客户端服务所有 Google 连接器:同一个 Cloud 项目和 OAuth 客户端可以服务所有 Google 连接器:Gmail、Google Calendar、Google Drive、Google Sheets、Google Docs、Google Tasks、Search Console、Analytics 和 Ads。在该项目中启用每个 API,复用同一个客户端 ID 和密钥,并为每个连接器各授权一次。每个连接器只请求它自己需要的权限。
邀请与空闲时间:只有当 AI 请 Google 通知时,邀请对象才会收到邮件;否则活动仍会出现在他们的日历中。只有当同事的忙闲信息对你可见时,才能查看他们的空闲时间,在同一个 Google Workspace 组织内通常都是可见的。
权限:连接器请求 https://www.googleapis.com/auth/calendar.events(在你可以编辑的每个日历中创建、修改和删除活动)和 https://www.googleapis.com/auth/calendar.readonly(读取日历列表、日历、颜色和忙闲信息)。它不能创建或删除日历,也不能更改日历的共享对象。
只读设置:在连接器的 OAuth 设置中把 scope 改为 https://www.googleapis.com/auth/calendar.readonly,重新授权,并停用 gcal_create_event、gcal_update_event、gcal_respond_to_event 和 gcal_quick_add。
安装时默认关闭:gcal_delete_event。只有在需要 AI 删除活动时才打开这个工具。
常见错误:401 表示授权已过期或被撤销(同意屏幕处于 Testing 状态时,7 天后必然发生):请再次点击 Authorize with Provider。403 accessNotConfigured 表示 Cloud 项目中没有启用 Google Calendar API。403 insufficientPermissions 表示 scope 不允许该调用(在只读设置下尝试修改),或者你对该日历只有查看权限。404 表示日历或活动不存在,或此账户看不到它。
连接器不会创建、删除或共享日历,也不处理活动附件、日历设置或推送通知。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
Google Calendar的工具。
可用工具
| Tool | What it does |
|---|---|
gcal_list_calendars | List the calendars in the signed-in user's calendar list (own, shared and subscribed) with id, summary, timeZone, accessRole and primary… |
gcal_get_calendar | Get one calendar's metadata: summary, description, location and time zone |
gcal_list_events | List or search events of one calendar in a time window. time_min and time_max are RFC 3339 with offset (2026-10-09T00:00:00+02:00); q… |
gcal_get_event | Get one event with all details: start and end, attendees and their responseStatus, organizer, recurrence, reminders, hangoutLink and… |
gcal_create_event | Create an event: title, start and end (timed or all-day), location, description, guests, recurrence, reminders and optionally a Google Meet… |
gcal_update_event | Change an event: only the fields given are changed (PATCH). attendees, recurrence and reminders replace the whole current value, so read… |
gcal_respond_to_event | Accept, decline or tentatively accept an invitation |
gcal_quick_add | Create an event from one line of natural language, the way Calendar's quick add does, e.g. "Lunch with Ana tomorrow 12:30-13:30 at Café… |
gcal_delete_event | Delete an event (all occurrences when it is a recurring series; pass an occurrence id to cancel one occurrence) |
gcal_query_free_busy | Check when calendars are busy in a time window, without event details: returns busy intervals per calendar |
gcal_list_colors | List the color palette: event colors (color_id "1" to "11") and calendar colors, each with background and foreground hex values |
示例提示
- “这周剩下几天我的日历上有什么?标出时间重叠的会议。”
- “下周二或周三上午找一个和 [email protected] 都空闲的 45 分钟时段,并给她发送带 Google Meet 链接的邀请。”
- “把明天下午 3 点的评审改到周五同一时间,并通知参会者。”
- “接受周四规划会议的邀请,并拒绝与它冲突的那个会议。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?