Google Chat MCP Server
介绍
该项目为使用 Python 和 FastMCP 编写的 MCP(模型控制协议)服务器提供了 Google Chat 集成。它允许您通过 MCP 工具访问 Google Chat 聊天室和消息并进行交互。
结构
该项目由两个主要部分组成:
带有 Google Chat 工具的 MCP 服务器:提供通过模型控制协议与 Google Chat 交互的工具。
作者:FastMCP
server.py:使用 Google Chat 工具的主要 MCP 服务器实现google_chat.py:Google Chat API 集成和身份验证处理
身份验证服务器:用于 Google 帐户身份验证的独立组件
由 FastAPI 编写
与 Google 一起处理 OAuth2 流程
存储和管理访问令牌
可以独立运行或作为 MCP 服务器的一部分运行
server_auth.py:认证服务器实现
身份验证流程允许您获取并刷新 Google API 令牌,然后 MCP 工具会使用这些令牌访问 Google Chat 数据。(您的聊天室和消息)
Related MCP server: Google Chat MCP Server
特征
使用 Google Chat API 进行 OAuth2 身份验证
列出可用的 Google Chat 空间
通过日期过滤从特定空间检索消息
本地身份验证服务器,易于设置
要求
Python 3.8+
启用 Chat API 的 Google Cloud 项目
来自 Google Cloud Console 的 OAuth2 凭据
如何使用?
准备 Google Oauth 登录
克隆此项目
git clone https://github.com/chy168/google-chat-mcp-server.git cd google-chat-mcp-server准备 Google Cloud 项目 (GCP)
Google Cloud Console( https://console.cloud.google.com/auth/overview?project=\ <YOUR_PROJECT_NAME>)
Google Auth 平台 > 客户端 > (+) 创建客户端 > Web 应用程序参考: https://developers.google.com/identity/protocols/oauth2/ ?hl=en 授权 JavaScript 来源添加:
http://localhost:8000授权重定向 URI:http://localhost:8000/auth/callback创建 OAuth 2.0 客户端后,请将客户端密钥下载为
.json文件。并将其保存为credentials.json,并置于项目根目录。
运行 Auth 服务器并获取您的 Google 访问令牌(仅登录 Google,尚未登录 MCP 服务器)
python server.py -local-auth --port 8000打开浏览器访问http://localhost:8000/auth
登录吧!
登录后,您的访问令牌将保存为
token.json
MCP 配置 (mcp.json)
{
"mcpServers": {
"google_chat": {
"command": "uv",
"args": [
"--directory",
"<YOUR_REPO_PATH>/google-chat-mcp-server",
"run",
"server.py",
"--token-path",
"<YOUR_REPO_PATH>/google-chat-mcp-server/token.json"
]
}
}工具
MCP 服务器提供以下工具:
Google 聊天工具
get_chat_spaces()- 列出机器人可以访问的所有 Google 聊天空间get_space_messages(space_name: str, start_date: str, end_date: str = None)- 列出来自特定 Google Chat 空间的消息,并可选择时间过滤
开发和调试
fastmcp dev server.py --with-editable .Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceThis MCP server provides comprehensive Google Workspace integration (Gmail, Drive, etc.) with multi-user OAuth. Unique features include RAG-powered natural language to Chat card rendering, runtime Jinja2 macro creation, and dynamic tool management.725Apache 2.0
- AlicenseAqualityAmaintenanceEnables interaction with Google Chat via MCP using the internal Dynamite API, allowing listing spaces, reading and sending messages, and managing DMs. No Google Cloud Console setup required.13MIT
- AlicenseBqualityDmaintenanceProvides natural language control over Google Workspace services (Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, Chat) via MCP, with OAuth 2.1 multi-user authentication.100MIT
- Alicense-qualityDmaintenanceMCP server for Google Chat that enables managing spaces, messages, members, reactions, attachments, and GIFs through the Model Context Protocol.1321MIT
Related MCP Connectors
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth.
Confluence MCP — wraps the Confluence Cloud REST API v2 (OAuth)
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chy168/google-chat-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server