Skip to main content
Glama
Google Chat MCP Server

Google Chat MCP Server

by bobamayer

Google Chat MCP Server

An MCP server that exposes Google Chat as tools for an LLM client (Claude Desktop, Claude Code, etc.): sending messages, listing spaces, and searching message history.

Tools

Tool

Description

send_message(space, text, thread_key=None)

Post a message to a space, optionally inside an existing thread.

list_spaces(page_size=100, page_token=None)

List spaces the configured account can see.

list_messages(space, page_size=50, page_token=None, filter_expr=None)

List recent messages in a space, newest first.

search_messages(space, query, page_size=50)

Substring-search a space's recent messages (client-side, since the Chat API has no full-text search endpoint).

Related MCP server: google-mcp

Setup

  1. Create a Google Cloud project and enable the Google Chat API.

  2. Create a service account and download its JSON key.

  3. To use list_spaces / list_messages / search_messages, enable domain-wide delegation for the service account in your Google Workspace admin console, granting the scopes in src/google_chat_mcp/auth.py. send_message alone works with a bare service account registered as a Chat app.

  4. Copy .env.example to .env and fill in the path to your key file (and the user to impersonate, if needed).

uv sync
cp .env.example .env  # then edit it

Running

uv run google-chat-mcp

Claude Desktop / Claude Code config

{
  "mcpServers": {
    "google-chat": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/google-chat-mcp", "run", "google-chat-mcp"],
      "env": {
        "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE": "/absolute/path/to/service-account.json",
        "GOOGLE_CHAT_IMPERSONATED_USER": "someone@yourdomain.com"
      }
    }
  }
}

Project layout

  • auth.py — builds an authenticated Google Chat API client from a service account key, with optional domain-wide-delegation impersonation.

  • chat_client.py — thin wrapper over the chat v1 REST API (send, list, search).

  • server.py — MCP tool definitions built on the official Python SDK.

Available Tools

4 tools
list_messagesA

List recent messages in a Google Chat space, newest first.

Args:
    space: Resource name of the space, e.g. "spaces/AAAAAAAAAAA".
    page_size: Max number of messages to return.
    page_token: Token from a previous call to fetch the next page.
    filter_expr: Optional Chat API filter, e.g.
        'createTime > "2024-01-01T00:00:00Z"'.

Inputs: space (required), page_size, page_token, filter_expr.

list_spacesA

List Google Chat spaces the configured account can see.

Args:
    page_size: Max number of spaces to return (1-1000).
    page_token: Token from a previous call to fetch the next page.

Inputs: page_size, page_token.

search_messagesA

Search for messages in a space containing a text substring.

Args:
    space: Resource name of the space, e.g. "spaces/AAAAAAAAAAA".
    query: Case-insensitive substring to search for in message text.
    page_size: Number of messages to fetch per page while scanning.

Inputs: query (required), space (required), page_size.

send_messageA

Send a text message to a Google Chat space.

Args:
    space: Resource name of the space, e.g. "spaces/AAAAAAAAAAA".
    text: Message body.
    thread_key: Optional thread key to reply within an existing thread.

Inputs: text (required), space (required), thread_key.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation4/5

    send_message, list_spaces, and search_messages are clearly distinct. list_messages and search_messages overlap somewhat in retrieving messages from a space, but their parameters and stated purposes make the intended difference reasonably clear.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern: send_message, list_spaces, list_messages, and search_messages. The naming is predictable and makes the action and target resource immediately obvious.

    Tool Count5/5

    Four tools is a well-scoped size for a focused Google Chat MCP server. Each tool covers a clear use case without unnecessary redundancy or overwhelming surface area.

    Completeness3/5

    The server covers sending and reading messages plus listing spaces, but it lacks message update/delete operations and has no way to create or retrieve a single space. This leaves notable lifecycle gaps for message management, though basic chat workflows are usable.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers