Purpose
mcp-google-chat is an MCP (Model Context Protocol) server that wraps the Google Chat API, letting AI applications perform common Google Chat operations in natural language: finding spaces or direct messages, reading conversations, replying in threads, adding emoji reactions, viewing attachment information, and managing space members.
Key capabilities
- 20 tools in total, covering space and direct message discovery, message reading and sending, thread control, emoji reactions, attachment metadata reading, and member management.
- Runs as the signed-in user: messages are sent in your name, and editing and deletion only affect your own messages and reactions; membership changes also require you to be a space manager.
- No replay on send: write operations are not retried after an uncertain failure, avoiding duplicate messages in real rooms.
- Minimal Google permission scopes: scopes are granted per task; browsing spaces and messages only requires read-only permission.
- Supports connecting in conversation: say "connect Google Chat", and the server guides you through creating an OAuth client, receives the Google redirect via PKCE on 127.0.0.1, and saves the token itself, with no config file and no restart.
- Also supports the environment variable approach (CI, unattended installs), where you can provide an OAuth triple or an access token.
Usage
Requires Node.js 20+ and a Google account with access to Google Chat. No credentials are needed at install time; connecting starts from the conversation.
To add the server in an AI application: open Settings → MCP servers, select Add server, select STDIO, enter the command npx -y mcp-google-chat@latest, and save. No environment variables are needed; connect in the conversation afterward.
In-conversation connection flow:
setup_instructionsprints a checklist: create or select a Google Cloud project, enable the Google Chat API, configure the consent screen, and create a Desktop app OAuth client.- Download the JSON for that client, give the path to the assistant, and
set_clientsaves it so that only the owner can read it; the secret does not pass through the conversation. start_loginreturns a Google consent link; open it on this machine and approve; the authorization code goes to a one-time listener on 127.0.0.1 (PKCE) and does not pass through the chat.finish_loginexchanges the authorization code, saves the token to~/.config/mcp-google-chat/credentials.json(permissions 0600), and verifies it with a real Chat API call.- The token is re-read on every call, so the connection takes effect immediately with no need to restart the AI application.
auth_statusshows the connection status, andlogoutrevokes and deletes it.
Environment variable approach: create or select a Google Cloud project and enable the Google Chat API, configure the OAuth consent screen and create a Desktop app OAuth client, and authorize the Google account you use for chat. Request only the scopes needed for the session; for reading and sending you can use:
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.messages.readonly
https://www.googleapis.com/auth/chat.messages.create
For the full task-based scope table, see docs/TOOLS.md. OAuth refresh tokens in testing mode may expire after 7 days; for long-term access, publish the OAuth app, or use an Internal app in a Workspace domain. Client secrets and refresh tokens should be treated as passwords.
You can also use GOOGLE_CHAT_ACCESS_TOKEN Provide a short-lived token (for example, via gcloud auth print-access-token and grant the Chat scope); the same variable is also used to pass the service account's Chat app token. All variables are optional; when not set, the connection is made from the conversation.
Use cases
- View the team space's messages for the day and summarize decisions.
- Reply "release complete" in a deployment thread.
- Edit or delete your own recent messages.
- Add 👍 to an announcement and view others' reactions.
- View the names and types of message attachments.
- Look up space members and managers, and add or remove members.
Limitations
- Running as a Chat app identity (cards, app DMs, dedicated attachment endpoints, forced deletion) requires separate Google Cloud configuration; the only bridging method here is via
GOOGLE_CHAT_ACCESS_TOKENto provide a service account access token. - The Chat API cannot search message text; message filtering only supports creation time and threads.
find_direct_messageOnly finds existing DMs and does not create DMs; the server does not download or upload file bytes. Space creation and other uncovered API methods are done viaraw_request. - Spaces accept bare ids, but messages, threads, members, reactions, and attachments require the full resource names returned by the API—list first, then operate by exact name.
- Replies are located by thread name or thread key; by default it falls back to creating a new thread when the thread cannot be located, and failure can also be requested.
- Confirmation prompts are controlled by the AI client; the server marks read, write, and destructive tools so clients can distinguish them.
- Google Chat requires OAuth 2.0; an API key is not sufficient.
- There is no background polling; the server only runs when invoked;
list_messagescan poll incrementally by creation time (requires AI app support for scheduled tasks); space event subscriptions are viaraw_request. - Google imposes quotas by project and user; the server backs off on 429, reads are also retried after network and 5xx errors, and writes are not replayed after an uncertain failure.
send_messageaccepts custom message ids, making sends addressable and deduplicable. - Anonymous telemetry includes installation ID, package version, AI client and platform version, and tool names; it does not include OAuth tokens, message content, tool parameters, or prompts; on failure, a redacted error text excerpt is sent. Set
ASKADS_TELEMETRY=0to opt out.