Skip to main content
Glama
thisnick

Google Calendar MCP Server

by thisnick

Google 日历 MCP 服务器

使用模型上下文协议 (MCP) 通过 Claude Desktop 与您的 Google 日历进行交互。

这是一个基于 TypeScript 的 MCP 服务器,实现了 Google 日历集成。它演示了 MCP 的核心概念,同时提供:

  • 通过 MCP URI 管理日历事件

  • 用于创建和修改事件的工具

  • 生成日历洞察的提示

特征

资源

  • 通过 MCP URI 访问日历事件

  • 每个活动都有标题、时间、描述和参加者

  • 具有适当 MIME 类型的结构化事件数据

工具

  • create_event - 创建新的日历事件

    • 以标题、时间和其他事件详细信息作为参数

    • 直接与 Google 日历 API 接口

  • list_events - 查看即将发生的日历事件

  • [添加您已实现的其他工具]

提示

  • analyze_schedule - 生成有关日历的见解

    • 包括即将举行的活动作为嵌入式资源

    • 返回 LLM 分析的结构化提示

  • [添加您已实施的其他提示]

Related MCP server: Calendar Tools MCP Server

先决条件

  • Node.js(v14 或更高版本)

  • 启用了日历 API 的 Google Cloud 项目

  • OAuth 2.0 客户端凭据

发展

按照devbox.sh上的说明安装 devbox

curl -fsSL https://get.jetpack.io/devbox | bash

在项目目录中初始化devbox:

devbox init

启动 devbox shell:

devbox shell

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

安装

要与 Claude Desktop 一起使用,请添加服务器配置:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "Google Calendar": {
      "command": "/path/to/Google Calendar/build/index.js"
    }
  }
}

首次设置

  1. 设置 Google Cloud 凭据:

    • 前往Google Cloud Console

    • 创建新项目或选择现有项目

    • 启用 Google 日历 API

    • 创建 OAuth 2.0 凭据(桌面应用程序类型)

    • 下载客户端机密 JSON 文件

    • 将其重命名为.client_secret.json并将其放在项目根目录中

  2. 初始身份验证:

    • 首次运行服务器时,它将提供一个身份验证 URL

    • 在浏览器中访问 URL

    • 授予请求的权限

    • 复制提供的授权码

    • 将代码粘贴回 CLI 提示符

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

-
security - not tested
F
license - not found
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thisnick/google-calendar-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server