Google日历事件创建服务

一个用于创建和管理Google日历事件的MCP服务器,支持事件创建、认证和配置。

  • by nkriman
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 nkriman/mcp-google-calendar-server

使用说明

MCP谷歌日历服务器

用于创建Google日历事件的模型上下文协议(MCP)服务器。

设置

  1. 安装依赖项:

    npm install
    
  2. 获取Google日历API凭据:

    • 首选 谷歌云控制台
    • 创建新项目或选择现有项目
    • 启用Google日历API
    • 创建凭据(OAuth 2.0客户端ID)
    • 下载凭据并另存为 credentials.json 在项目根中
  3. 身份验证:

    • 运行服务器并使用 authenticate_google_calendar 获取身份验证URL的工具
    • 访问URL,授予权限,并获取授权码
    • 创建一个 token.json 将您的凭据归档
  4. 配置克劳德代码: 添加到MCP设置中:

    {
      "mcpServers": {
        "google-calendar": {
          "command": "node",
          "args": ["/Users/krilet/mcp-google-calendar-server/src/index.js"]
        }
      }
    }
    

用法

服务器提供两个工具:

authenticate_google_calendar

为Google日历访问生成身份验证URL。

create_calendar_event

在Google日历中创建新事件。

参数:

  • summary (必填):活动标题
  • startDateTime (必填):ISO格式的开始时间
  • endDateTime (必填):ISO格式的结束时间
  • description (可选):事件描述
  • location (可选):活动地点
  • timeZone (可选):时区(默认为UTC)
  • attendees (可选):电子邮件地址数组

例子:

{
  "summary": "Team Meeting",
  "startDateTime": "2024-12-25T10:00:00-08:00",
  "endDateTime": "2024-12-25T11:00:00-08:00",
  "description": "Weekly team sync",
  "location": "Conference Room A",
  "attendees": ["colleague@example.com"]
}