calendar-mcp 标志

calendar-mcp

社区
deciduus

Google Calendar MCP server: 15 tools for LLM agents. Install with uvx calendar-mcp-server.

发布者deciduus
代码仓库calendar-mcp
语言Python
复刻数
19
星标数
26
可用工具
0
传输类型stdio, streamable-http
分类
链接
  • 将工具接入 AI 工作流

    calendar-mcp 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 26 个星标和 19 个复刻。

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.

Quick start

1. Create Google OAuth credentials. In the Google Cloud console, enable the Google Calendar API, then create an OAuth client ID of type Desktop app. Copy the client ID and secret. (Details in Google Cloud setup.)

2. Set them in your environment, or in a .env file in the directory you run from (see example.env):

dotenv
GOOGLE_CLIENT_ID='...'
GOOGLE_CLIENT_SECRET='...'

3. Sign in once, then add the server to your client:

bash
uvx calendar-mcp-server auth

This opens a browser and saves a token in the config directory (see Accounts); if you already have a .gcp-saved-tokens.json or set TOKEN_FILE_PATH, that file is used instead. Verify it with calendar-mcp check. Add more Google accounts with calendar-mcp auth --account work. After that the server runs non-interactively — it never opens a browser on its own unless you set CALENDAR_MCP_ALLOW_BROWSER_AUTH=1.

The PyPI distribution is calendar-mcp-server. It installs two identical console scripts, calendar-mcp and calendar-mcp-server, so uvx calendar-mcp-server and a local calendar-mcp are the same command.

Client configuration

Claude Code

bash
claude mcp add calendar \
  --env GOOGLE_CLIENT_ID=... \
  --env GOOGLE_CLIENT_SECRET=... \
  -- uvx calendar-mcp-server

Claude Desktop — claude_desktop_config.json:

json
{
  "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"
      }
    }
  }
}

Cursor — .cursor/mcp.json (project) or ~/.cursor/mcp.json (global): same mcpServers block as above.

Any other client that speaks the standard mcpServers JSON takes the same entry. TOKEN_FILE_PATH is optional now that tokens default to the OS config directory, which does not depend on the working directory the client picks — but if you do set it, make it an absolute path.

Remote / HTTP mode

bash
calendar-mcp --transport http --host 127.0.0.1 --port 8000

The MCP endpoint is then http://127.0.0.1:8000/mcp (change the path with --path).

There is no authentication layer on the HTTP transport yet. Anyone who can reach the endpoint gets full access to the calendar the saved token belongs to. Bind it to loopback, or expose it only behind a trusted reverse proxy that authenticates, or on a private network such as a tailnet. Do not put it on a public interface.

Tools

Read-only tools never change anything. "Writes" tools create or modify events; delete_event is the only one that destroys data.

Calendars and events

ToolDescription
list_calendarsreadList the calendars the user can see, with IDs and timezones.
find_eventsreadSearch a calendar for events, expanding recurring series into instances.
check_attendee_statusreadReport who accepted, declined or has not answered an invitation.
query_free_busyreadBusy intervals for one or more calendars, without event details.
analyze_busynessreadPer-day event count and total scheduled minutes over a range.
project_recurring_eventsreadCompute future occurrences from recurrence rules.
create_calendarwritesCreate a new secondary calendar.
create_eventwritesCreate an event with explicit start/end times and optional attendees.
quick_add_eventwritesCreate an event from a plain-English phrase, parsed by Google.
update_eventwritesChange fields on an event; omitted fields are left untouched.
move_eventwritesReschedule an event, and/or move it to another calendar.
add_attendeewritesInvite one or more people to an existing event.
respond_to_eventwritesSet your own RSVP (accepted/declined/tentative/needsAction).
schedule_mutualwritesFind the first slot where everyone is free, then book it.
delete_eventdestroysPermanently delete an event. Asks the client to confirm via elicitation when supported.

Scheduling brain — these read your saved preferences (working hours, lunch, buffer, minimum focus block).

