连接器指南阅读约 5 分钟18 个 MCP 工具7 种语言

如何通过 MCP 将 Google Chat 连接到 Cursor

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

HC作者:HelpCode 团队更新于 5 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

Google Chat

Google Chat

Let your AI work in Google Chat as you: find spaces, group chats and direct messages, read and search messages and threads, see members, reactions and attachments, follow what changed in a space, post messages and replies, edit your messages and react. Google Workspace accounts.

个工具

18

区域

INTL

类别

即时通讯

身份验证

OAuth 2.0

所需环境变量

GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 Google Chat,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

试试这样问

Google Chat 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

Google Chat · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Google Chat、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Google Chat + Cursor

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET

步骤 1 — 获取凭证

设置大约需要 15 分钟。你需要一个 Google Workspace 账户(Business、Enterprise 或 Education):Google Chat API 的用户访问不支持个人 Gmail 账户。

  1. 打开 https://console.cloud.google.com,选择或创建一个项目,进入 APIs & Services → Library,启用 Google Chat API。
  2. 配置 Chat 应用,这是 Google 对代表用户调用 Chat API 的要求:打开 APIs & Services → Enabled APIs → Google Chat API → Configuration(https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat)。填写 App name(例如 AnythingMCP)、Avatar URL(任意指向正方形 PNG 或 JPEG 的 HTTPS 链接)和 Description,保持 Interactive features 关闭,然后点击 Save。跳过这一步,发消息时会报错 "Google Chat app not found"。
  3. 打开 APIs & Services → OAuth consent screen,选择 Internal(Google Workspace)。发布状态为 Testing 的 External 应用会在 7 天后失去刷新令牌。
  4. 打开 APIs & Services → Credentials → Create credentials → OAuth client ID,应用类型选 Web application,添加已授权的重定向 URI <your AnythingMCP URL>/api/mcp-oauth/callback,在 AnythingMCP Cloud 上为 https://cloud.anythingmcp.com/api/mcp-oauth/callback。
  5. 把客户端 ID 粘贴到 GOOGLE_CLIENT_ID,客户端密钥粘贴到 GOOGLE_CLIENT_SECRET,然后安装连接器。
  6. 在连接器页面点击 Authorize with Provider,用 AI 要代表其操作的 Google Workspace 账户登录。刷新令牌加密保存,访问令牌会自动续期。
  7. 运行 google_chat_list_spaces:它会列出已登录账户的聊天室、群聊和私信。

一个 Google 客户端服务所有 Google 连接器:同一个 Cloud 项目和 OAuth 客户端可以服务所有 Google 连接器(Gmail、Calendar、Drive、Sheets、Docs、Chat 等)。在该项目中启用各个 API,复用 GOOGLE_CLIENT_ID 和 GOOGLE_CLIENT_SECRET,并为每个连接器授权一次;每个连接器只请求自己的 scope。

以谁的名义发消息:连接器以已登录用户的身份读取、发布和编辑,就像本人亲手输入一样,并且只能看到该用户所在的聊天室。在以你的名义发消息之前,AI 应先征得你的确认。

Scope:chat.spaces.readonly(查看聊天室)、chat.messages(读取、发布、编辑和删除你的消息与表情回应)和 chat.memberships.readonly(查看成员)。如需只读设置,在连接器的 OAuth 设置中把 chat.messages 改为 https://www.googleapis.com/auth/chat.messages.readonly,重新授权,并停用 google_chat_create_message、google_chat_reply_in_thread、google_chat_update_message 和 google_chat_add_reaction。

