Google Chat MCP
A Model Context Protocol (MCP) server for Google Chat, enabling AI assistants to interact with Google Chat spaces, messages, and members.
Features
- Spaces: List and get details of Google Chat spaces
- Messages: List, get, send, and delete messages
- Members: List and get members of spaces
- Attachments: Upload file attachments to messages
Prerequisites
- A Google Cloud project with the Google Chat API enabled
- OAuth 2.0 Client ID credentials (Desktop app type)
Setup
1. Create OAuth 2.0 Credentials
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Chat API
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Desktop app as the application type
- Download the JSON file and save it as
google-credentials.json
2. Generate OAuth Token
Use the included token generation tool:
# Build the token generator
go build -o get-google-token ./scripts/get-google-token
# Run it with your credentials file
./get-google-token \
-credentials /path/to/google-credentials.json \
-token /path/to/google-token.json
This will:
- Open your browser for Google authentication
- Ask you to authorize the required Chat API scopes
- Save the OAuth token to the specified path
3. Set Environment Variables
export GOOGLE_CREDENTIALS_FILE=/path/to/google-credentials.json
export GOOGLE_TOKEN_FILE=/path/to/google-token.json
Or create a .env file:
GOOGLE_CREDENTIALS_FILE=/path/to/google-credentials.json
GOOGLE_TOKEN_FILE=/path/to/google-token.json
Usage
Install
go install github.com/nguyenvanduocit/google-chat-mcp@latest
Build from source
go build -o google-chat-mcp .
Run (STDIO mode)
./google-chat-mcp --env .env
Run (HTTP mode)
./google-chat-mcp --env .env --http_port 3003
MCP Configuration
Add to your MCP settings:
STDIO mode
{
"mcpServers": {
"google-chat": {
"command": "/path/to/google-chat-mcp",
"args": ["--env", "/path/to/.env"]
}
}
}
HTTP mode
{
"mcpServers": {
"google-chat": {
"url": "http://localhost:3003/mcp"
}
}
}
Available Tools
Spaces
google_chat_list_spaces- List all accessible Google Chat spacesgoogle_chat_get_space- Get details of a specific space
Messages
google_chat_list_messages- List messages in a spacegoogle_chat_get_message- Get a specific messagegoogle_chat_send_message- Send a message to a spacegoogle_chat_delete_message- Delete a messagegoogle_chat_upload_attachment- Upload a file attachment to a space
Members
google_chat_list_members- List members of a spacegoogle_chat_get_member- Get details of a specific member
CLI Usage
In addition to the MCP server, google-chat-mcp ships a standalone CLI binary (google-chat-cli) for direct terminal use — no MCP client needed.
Installation
just install-cli
# or
go install github.com/nguyenvanduocit/google-chat-mcp/cmd/google-chat-cli@latest
Quick Start
export GOOGLE_CREDENTIALS_FILE=/path/to/credentials.json
export GOOGLE_TOKEN_FILE=/path/to/token.json
# or
google-chat-cli --env .env <command> [flags]
Commands
Examples
# List spaces
google-chat-cli list-spaces
# Send a message
google-chat-cli send-message --space spaces/XXXXXX --text "Hello from CLI!"
# List messages
google-chat-cli list-messages --space spaces/XXXXXX
# JSON output
google-chat-cli list-spaces --output json | jq '.[].name'
Flags
Every command accepts:
--env string— Path to.envfile--output string— Output format:text(default) orjson
License
MIT
Installation
Homebrew (macOS/Linux)
brew install nguyenvanduocit/tap/google-chat-mcp
fix: trigger release processing after PR creation permission fix