GoogleCalendarMCP
用于与 Google 日历交互的模型完成提示 (MCP)插件。
特征
安装
- 克隆此存储库:
git clone https://github.com/ITworkonline/GoogleCalendarMCP.git
cd GoogleCalendarMCP
- 创建虚拟环境并安装依赖项:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
- 设置 Google 日历 API:
- 前往Google Cloud Console
- 创建新项目
- 启用 Google 日历 API
- 创建 OAuth 2.0 凭据(桌面应用程序)
- 下载凭证 JSON 文件并将其保存为项目根目录中的
credentials.json
用法
from GoogleCalendarMCP.main import create_event
# Create a calendar event
result = await create_event(
summary="Meeting with Team",
start_time="2025-04-01T10:00:00",
end_time="2025-04-01T11:00:00",
description="Discuss project progress",
location="Conference Room 3",
attendees=["colleague@example.com"],
timezone="America/New_York"
)
验证
首次运行该程序时,它会打开一个浏览器窗口,供您使用 Google 帐户进行身份验证。身份验证完成后,将创建一个token.json
文件来存储您的凭据,以供后续运行使用。
执照
麻省理工学院