用于在Claude Desktop中集成Google日历并支持自动认证的Model Context Protocol (MCP)服务器。此服务器使AI助手能够通过自然语言交互管理Google日历事件。
要通过Smithery自动安装Claude Desktop的Calendar AutoAuth Server:
npx -y @smithery/cli install @gongrzhe/server-calendar-autoauth-mcp --client claude
创建一个Google云项目并获取凭证:
a. 创建一个Google云项目:
b. 创建OAuth 2.0凭证:
http://localhost:3000/oauth2callback到授权重定向URIgcp-oauth.keys.json运行认证:
您可以通过两种方式认证:
a. 全局认证(推荐):
# 第一次:将gcp-oauth.keys.json放置在您的家目录下的.calendar-mcp文件夹中
mkdir -p ~/.calendar-mcp
mv gcp-oauth.keys.json ~/.calendar-mcp/
# 从任何地方运行认证
npx @gongrzhe/server-calendar-autoauth-mcp auth
b. 局部认证:
# 将gcp-oauth.keys.json放置在当前目录下
# 文件将被自动复制到全局配置
npx @gongrzhe/server-calendar-autoauth-mcp auth
认证过程会:
~/.calendar-mcp/查找gcp-oauth.keys.json~/.calendar-mcp/~/.calendar-mcp/credentials.json注意:
- 成功认证后,凭证会被全局存储在
~/.calendar-mcp/,可以从任何目录使用- 支持桌面应用和Web应用凭证
- 对于Web应用凭证,请确保添加
http://localhost:3000/oauth2callback到您的授权重定向URI
在Claude Desktop中配置:
{
"mcpServers": {
"calendar": {
"command": "npx",
"args": [
"@gongrzhe/server-calendar-autoauth-mcp"
]
}
}
}
如果您更喜欢使用Docker:
docker run -i --rm \
--mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
-v mcp-calendar:/calendar-server \
-e CALENDAR_OAUTH_PATH=/gcp-oauth.keys.json \
-e "CALENDAR_CREDENTIALS_PATH=/calendar-server/credentials.json" \
-p 3000:3000 \
mcp/calendar auth
{
"mcpServers": {
"calendar": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"mcp-calendar:/calendar-server",
"-e",
"CALENDAR_CREDENTIALS_PATH=/calendar-server/credentials.json",
"mcp/calendar"
]
}
}
}
该服务器提供了几个可通过Claude Desktop使用的工具:
{
"summary": "团队会议",
"start": {
"dateTime": "2024-01-20T10:00:00Z"
},
"end": {
"dateTime": "2024-01-20T11:00:00Z"
},
"description": "每周团队同步",
"location": "会议室A"
}
{
"timeMin": "2024-01-01T00:00:00Z",
"timeMax": "2024-12-31T23:59:59Z",
"maxResults": 10,
"orderBy": "startTime"
}
{
"eventId": "event123",
"summary": "更新后的会议标题",
"start": {
"dateTime": "2024-01-20T11:00:00Z"
},
"end": {
"dateTime": "2024-01-20T12:00:00Z"
}
}
{
"eventId": "event123"
}
~/.calendar-mcp/)找不到OAuth密钥
gcp-oauth.keys.json在当前目录或~/.calendar-mcp/无效凭证格式
web或installed凭证端口已被占用
欢迎贡献!请随时提交Pull Request。
本项目采用ISC许可证。
gongrzhe
如果您遇到任何问题或有疑问,请在GitHub仓库中提交Issue。