读取的内容:你所在的每个聊天室、群聊和私信(google_chat_list_spaces,可按 spaceType 的 SPACE、GROUP_CHAT 或 DIRECT_MESSAGE 筛选),按名称搜索已命名的聊天室(google_chat_search_spaces,例如 display_name:"Marketing" AND space_type = "SPACE"),与某个人已有的私信(google_chat_find_direct_message),以及聊天室的详细信息和成员。某个聊天室的消息,默认从旧到新,或用 order_by create_time desc 从新到旧,可按时间(create_time > "2026-10-01T00:00:00Z")或限定到一个会话串筛选。跨所有聊天室和私信的关键词搜索,从新到旧,支持 sender.name = "users/[email protected]"、createTime >= "2026-10-01T00:00:00Z"、annotations.user_mentions.user.name:me(提到你的消息)、attachment:*、has_link() 或 is_unread() 等条件。消息上的表情回应、消息的附件,以及聊天室最近 28 天的变更记录:新建、修改和删除的消息、表情回应、成员变动和聊天室变更(google_chat_list_space_events,筛选条件至少要写一个事件类型,例如 google.workspace.chat.message.v1.created)。

写入的内容:在聊天室、群聊或私信中发布消息(在按会话串组织的聊天室中会开启新的会话串),在某条消息的 thread.name 指定的已有会话串中回复,替换你自己消息的文本(其他人会看到"已编辑"标记),以及添加表情回应。传入 request_id 可避免重试时重复发布。

安装时关闭:google_chat_delete_message 和 google_chat_delete_reaction。删除的消息无法恢复,所以由管理员在团队需要时开启。

数据格式:Chat 用路径命名资源:聊天室是 spaces/AAAAMpdlehY,消息是 spaces/AAAAMpdlehY/messages/ZJ7sqN6qlYk.ZJ7sqN6qlYk,会话串是 spaces/AAAAMpdlehY/threads/FHT5Rc21TfA,用户是 users/123456789。工具分别接收 space_id(spaces/ 之后的部分)和 message_id(/messages/ 之后的部分),thread_name 和 user 则使用完整名称。在筛选条件和 google_chat_find_direct_message 中也可以用邮箱,如 users/[email protected]。发送者和成员通常不带显示名称返回,因此 AI 通过 ID 或邮箱识别人员。时间为 UTC 的 RFC 3339 格式(2026-10-29T14:05:31.123Z)。卡片内容不包含在响应中。消息文本支持 *粗体*、_斜体_、~删除线~、用反引号包围的行内代码、<https://example.com|label> 形式的链接,以及 <users/123456789> 或 <users/all> 形式的提及;一条消息最多 32,000 字节。上传的附件可下载,最大 10 MB;Google 云端硬盘文件(source 为 DRIVE_FILE)通过 driveDataRef.driveFileId 用 Google Drive 连接器读取。

分页和限制:只要还有更多结果,响应中就带有 nextPageToken;AI 会把它填入 page_token,再次调用同一个工具。google_chat_list_messages 默认每页返回 25 条消息。Google Chat 每个项目每分钟允许约 3,000 次读取,每个聊天室每秒约 1 条消息;被限流的调用返回 429 RESOURCE_EXHAUSTED:请等待后重试。消息搜索会跳过来自 Chat 应用和已静音聊天室的消息;google_chat_list_messages 仍能读取它们。

常见错误:401 表示授权已过期或被撤销:再次点击 Authorize with Provider。403 PERMISSION_DENIED 表示 Chat API 未启用、缺少 scope、账户不是 Google Workspace 账户,或者你在该聊天室无权执行此操作,例如编辑别人的消息。404 NOT_FOUND 表示聊天室或消息 ID 错误、你不是该聊天室的成员,或者发消息时第 2 步的 Chat 应用尚未配置。如果你从未与某人私信过,google_chat_find_direct_message 返回 404。400 INVALID_ARGUMENT 表示 Google 不接受该筛选条件:请检查引号、运算符和字段名。

该连接器不创建聊天室,不添加或移除成员,不开启新的私信,不上传文件,不发送卡片,不以 Chat 应用机器人的身份发布消息,也不处理置顶消息或已读状态。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Cursor 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Cursor 从 ~/.cursor/mcp.json 读取 MCP 服务器。添加以下条目:

{
  "mcpServers": {
    "anythingmcp": {
      "url": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
      "headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
    }
  }
}
  1. 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换 YOUR_MCP_API_KEY。
  2. 保存文件并重启 Cursor。
  3. 打开 Cursor → Settings → MCP,确认 anythingmcp 已列出并处于已连接状态。
  4. 开始对话,智能体现在可以调用 Google Chat 的工具。