ToolDescription
find_focus_timereadUninterrupted blocks in a window that could be used for deep work, longest first.
detect_conflictsreadDouble-bookings and too-tight transitions, across every signed-in account at once.
time_auditreadWhere the time went: meeting hours, by size, domain, recurrence and person.
suggest_reschedulewrites (opt-in)Ranked better times for an existing meeting. Suggests only, unless apply: true.
block_focus_timewritesBook the best free blocks as focus time. dry_run: true to preview.

Local configuration — no Google call, no account argument.

ToolDescription
list_accountsreadThe accounts you have signed in, and which is the default.
get_preferencesreadWorking hours, lunch, buffer, minimum focus block, focus calendar.
set_preferenceswritesUpdate and save those preferences. Local file only.

Every calendar tool takes an optional trailing account argument (detect_conflicts takes accounts, a list, because checking several at once is the point). All times are ISO 8601 strings — a naive timestamp is interpreted in the target calendar's own timezone.

Scheduling brain

The five scheduling tools share one idea: your calendar is not the same as your availability. They start from your working hours, subtract lunch, subtract what is already booked, and subtract the buffer you want around meetings — then reason about what is left.

Prompts that exercise them:

  • "Find me six hours of focus time next week and block it out — show me the times first."
  • "Is anything double-booked between my work and personal calendars this week?"
  • "My Thursday is back-to-back. Suggest better times for the design review."
  • "Where did my time go last month? Who am I spending it with?"
  • "I need a 90-minute deep work block before Friday. Is there one?"

find_focus_time reports what exists; block_focus_time defends it by creating events (busy, reminders off, nobody notified), trimming the last block so it books exactly the hours you asked for rather than a whole afternoon. detect_conflicts separates genuine overlaps from tight transitions that merely break your buffer, and ignores events you declined, events marked free, and (by default) all-day entries. suggest_reschedule keeps the meeting's duration, ranks candidate slots by fewest attendee conflicts and prefers the event's current day, and moves nothing unless you pass apply: true.

Time audit

time_audit answers "how much of my week is meetings?" in one pass, grouped by day or week:

2026-08-01 .. 2026-09-01, Europe/Berlin, grouped by week
  Meetings:         41.5 h across 63 meetings
  Working hours:    152.0 h available (lunch removed)
  In working hours: 38.0 h -> 25% of the week
  Busiest week:     2026-W34, 14.0 h
  Heaviest day:     2026-08-20, 6.5 h
  By size:          1:1 18.0 h | small 15.5 h | large 8.0 h
  By recurrence:    recurring 26.0 h | one-off 15.5 h
  Top people:       a.schmidt@example.com 9.0 h | j.lee@example.com 7.5 h

Declined meetings, events marked free and all-day entries are left out by default; include_declined and include_all_day bring them back.

Safety

  • delete_event is the only destructive tool. It asks the client to confirm through MCP elicitation when the client supports it, and proceeds normally when it does not.
  • block_focus_time takes dry_run. Run it with dry_run: true to see the exact blocks it would book before anything is written.
  • suggest_reschedule does not move anything by default. apply is false and has to be set explicitly, once the user has agreed to a time.
  • Everything else that writes is additive — creating or editing an event — and update_event leaves fields you omit untouched.
  • list_accounts, get_preferences and set_preferences never touch Google. They read and write local files in the config directory.

Accounts

You can sign in more than one Google account and pick between them per call.

bash
calendar-mcp auth                    # the default account
calendar-mcp auth --account work     # a second, named account
calendar-mcp accounts                # list them, with token paths and sign-in state

Every calendar tool takes an optional account argument naming one of these ("what's on my work calendar tomorrow?"). Omit it and the server uses the default: CALENDAR_MCP_DEFAULT_ACCOUNT if set, otherwise the account named default, otherwise the only account you have signed in. list_accounts returns the same list the CLI prints, so the model can discover the names itself.

