这是一个模型上下文协议(MCP)服务器,允许 Claude 和其他 MCP 客户端与 Google 日历进行交互。此服务器使AI助手能够管理您的日历事件、检查可用性并处理调度任务。
列出事件 (get-events)
列出日历 (list-calendars)
获取时区信息 (get-timezone-info)
获取当前日期 (get-current-date)
创建事件 (create-event)
更新事件 (update-event)
删除事件 (delete-event)
check-availability)
credentials.json 在 \mcp_server_google_calendar 文件夹中# 克隆或下载项目
cd mcp-google-calendar
# 安装包
pip install -e .
首次运行时,服务器会自动打开浏览器进行OAuth认证。您的凭据将被保存以供将来使用。
此服务器可以两种模式运行:
配置Claude Desktop:
在您的Claude Desktop配置文件中添加以下内容:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"google_calendar": {
"command": "mcp-server-google-calendar"
}
}
}
或者使用Python模块:
{
"mcpServers": {
"google_calendar": {
"command": "python",
"args": ["-m", "mcp_server_google_calendar"]
}
}
}
配置更改后重启Claude Desktop。
使用SSE传输运行服务器:
# 使用已安装的命令
mcp-server-google-calendar-sse
# 或使用Python模块
python -m mcp_server_google_calendar.server_sse
# 使用自定义主机/端口
python -m mcp_server_google_calendar.server_sse --host 0.0.0.0 --port 8001
SSE服务器将在以下位置可用:
http://localhost:8000http://localhost:8000/sse这里有一些您可以向Claude询问的内容:
服务器在创建或更新事件时会自动检查时间冲突,并会在发现重叠事件时警告您。
完全支持使用iCalendar RRULE格式的定期事件:
credentials.json 在项目根目录中token.jsonmcp-google-calendar/
├── mcp_server_google_calendar/
│ ├── __init__.py
│ ├── __main__.py # STDIO模式入口点
│ ├── __main_sse__.py # SSE模式入口点
│ ├── credentials.json # Google OAuth凭据(您提供)
│ ├── server.py # STDIO服务器实现
│ ├── server_sse.py # SSE服务器实现
│ ├── schemas.py # Pydantic模式
│ ├── auth/ # 认证模块
│ ├── tools/ # 工具定义
│ └── utils/ # 实用函数
├── token.json # 保存的认证令牌(自动生成)
├── pyproject.toml # 项目配置
└── README.md
MIT许可证