可用工具

ToolWhat it does
google_chat_list_spacesList the spaces, group chats and direct messages the user is a member of: name (spaces/...), displayName (empty for direct messages)…
google_chat_search_spacesSearch the named spaces the user has joined by display name, e.g. query display_name:"Marketing" AND space_type = "SPACE". space_type =…
google_chat_get_spaceGet one space: displayName, spaceType, description and guidelines (spaceDetails), threading state, history state, membershipCount, whether…
google_chat_find_direct_messageFind the existing one-to-one direct message between the signed-in user and another person, to read or post there
google_chat_list_membersList the members of a space: each membership's name, role (ROLE_MEMBER, ROLE_MANAGER), state (JOINED, INVITED), createTime and member (name…
google_chat_list_messagesList the messages of a space, oldest first by default: name, sender (users/{id}, type), createTime, lastUpdateTime, text, thread.name…
google_chat_get_messageGet one message: sender, createTime, lastUpdateTime, text, thread.name, attachments (name, contentName, contentType…
google_chat_search_messagesSearch messages across every space and direct message the user belongs to, newest first. filter takes keywords plus conditions, e.g. budget…
google_chat_list_reactionsList the emoji reactions on a message: each reaction's name, emoji (unicode or customEmoji) and user
google_chat_get_attachmentGet the metadata of a file attached to a message: contentName (file name), contentType, source (UPLOADED_CONTENT or DRIVE_FILE)…
google_chat_download_attachmentDownload a file uploaded to a message (source UPLOADED_CONTENT), handed over as an attached file or image, up to 10 MB
google_chat_list_space_eventsList what happened in a space during the last 28 days: new, changed and deleted messages, reactions, memberships and space changes, each…
google_chat_create_messagePost a text message to a space, group chat or direct message as the signed-in user
google_chat_reply_in_threadReply in an existing thread of a space as the signed-in user. thread_name comes from thread.name of a message
google_chat_update_messageReplace the text of a message the signed-in user sent
google_chat_add_reactionAdd an emoji reaction from the signed-in user to a message, e.g. 👍
google_chat_delete_reactionRemove one of the signed-in user's reactions from a message. reaction_id is the part after /reactions/ in the reaction's name from…
google_chat_delete_messageDelete a message the signed-in user sent (managers can delete others' messages in some spaces)

示例提示

  • “本周 Marketing 聊天室讨论了什么?每个会话串用两行总结。”
  • “找出最近三天里提到我的未读消息。”
  • “在关于第四季度预算的会话串里起草一条回复,发布前先给我看。”
  • “给 [email protected] 发一条私信,告诉她演示文稿已经可以审阅了。”
  • “10 月份 Product 聊天室里分享了哪些文件?”

FAQ

Cursor 免费套餐支持自定义 MCP 服务器吗? 支持,Hobby、Pro 和 Business 套餐均可使用 MCP。

下一步

这份指南对你有帮助吗?

你的 Google Chat 智能体只差一次点击。

安装连接器,粘贴密钥,向 Cursor 提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 Google Chat 连接到 ChatGPT

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

连接器

如何通过 MCP 将 Google Chat 连接到 Claude

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

连接器

如何通过 MCP 将 Google Chat 连接到 Gemini

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

连接器

如何通过 MCP 将 Google Chat 连接到 Meta Muse

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

连接器

Google Chat 接入 MCP:在任意 AI 智能体中处理聊天室、消息、会话串和表情回应

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。

连接器

如何通过 MCP 将 Google Chat 连接到 Microsoft Copilot

让你的 AI 以你的身份在 Google Chat 中工作:查找聊天室、群聊和私信,阅读和搜索消息与会话串,查看成员、表情回应和附件,跟踪聊天室中的变化,发布消息和回复,编辑自己的消息并添加表情回应。适用于 Google Workspace 账户,OAuth 登录;删除消息和表情回应在安装时关闭。