Skip to main content
Glama
Google Chat MCP Server

Google Chat MCP Server

by chy168

Introducción

Este proyecto proporciona una integración de Google Chat para servidores MCP (Protocolo de Control de Modelos) escritos en Python con FastMCP. Permite acceder e interactuar con espacios y mensajes de Google Chat mediante herramientas MCP.

Estructura

El proyecto consta de dos componentes principales:

  1. Servidor MCP con herramientas de Google Chat : proporciona herramientas para interactuar con Google Chat a través del Protocolo de control de modelos.

    • Escrito por FastMCP

    • server.py : Implementación del servidor MCP principal con herramientas de Google Chat

    • google_chat.py : Integración de la API de Google Chat y gestión de la autenticación

  2. Servidor de autenticación : componente independiente para la autenticación de cuentas de Google

    • Escrito por FastAPI

    • Maneja el flujo OAuth2 con Google

    • Almacena y administra tokens de acceso

    • Se puede ejecutar de forma independiente o como parte del servidor MCP

    • server_auth.py : Implementación del servidor de autenticación

El flujo de autenticación te permite obtener y actualizar los tokens de la API de Google, que luego utilizan las herramientas de MCP para acceder a los datos de Google Chat (tus espacios y mensajes).

Related MCP server: google-chat-mcp

Características

  • Autenticación OAuth2 con la API de Google Chat

  • Lista de espacios de chat de Google disponibles

  • Recuperar mensajes de espacios específicos con filtrado de fechas

  • Servidor de autenticación local para una fácil configuración

Requisitos

  • Python 3.8+

  • Proyecto de Google Cloud con API de chat habilitada

  • Credenciales OAuth2 de Google Cloud Console

¿Cómo utilizarlo?

Preparar el inicio de sesión de Google OAuth

  1. Clonar este proyecto

    git clone https://github.com/chy168/google-chat-mcp-server.git
    cd google-chat-mcp-server
  2. Preparar un proyecto de Google Cloud (GCP)

  3. Google Cloud Console ( https://console.cloud.google.com/auth/overview?project=\ <SU_NOMBRE_DE_PROYECTO>)

  4. Plataforma de autenticación de Google > Clientes > (+) Crear cliente > Referencia de la aplicación web: https://developers.google.com/identity/protocols/oauth2/?hl=es Orígenes de JavaScript autorizados: http://localhost:8000 URI de redireccionamiento autorizados: http://localhost:8000/auth/callback

  5. Después de crear un cliente OAuth 2.0, descargue los secretos del cliente como archivo .json . Guárdelos como credentials.json en el nivel superior del proyecto.

Ejecute el servidor de autenticación y obtenga su token de acceso de Google (inicie sesión solo en Google, todavía no en el servidor MCP)

python server.py -local-auth --port 8000
  • Abra el navegador en http://localhost:8000/auth

  • ¡Inicia sesión!

  • Después de iniciar sesión, su token de acceso se guardará como token.json

Configuración de 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"
            ]
        }
    }

Herramientas

El servidor MCP proporciona las siguientes herramientas:

Herramientas de chat de Google

  • get_chat_spaces() - Enumera todos los espacios de Google Chat a los que el bot tiene acceso

  • get_space_messages(space_name: str, start_date: str, end_date: str = None) - Lista de mensajes de un espacio específico de Google Chat con filtrado de tiempo opcional

Desarrollo y depuración

fastmcp dev server.py --with-editable .

Available Tools

5 tools
addC

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

    C2.7/5.0

    Scored across 5 tools

    Disambiguation2/5

    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 Consistency2/5

    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.

    Tool Count2/5

    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.

    Completeness2/5

    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

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      Enables 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.
      13
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for Google Chat that enables managing spaces, messages, members, reactions, attachments, and GIFs through the Model Context Protocol.
      35 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Google Chat through MCP, allowing listing spaces and messages, searching messages, and sending messages. Supports local and remote transports.
      Apache 2.0