A

Avik-creator

@Avik-creator/googlecalendarMCP
0 Stars 359 次浏览 Avik-creator 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "google_calendar_mcp": {
      "args": [
        "mcp-remote",
        "https://mcp-google-calendar.avikm744.workers.dev/sse"
      ],
      "command": "npx"
    }
  }
}

服务介绍

Google 日历集成项目

smithery 徽章

该项目提供了与 Google 日历 API 的集成,以便通过编程方式管理和交互日历事件。

前提条件

  • Python 3.8 或更高版本
  • Google Cloud Platform 账户
  • 启用 Google 日历 API
  • 配置 OAuth 2.0 凭证

设置说明

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 Google 日历集成项目:

bash
npx -y smithery install @Avik-creator/googlecalendarMCP --client claude

手动安装

  1. 克隆仓库
    bash
    git clone https://github.com/Avik-creator/googlecalendarMCP
    cd googlecalendarMCP

  2. 设置虚拟环境
    bash
    python -m venv venv
    source venv/bin/activate # 在 Windows 上使用 venvScriptsactivate

  3. 安装依赖项
    bash
    pip install -r requirements.txt

  4. Google Cloud Platform 设置

    a. 访问 Google Cloud 控制台
    b. 创建新项目或选择现有项目
    c. 启用 Google 日历 API
    d. 创建 OAuth 2.0 凭证:

    • 转到 APIs & Services > Credentials
    • 点击 "Create Credentials" > "OAuth client ID"
    • 选择 "Desktop Application"
    • 下载凭证 JSON 文件
    • 将其重命名为 credentials.json 并放置在项目根目录中
  5. 环境变量

    在项目根目录中创建一个 .env 文件,并包含以下变量:

    GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
    CALENDAR_ID=your_calendar_id@group.calendar.google.com

使用方法

  1. 首次认证
    bash
    python auth.py

    这将打开一个浏览器窗口进行 OAuth 认证。按照提示授权应用程序。

  2. 运行应用程序
    bash
    python main.py

功能

  • 创建、读取、更新和删除日历事件
  • 设置重复事件
  • 管理事件参与者
  • 处理事件通知和提醒

项目结构

googlecalendarMCP/
├── auth.py # 认证处理
├── main.py # 主应用程序入口点
├── requirements.txt # 项目依赖项
├── .env # 环境变量
├── credentials.json # Google OAuth 凭证
└── token.json # 生成的 OAuth 令牌

依赖项

该项目使用的主要依赖项包括:

  • google-auth-oauthlib
  • google-auth-httplib2
  • google-api-python-client
  • python-dotenv

部署配置

json
{
"mcpServers": {
"google_calendar_mcp": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp-google-calendar.avikm744.workers.dev/sse"
]
}
}
}

安全注意事项

  • 永远不要将 credentials.jsontoken.json.env 文件提交到版本控制系统
  • 保护好您的 OAuth 凭证
  • 定期轮换您的凭证和令牌

贡献

  1. 叉分仓库
  2. 创建功能分支
  3. 提交更改
  4. 推送到分支
  5. 创建拉取请求

许可证

本项目根据 MIT 许可证发布 - 详情请参阅 LICENSE 文件。

相关 MCP 服务