Account names must match [A-Za-z0-9][A-Za-z0-9_-]{0,63}.

Where things live. Tokens and preferences are stored in the OS user config directory — %LOCALAPPDATA%\calendar-mcp on Windows, ~/.config/calendar-mcp on Linux, ~/Library/Application Support/calendar-mcp on macOS — with one token file per account under accounts/. Override the whole directory with CALENDAR_MCP_CONFIG_DIR.

Back-compat. TOKEN_FILE_PATH still works and now means the default account's token. If it is set, or if a .gcp-saved-tokens.json exists in the working directory, that file is used for the default account and nothing moves. Named accounts always live in the config directory.

Preferences

The server remembers how you like your week to be shaped, so the scheduling tools do not have to guess. Read them with get_preferences and change them with set_preferences ("I start at 8 and I want 15 minutes between meetings"). Preferences are global — they describe you, not one account — and are stored as preferences.json in the config directory.

FieldDefaultMeaning
timezoneunsetIANA zone the working hours are expressed in, e.g. Europe/Berlin.
working_hoursMon–Fri 09:00–17:00Per weekday (mon…sun), a list of ["HH:MM", "HH:MM"] spans.
buffer_minutes0Gap to leave either side of a meeting when proposing times.
min_focus_block_minutes60Shortest free stretch that still counts as usable focus time.
lunchunsetA daily break carved out of the working hours.
focus_calendar_idprimaryCalendar that focus blocks are booked on.
json
{
  "timezone": "Europe/Berlin",
  "working_hours": {
    "mon": [["09:00", "12:00"], ["13:00", "18:00"]],
    "tue": [["09:00", "17:00"]],
    "wed": [["09:00", "17:00"]],
    "thu": [["09:00", "17:00"]],
    "fri": [["09:00", "15:00"]],
    "sat": [],
    "sun": []
  },
  "buffer_minutes": 15,
  "min_focus_block_minutes": 90,
  "lunch": ["12:30", "13:15"],
  "focus_calendar_id": "primary"
}

set_preferences merges: only the arguments you pass change, and the merged result is validated before it is written, so a rejected change leaves the saved file untouched. The one exception is working_hours, which is a whole-schedule replacement — weekdays you leave out of the dict become non-working days. Pass clear_lunch: true to remove a lunch break.

Configuration

VariableDefaultPurpose
GOOGLE_CLIENT_ID—OAuth client ID (required).
GOOGLE_CLIENT_SECRET—OAuth client secret (required).
TOKEN_FILE_PATH.gcp-saved-tokens.jsonWhere the default account's OAuth token is cached.
CALENDAR_MCP_CONFIG_DIROS user config dirDirectory holding per-account tokens (accounts/) and preferences.json.
CALENDAR_MCP_DEFAULT_ACCOUNTdefaultAccount used when a tool's account argument is omitted.
CALENDAR_SCOPEShttps://www.googleapis.com/auth/calendarScope requested. Use .../auth/calendar.readonly for read-only.
OAUTH_CALLBACK_PORT8080Local port for the OAuth callback during calendar-mcp auth.
CALENDAR_MCP_ALLOW_BROWSER_AUTHunsetSet to 1 to let the server itself open a browser when no token exists. Off by default so a stdio server never hangs.
CALENDAR_MCP_LOG_FILEunsetMirror the stderr log to this file.
CALENDAR_MCP_LOG_LEVELINFODEBUG/INFO/WARNING/ERROR/CRITICAL. Overrides --log-level.
HOST127.0.0.1Default for --host in HTTP mode.
PORT8000Default for --port in HTTP mode.

A .env file in the working directory is loaded on startup. Logs never go to stdout — stdout is the MCP protocol channel in stdio mode.

Commands

