项目简介

该项目 'eliasuran_mcp_server_google_calendar' 是一个基于 Model Context Protocol (MCP) 构建的服务器,旨在作为 LLM (如 Claude) 的后端,提供访问和操作 Google 日历的功能。通过此服务器,LLM 可以理解用户的日历相关指令,并调用相应的工具来执行,例如创建新的日历事件、查询现有事件或检查用户日程的空闲时段。

主要功能点

  • 事件管理: 支持创建新的Google日历事件,包括设置事件标题、描述、时间、地点、参与者等详细信息。
  • 日程查询: 允许LLM查询用户日历中的事件列表,可以指定时间范围和最大返回结果数。
  • 空闲时间检查: 提供检查用户和/或组织内其他成员在指定时间段内的空闲状态的功能,方便LLM安排会议或活动。
  • 日历列表: 支持列出用户的所有日历。

安装步骤

  1. 安装 Node.js: 确保你的系统已安装 Node.js v18.0.0 或更高版本。你可以从 nodejs.org 下载并安装。

  2. 运行初始化命令: 打开终端,执行以下命令以初始化 MCP 服务器配置。

    npx mcp-server-google-calendar@latest init

    这个命令会自动配置 Claude Desktop 以识别和使用此 MCP 服务器。

  3. 重启 Claude Desktop: 初始化完成后,重启你的 Claude Desktop 应用程序,使配置生效。

服务器配置

要让 MCP 客户端(例如 Claude Desktop)连接到此服务器,需要配置服务器信息。'init' 命令已经自动完成了配置 Claude Desktop 的步骤。

以下是 'init' 命令添加到 Claude 配置文件 ('claude_desktop_config.json') 中的服务器配置信息示例:

{
  "mcpServers": {
    "google_calendar": {
      "command": "npx",
      "args": ["-y", "mcp_server_google_calendar", "run"]
    }
  }
}

配置参数说明:

  • 'server name': 'google_calendar' - 服务器的名称,用于在 MCP 客户端中标识。
  • 'command': 'npx' - 用于启动服务器的命令,这里使用 'npx' 来运行本地安装的 npm 包。
  • 'args': '["-y", "mcp_server_google_calendar", "run"]' - 传递给 'command' 的参数列表。
    • '-y': 'npx' 的参数,表示自动确认执行。
    • 'mcp_server_google_calendar': package.json 中定义的 name,会被 'npx' 解析为当前项目。
    • 'run': 服务器的运行命令,对应 'index.ts' 中的服务器启动逻辑。

注意: 用户 不需要 手动配置 'claude_desktop_config.json' 文件,'npx mcp-server-google-calendar@latest init' 命令会自动完成配置。 这里提供配置信息是为了帮助用户理解 MCP 客户端是如何与 MCP 服务器建立连接的。

基本使用方法

安装并配置完成后,你就可以在 Claude Desktop 中使用自然语言指令来操作 Google 日历了。

示例指令:

  • 'Give me a list of all my events this week' (列出本周所有事件)
  • 'Create an event called "Chill" whenever I have time on Monday after 8pm.' (在周一晚上8点后有空时创建一个名为 "Chill" 的事件)
  • 'Check whenever both me and Arian are free this week between 9am and 5pm and schedule a meeting called "Going over MCP"' (检查本周上午9点到下午5点之间我和 Arian 是否都有空,并安排一个名为 "Going over MCP" 的会议)

通过这些指令,Claude 可以调用 Google Calendar MCP 服务器提供的工具,并根据你的指示与你的日历进行交互。

信息

分类

生产力应用