
Google 日历 MCP 服务器:23 个大型语言模型代理工具。使用 UVX calendar-mcp-server 安装。
概览
一个MCP服务器,允许LLM客户端读写你的Google日历。它作为单一进程运行——默认是stdio,可选地可流式HTTP——并展示了23个具有结构化输出的工具:列出和搜索日历和事件、创建、更新、移动、RSVP和删除事件、空闲/忙碌查询、忙碌分析、定期事件预测,以及寻找共同的时段并预订。此外,它还配备了一个安排大脑,了解你的工作时间:寻找并预订专注时间,同时检测多个账户的重复预订,建议更合适的会议时间,并审计你一周的实际情况。认证采用Google OAuth 2.0(桌面应用流程);令牌在本地、每个账户缓存,并自动刷新。 假设周四工作时间为09:00–17:00 UTC,11:00–12:00有一次会议,无午餐或缓冲时间,且有60分钟的最低专注时间。 “寻找2026年1月1日的六小时专注时间。
概述(AI 翻译)
一个MCP服务器,允许LLM客户端读写你的Google日历。它作为单一进程运行——默认是stdio,可选地可流式HTTP——并展示了23个具有结构化输出的工具:列出和搜索日历和事件、创建、更新、移动、RSVP和删除事件、空闲/忙碌查询、忙碌分析、定期事件预测,以及寻找共同的时段并预订。此外,它还配备了一个安排大脑,了解你的工作时间:寻找并预订专注时间,同时检测多个账户的重复预订,建议更合适的会议时间,并审计你一周的实际情况。认证采用Google OAuth 2.0(桌面应用流程);令牌在本地、每个账户缓存,并自动刷新。
一个日历任务,端到端
综合示例,辅以离线测试;没有真实的日历数据或实时预订。 假设周四工作时间为09:00–17:00 UTC,11:00–12:00有一次会议, 没有午餐或缓冲时间,且有60分钟的最低专注时间。
“2026年1月1日找到六小时的专注时间。先给我看积木。”
MCP客户端可以调用:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
calendar-mcp
An MCP server that gives an LLM client read and write access to your Google Calendar. It runs as a single process — stdio by default, streamable HTTP optionally — and exposes 23 tools with structured output: listing and searching calendars and events, creating, updating, moving, RSVPing to and deleting events, free/busy queries, busyness analysis, recurring-event projection, and finding a mutual slot and booking it. On top of that it has a scheduling brain that knows your working hours: finding and booking focus time, detecting double-bookings across several accounts at once, proposing better times for a meeting, and auditing where your week actually went. Authentication is Google OAuth 2.0 (Desktop app flow); tokens are cached locally, per account, and refreshed automatically.
A calendar task, end to end
Synthetic example, backed by offline tests; no real calendar data or live booking. Assume Thursday working hours of 09:00–17:00 UTC, one meeting at 11:00–12:00, no lunch or buffer, and a 60-minute minimum focus block.
“Find six hours of focus time on January 1, 2026. Show me the blocks first.”
An MCP client can call:
{
"tool": "block_focus_time",
"arguments": {
"time_min": "2026-01-01T00:00:00Z",
"time_max": "2026-01-02T00:00:00Z",
"hours_needed": 6,
"dry_run": true
}
}
The preview selects 09:00–10:00 and 12:00–17:00: six hours, with the last
selected block trimmed to the remaining hour. Both events have created: false.
After the user approves the times, the client can call with dry_run: false;
availability is read again before creating events. A preview does not reserve a slot.
Design decision: unknown availability is not free time. If a checked calendar
returns an access error, disappears from the response, or has unreadable busy
intervals, focus search and booking return an error before writing anything.
The same check protects mutual scheduling and reschedule suggestions/application.
For example, a notFound response for [email protected] becomes:
Availability is unknown: [email protected]: notFound. No scheduling changes were made.
Restore calendar access or retry the query.
Reproduce the preview and the safety regression without Google credentials (after the development install):
pytest -q tests/test_scheduling.py -k 'focus_time_dry_run or focus_refuses_unknown'
The regression verifies that partial, missing and errored availability never
calls create_event, in both preview and booking modes. Successful empty busy
lists still mean genuinely free time. Availability checks and writes are separate
Google API calls, so another client can still book a competing event between them.
Quick start
安装
uvx calendar-mcp-server配置
{
"mcpServers": {
"calendar": {
"command": "uvx",
"args": ["calendar-mcp-server"],
"env": {
"GOOGLE_CLIENT_ID": "...",
"GOOGLE_CLIENT_SECRET": "...",
"TOKEN_FILE_PATH": "/absolute/path/to/.gcp-saved-tokens.json"
}
}
}
}