calendar-mcp [--transport {stdio,http}] [--host H] [--port P] [--path /mcp] [--log-level L]
calendar-mcp serve ...     # explicit form of the default
calendar-mcp auth [--account NAME] [--no-browser]
calendar-mcp accounts      # list known accounts; exit 1 if none is signed in
calendar-mcp check [--account NAME]   # token status + calendar list; exit 1 if no valid token
calendar-mcp --version

python -m calendar_mcp accepts the same arguments.

Google Cloud setup

  1. Create or select a project and enable the Google Calendar API.
  2. APIs & Services → Credentials → Create credentials → OAuth client ID → Application type: Desktop app. Copy the client ID and secret. There is no JSON download to keep.
  3. A Desktop app client has no "Authorized redirect URIs" field — Google permits http://localhost on any port for this client type, which is what the local callback on OAUTH_CALLBACK_PORT uses. Nothing to configure there.
  4. On the OAuth consent screen: User Type External, fill in the app name and contact emails, add the https://www.googleapis.com/auth/calendar scope, and add your own Google account as a test user. Without that last step the sign-in is rejected.

Development

bash
git clone https://github.com/deciduus/calendar-mcp
cd calendar-mcp
uv venv
uv pip install -e ".[dev]"
pytest

Layout: calendar_mcp/server.py (the MCPServer, shared helpers and the credential provider), tools/ (one module per tool area — the tool functions themselves), calendar_actions.py (Google API calls), analysis.py, timeutil.py (pure interval maths), accounts.py (multi-account token paths), preferences.py (the saved schedule), models.py (pydantic input/output models), auth.py (OAuth), cli.py (the calendar-mcp command). scripts/smoke_stdio.py spawns a real stdio server and checks the handshake and tool list.

Upgrading from 1.0

Nothing breaks. All 15 original tools keep their names and their existing parameters; each simply gained an optional trailing account. Your existing TOKEN_FILE_PATH keeps working, and now names the default account's token. What is new: multiple accounts, saved scheduling preferences, and eight new tools (find_focus_time, block_focus_time, detect_conflicts, suggest_reschedule, time_audit, list_accounts, get_preferences, set_preferences).

Upgrading from 0.x

  • Package and command renamed. The distribution is now calendar-mcp-server and installs calendar-mcp (and an identical calendar-mcp-server alias). Point your client at uvx calendar-mcp-server instead of python /path/to/run_server.py.
  • run_server.py still works — it is now a thin shim over the CLI — but it is deprecated and will be removed in a future release.
  • The FastAPI/uvicorn HTTP API is gone. There are no REST endpoints, no /health, and no separate stdio bridge process; the server is one process on the MCP SDK. If you want HTTP, it is now MCP streamable HTTP at /mcp.
  • Authentication no longer happens implicitly. Run calendar-mcp auth once; the server will not open a browser unless CALENDAR_MCP_ALLOW_BROWSER_AUTH=1.
  • Tool names are unchanged, so existing prompts keep working. Results are now structured output rather than JSON stuffed into text.
  • Three new tools: move_event, respond_to_event, and project_recurring_events (the last previously existed only as internal logic).
  • Removed env vars: RELOAD, MCP_API_HOST. HOST/PORT now apply to the MCP HTTP transport.

License

