一个与Google日历集成的模型上下文协议(MCP)服务器,使用TypeScript构建。
npm install -g mcp-google-calendar
或者直接运行:
npx -y mcp-google-calendar
credentials.json在项目根目录中创建一个.env文件:
# 服务器配置
PORT=3420
# Google Calendar API配置
CREDENTIALS_PATH=./credentials.json
使用标准WebSocket启动:
npx -y mcp-google-calendar
使用Server-Sent Events (SSE)启动:
npx -y mcp-google-calendar --sse
在claude_desktop_config.json中添加以下内容:
{
"mcpServers": {
"mcp-google-calendar": {
"command": "npx",
"args": ["-y", "mcp-google-calendar"],
"env": {
"CREDENTIALS_PATH": "/path/to/your/credentials.json"
}
}
}
}
首次运行服务器时:
token.json后续启动时:
| 工具 | 描述 |
|---|---|
list_calendars | 获取所有可用的日历 |
list_calendar_events | 在指定日期之间检索事件 |
create_calendar_event | 向日历添加新的事件 |
get_calendar_event | 获取特定事件的详细信息 |
edit_calendar_event | 修改现有的日历事件 |
delete_calendar_event | 从日历中删除事件 |
克隆并设置项目:
git clone https://github.com/am2rican5/mcp-google-calendar.git
cd mcp-google-calendar
npm install
构建项目:
npm run build
在开发模式下运行:
npm start
⚠️ 重要安全警告 ⚠️
credentials.json和token.json包含敏感的认证信息本项目根据MIT许可证授权 - 详情见LICENSE文件。
欢迎贡献!请随意提交Pull Request。
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)