Google Chat MCP Server
Summary: This MCP server connects to Google Chat (with OAuth2 login) so an assistant can list spaces and read their messages.
List Google Chat spaces (
get_chat_spaces) — enumerate all spaces the authenticated account/bot can access.Read space messages (
get_space_messages) — fetch messages from a space likespaces/<id>, with requiredstart_dateand optionalend_date(YYYY-MM-DD); a single date covers that whole day.Read bot/webhook card messages — cards are rendered into a
cards_textmarkdown field (headers, values, links) since such messages often have emptytext.Search messages (
search_messages, per README) — case-insensitive substring search across message and card text, with optional date bounds.Authenticate via OAuth2 — CLI mode (headless: paste redirect URL) or web mode (browser at
localhost:8000/auth), savingtoken.json; can also run in Docker/Podman.Note: the schema also exposes unrelated demo tools
add,fetch_weather, andget_ip_my_address, which are not part of the documented Google Chat feature set.
Provides tools for accessing and interacting with Google Chat spaces and messages, including listing available spaces and retrieving messages with date filtering.
Utilizes Google Cloud authentication for OAuth2 credentials required to access Google Chat API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Chat MCP Server list my Google Chat spaces"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Introduction
This project provides a Google Chat integration for MCP (Model Control Protocol) servers written by Python with FastMCP. It allows you to access and interact with Google Chat spaces and messages through MCP tools.
Structure
The project consists of two main components:
MCP Server with Google Chat Tools: Provides tools for interacting with Google Chat through the Model Control Protocol.
Written by FastMCP
server.py: Main MCP server implementation with Google Chat toolsgoogle_chat.py: Google Chat API integration and authentication handling
Authentication Server: Standalone component for Google account authentication
Written by FastAPI
Handles OAuth2 flow with Google
Stores and manages access tokens
Can be run independently or as part of the MCP server
server_auth.py: Authentication server implementation
The authentication flow allows you to obtain and refresh Google API tokens, which are then used by the MCP tools to access Google Chat data. (Your spaces and messages)
Related MCP server: google-chat-mcp
Features
OAuth2 authentication with Google Chat API
List available Google Chat spaces
Retrieve messages from specific spaces with date filtering
Read card messages (bots, webhooks, CI notifications) rendered as markdown
Local authentication server for easy setup
Requirements
Python 3.13+
Google Cloud project with the following APIs enabled:
Google Chat API
People API (for user display names)
OAuth2 credentials from Google Cloud Console
How to use?
Prepare Google Oauth Login
Clone this project
git clone https://github.com/chy168/google-chat-mcp-server.git cd google-chat-mcp-serverPrepare a Google Cloud Project (GCP)
Google Cloud Conolse (https://console.cloud.google.com/auth/overview?project=<YOUR_PROJECT_NAME>)
Google Auth Platform > Clients > (+) Create client > Web application reference: https://developers.google.com/identity/protocols/oauth2/?hl=en Authorized JavaScript origins add:
http://localhost:8000Authorized redirect URIs:http://localhost:8000/auth/callbackAfter you create a OAuth 2.0 Client, download the client secrets as
.jsonfile. Save ascredentials.jsonat top level of project.
Authentication
There are two authentication modes available:
Option 1: CLI Mode (Recommended for headless/remote environments)
uv run python server.py --auth cliThis will:
Display an authorization URL
Open the URL in any browser (can be on another device)
Complete Google authorization
Copy the redirect URL from browser and paste it back to terminal
Token will be saved as
token.json
Option 2: Web Mode (For environments with local browser)
uv run python server.py --auth web --port 8000Open browser at http://localhost:8000/auth
Complete Google login
Token will be saved as
token.json
MCP Configuration (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"
]
}
}Docker / Podman
Run Container
# Mount your project directory containing token.json
docker run -it --rm \
-v /path/to/your/project:/data \
ghcr.io/chy168/google-chat-mcp-server:latest \
--token-path=/data/token.json
# or with podman
podman run -it --rm \
-v /path/to/your/project:/data \
ghcr.io/chy168/google-chat-mcp-server:latest \
--token-path=/data/token.jsonRun Auth Server in Container
# Web mode
docker run -it --rm \
-p 8000:8000 \
-v /path/to/your/project:/data \
ghcr.io/chy168/google-chat-mcp-server:latest \
--auth web --host 0.0.0.0 --port 8000 --token-path=/data/token.json
# CLI mode (for headless environments)
docker run -it --rm \
-v /path/to/your/project:/data \
ghcr.io/chy168/google-chat-mcp-server:latest \
--auth cli --token-path=/data/token.jsonTools
The MCP server provides the following tools:
Google Chat Tools
get_chat_spaces()- List all Google Chat spaces the bot has access toget_space_messages(space_name: str, start_date: str, end_date: str = None)- List messages from a specific Google Chat space with optional time filteringsearch_messages(space_name: str, query: str, start_date: str = None, end_date: str = None)- Case-insensitive substring search in message text and card text
Card messages
Bots and webhooks (CI, monitoring, alerting) usually post cards and leave the message text empty.
Such messages get an extra cards_text field holding the cards rendered as markdown: card and section
headers as headings, labelled values as list items, and buttons and clickable texts as links.
{"sender": "CI", "text": null, "cards_text": "## ❌ my-pipeline #42\n\n_Build failed_\n\n- **Duration** : 11 sec\n[Open build](https://ci.example.com/42)"}Development and Debug
Build Image
docker build -t google-chat-mcp-server:latest .
# or
podman build -t google-chat-mcp-server:latest .Debug
fastmcp dev server.py --with-editable .Run Tests
uv run python -m unittest discover -s tests -t .The same suite runs in GitHub Actions on every push and pull request (.github/workflows/test.yml).
Available Tools
5 toolsaddC
Add two numbers
Inputs: a (required), b (required).
fetch_weatherB
Fetch current weather for a city
Inputs: city (required).
get_chat_spacesA
List all Google Chat spaces the bot has access to.
This tool requires OAuth authentication. On first run, it will open a browser window for you to log in with your Google account. Make sure you have credentials.json downloaded from Google Cloud Console in the current directory.
Inputs: no named parameters.
get_ip_my_addressC
Get IP address from outian.net
Inputs: city (required).
get_space_messagesA
List messages from a specific Google Chat space with optional time filtering.
This tool requires OAuth authentication. The space_name should be in the format 'spaces/your_space_id'. Dates should be in YYYY-MM-DD format (e.g., '2024-03-22').
When only start_date is provided, it will query messages for that entire day. When both dates are provided, it will query messages from start_date 00:00:00Z to end_date 23:59:59Z.
Args: space_name: The name/identifier of the space to fetch messages from start_date: Required start date in YYYY-MM-DD format end_date: Optional end date in YYYY-MM-DD format
Returns: List of message objects from the space matching the time criteria
Raises: ValueError: If the date format is invalid or dates are in wrong order
Inputs: space_name (required), start_date (required), end_date.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The tool set has significant ambiguity issues. 'add' (math operation) and 'fetch_weather' (weather API) are completely unrelated to the Google Chat domain suggested by the server name and other tools. 'get_ip_my_address' is another unrelated utility. Only 'get_chat_spaces' and 'get_space_messages' clearly belong to the Google Chat domain, creating confusion about the server's actual purpose.
Naming conventions are inconsistent across the tool set. 'add' uses a simple verb, 'fetch_weather' uses verb_noun, 'get_chat_spaces' and 'get_space_messages' use get_noun_noun pattern, and 'get_ip_my_address' mixes get_noun_adjective_noun. There's no coherent naming strategy, with tools using different verb styles and structural patterns.
With only 5 tools, the count seems reasonable at first, but the content mismatch makes it inappropriate. For a 'Google Chat MCP Server', having only 2 actual Google Chat tools alongside 3 unrelated utilities creates a poorly scoped tool set. The server name suggests a focused domain, but the tools deliver a scattered collection.
For a Google Chat server, the coverage is severely incomplete. While 'get_chat_spaces' and 'get_space_messages' provide read access, there are no tools for creating messages, updating content, managing memberships, or other essential chat operations. The inclusion of unrelated tools (add, fetch_weather, get_ip) further dilutes the domain coverage, creating significant gaps in the expected functionality.
Maintenance
Related MCP Connectors
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
Appreciate teammates, celebrate milestones, and run workspace ops from MCP clients via OAuth.
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
Confluence MCP — wraps the Confluence Cloud REST API v2 (OAuth)
Related MCP Servers
- 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
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Chat that enables managing spaces, messages, members, reactions, attachments, and GIFs through the Model Context Protocol.110 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Chat through MCP, allowing listing spaces and messages, searching messages, and sending messages. Supports local and remote transports.34 npmApache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Workspace (Drive, Docs, Sheets, Gmail) via MCP tools, using OAuth credentials stored locally or inline.-