
Google MCP 中的模型上下文协议(MCP)实现使 AI 模型能够通过标准化接口与 Google 服务交互。
概览
Google MCP 中的模型上下文协议(MCP)实现使 AI 模型能够通过标准化接口与 Google 服务交互。 - Go 1.23.2 或更高版本 - 启用以下 API 的 Google Cloud Platform 账户:- Google 日历 API - Gmail API - Google 聊天 API - Google Cloud 凭证(OAuth 2.0 客户端 ID) 2. 创建一个带有你配置的 .env 文件: https://developers.google.com/workspace/chat/authenticate-authorize-chat-user ENABLE_TOOLS环境变量是一个逗号分隔的可启用工具组列表。可用组包括:- 日历 - Google 日历工具 - gmail - Gmail 工具 - gchat - Google 聊天工具 在 Google 日历中创建一个包含标题、描述、时间和参与者的新活动。 在谷歌日历中列出即将举行的活动,并可自定义时间范围和结果限制。 更新现有活动的详细信息,包括名称、描述、时间和参与者。
概述(AI 翻译)
Google MCP 中的模型上下文协议(MCP)实现使 AI 模型能够通过标准化接口与 Google 服务交互。
先修条件
- 达到1.23.2或更高
- 启用以下 API 的 Google Cloud Platform 账户:
- Google 日历 API
- Gmail API
- 谷歌聊天 API
- Google Cloud 凭证(OAuth 2.0 客户端 ID)
安装
通过 Go 安装
-
安装服务器:
-
创建一个包含你的配置的
.env文件:
https://developers.google.com/workspace/chat/authenticate-authorize-chat-user
- 配置你的 Claude 配置:
启用工具
ENABLE_TOOLS 环境变量是一个逗号分隔的工具组列表,需启用。可用组有:
calendar- 谷歌日历工具gmail- Gmail 工具gchat- Google Chat 工具
保持空着以启用所有工具。
可用工具
组别:日历
####calendar_create_event 在 Google 日历中创建一个包含标题、描述、时间和参与者的新活动。
calendar_list_events
在谷歌日历中列出即将举行的活动,并可自定义时间范围和结果限制。
calendar_update_event
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google MCP - Model Context Protocol (MCP) Server
The Model Context Protocol (MCP) implementation in Google MCP enables AI models to interact with Google services through a standardized interface.
Prerequisites
- Go 1.23.2 or higher
- Google Cloud Platform account with the following APIs enabled:
- Google Calendar API
- Gmail API
- Google Chat API
- Google Cloud credentials (OAuth 2.0 Client ID)
Installation
Installing via Go
- Install the server:
go install github.com/nguyenvanduocit/google-mcp@latest
- Create a
.envfile with your configuration:
# Required for Google Services
GOOGLE_CREDENTIALS_FILE= # Required: Path to Google Cloud credentials JSON file
GOOGLE_TOKEN_FILE= # Required: Path to store Google OAuth tokens
# Optional configurations
ENABLE_TOOLS= # Optional: Comma-separated list of tool groups to enable (empty = all enabled)
PROXY_URL= # Optional: HTTP/HTTPS proxy URL if needed
https://developers.google.com/workspace/chat/authenticate-authorize-chat-user
- Configure your Claude’s config:
{
"mcpServers": {
"google_mcp": {
"command": "google-mcp",
"args": ["-env", "/path/to/.env"]
}
}
}
Enable Tools
The ENABLE_TOOLS environment variable is a comma-separated list of tool groups to enable. Available groups are:
calendar- Google Calendar toolsgmail- Gmail toolsgchat- Google Chat tools
Leave it empty to enable all tools.
Available Tools
Group: calendar
calendar_create_event
Create a new event in Google Calendar with title, description, time, and attendees.
calendar_list_events
List upcoming events in Google Calendar with customizable time range and result limit.
calendar_update_event
Update an existing event’s details including title, description, time, and attendees.
calendar_respond_to_event
Respond to an event invitation (accept, decline, or tentative).
Group: gchat
gchat_list_spaces
List all available Google Chat spaces/rooms.
gchat_send_message
Send a message to a Google Chat space or direct message.
Group: gmail
gmail_search
Search emails in Gmail using Gmail’s search syntax.
gmail_move_to_spam
Move specific emails to spam folder in Gmail by message IDs.
gmail_create_filter
Create a Gmail filter with specified criteria and actions:
- Filter by sender, recipient, subject, or custom query
- Add labels
- Mark as important
- Mark as read
- Archive messages
gmail_list_filters
List all Gmail filters in the account.
gmail_list_labels
List all Gmail labels in the account.
gmail_delete_filter
Delete a Gmail filter by its ID.
gmail_delete_label
Delete a Gmail label by its ID.
CLI Usage
In addition to the MCP server, google-mcp ships a standalone CLI binary (google-cli) for direct terminal use — no MCP client needed.
Installation
just install-cli
# or
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"google_mcp": {
"command": "google-mcp",
"args": ["-env", "/path/to/.env"]
}
}
}