This project is dual-licensed to support both open-source collaboration and sustainable development:

  1. GNU Affero General Public License v3.0 (AGPL-3.0):

    • This software is free to use, modify, and distribute under the terms of the AGPLv3 license.
    • Key conditions include that derivative works (including modifications used over a network) must also be licensed under AGPLv3 and their source code made available.
    • This license is suitable for open-source projects or internal use where AGPLv3 compliance is feasible.
    • See the LICENSE file for the full text.
  2. Commercial License:

    • If the terms of the AGPLv3 are not suitable for your specific use case (e.g., integrating this software into a proprietary, closed-source commercial product or service without complying with AGPLv3's source-sharing requirements), a separate commercial license is available.
    • Please contact deciduusleaf@gmail.com for inquiries regarding commercial licensing options.

By using, modifying, or distributing this software, you agree to be bound by the terms of either the AGPLv3 or a separately negotiated commercial license.

mcp-name: io.github.deciduus/calendar-mcp

安装

TypingMind
{
  "mcpServers": {
    "calendar-mcp": {
      "command": "uvx",
      "args": [
        "calendar-mcp-server"
      ],
      "env": {
        "GOOGLE_CLIENT_ID": "<GOOGLE_CLIENT_ID>",
        "GOOGLE_CLIENT_SECRET": "<GOOGLE_CLIENT_SECRET>",
        "TOKEN_FILE_PATH": "<TOKEN_FILE_PATH>"
      }
    }
  }
}

将 calendar-mcp MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 calendar-mcp 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 您可以在自己的设备上本地运行 MCP,也可以通过 URL 连接远程 MCP 服务器。

方式 1:使用本地连接器

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 calendar-mcp 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 calendar-mcp MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "calendar-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 calendar-mcp MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 calendar-mcp MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 calendar-mcp 帮我完成这项任务吗?
calendar-mcp
当然,我看过了。
以下是我使用 calendar-mcp 得到的结果。

方式 2:添加 MCP 服务器 URL

如果 calendar-mcp 已托管在远程服务器上,或您的团队希望让多个用户共用一个连接器,请选择此方式。

1

打开 MCP 连接器

在 TypingMind 中,前往“插件”,打开“MCP 连接器”,然后选择“添加 URL”。

  1. 在您的浏览器中打开 TypingMind。
  2. 进入“插件”。
  3. 打开“MCP 连接器”。
  4. 点击“添加 URL”。
TypingMind 的“添加自定义 MCP 服务器 URL”表单
2

粘贴服务器 URL

在“服务器 URL”字段中输入 提供商提供的 MCP 服务器 URL。根据服务器要求,添加连接名称、描述、图标、自定义 HTTP 请求头或 OAuth 客户端设置。

  1. 将 提供商提供的 MCP 服务器 URL 粘贴到“服务器 URL”字段中。
  2. 为 calendar-mcp 输入连接名称。
  3. 您可以添加描述和图标,以便更容易识别此连接。
  4. 如果服务器需要身份验证,请添加自定义 HTTP 请求头或 OAuth 客户端信息。
3

创建连接

点击“创建连接”,然后返回插件列表,确认新的 MCP 连接处于可用状态。

  1. 点击“创建连接”。
  2. 返回 MCP 连接器列表。
  3. 确认列表中的 calendar-mcp 连接显示为可用状态。
  4. 如果连接未立即出现,请刷新插件列表。
4

切换模型,无需重新连接

使用您偏好的模型开始聊天,在“插件”中启用 calendar-mcp 工具,并根据需要随时切换到其他模型。该 MCP 连接在 TypingMind 工作区中仍然可用。

  1. 在 TypingMind 中开始新聊天。
  2. 选择您想使用的 AI 模型。
  3. 在“插件”中启用 calendar-mcp 工具。
  4. 需要时,请让模型使用该工具。
  5. 切换到其他 AI 模型,继续使用同一个 MCP 连接。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 calendar-mcp 帮我完成这项任务吗?
calendar-mcp
当然,我看过了。
以下是我使用 calendar-mcp 得到的结果。

常见问题

calendar-mcp MCP 服务器有什么用途?

calendar-mcp 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 calendar-mcp MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 calendar-mcp。

为什么在 TypingMind 中使用 calendar-mcp MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 calendar-mcp 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 calendar-mcp MCP 连接到 TypingMind?

在 TypingMind 中,您可以使用本地 MCP 连接器或添加远程 MCP 服务器的 URL 来连接 calendar-mcp。当服务器需要访问您设备上的文件、应用或私有资源时,请使用本地连接器;如果 MCP 服务器部署在远端,请使用服务器 URL。

calendar-mcp MCP 在 TypingMind 中提供哪些工具?

calendar-mcp 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 calendar-mcp MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 calendar-mcp 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