Google Chat MCP Server
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:
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 Chatgoogle_chat.py: Integración de la API de Google Chat y gestión de la autenticación
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 Workspace MCP Server
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
Clonar este proyecto
git clone https://github.com/chy168/google-chat-mcp-server.git cd google-chat-mcp-serverPreparar un proyecto de Google Cloud (GCP)
Google Cloud Console ( https://console.cloud.google.com/auth/overview?project=\ <SU_NOMBRE_DE_PROYECTO>)
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:8000URI de redireccionamiento autorizados:http://localhost:8000/auth/callbackDespués de crear un cliente OAuth 2.0, descargue los secretos del cliente como archivo
.json. Guárdelos comocredentials.jsonen 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 8000Abra 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 accesoget_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 toolsaddC
Add two numbers
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Add two numbers' implies a simple computation but doesn't address potential issues like integer overflow, error handling, or output format. For a tool with zero annotation coverage, this leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at three words, with zero wasted text. It's front-loaded and directly states the tool's function without unnecessary elaboration, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 parameters, no annotations, no output schema), the description is minimal but inadequate. It doesn't explain the return value (e.g., sum as integer), error cases, or behavioral nuances. For even a simple tool, more context would improve agent understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter descriptions. The description 'Add two numbers' implies the parameters are numbers to be added, which adds basic semantic meaning beyond the schema's type definitions. However, it doesn't specify parameter roles (e.g., which is first/second) or constraints, leaving some ambiguity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Add two numbers' clearly states the verb ('Add') and resource ('two numbers'), making the purpose immediately understandable. It doesn't distinguish from sibling tools (fetch_news_articles, get_weather) since they're unrelated, but the purpose is specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions. While the sibling tools are unrelated, the description offers no usage instructions beyond the basic operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fetch_weatherB
Fetch current weather for a city
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so description must cover behavioral traits. It only states it fetches weather, lacking details like mutability, error conditions, or data freshness.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no waste. Perfectly concise for the function's simplicity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a simple one-parameter tool, but lacks information about return value (no output schema) or any side effects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage; description implies 'city' parameter is a city name but adds no format or constraints beyond the schema type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Fetch current weather for a city' clearly states the verb and resource, and distinguishes this weather tool from the many UI automation siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use or alternatives, but the context implies it should be used for weather queries. No alternatives exist among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the authentication requirement (OAuth), first-run behavior (browser window), and prerequisites (credentials.json file). However, it doesn't mention rate limits, pagination, or what specific data is returned about each space.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized but not optimally structured. The first sentence clearly states the purpose, but the following authentication details could be more efficiently integrated. While all information is relevant, the flow from purpose to authentication setup could be smoother.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description provides good coverage of authentication requirements but lacks information about return values, pagination, or error handling. For a list operation with no structured output documentation, more detail about what data is returned would be helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on authentication requirements which is the correct emphasis for a parameterless tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('List all Google Chat spaces') and resource ('Google Chat spaces the bot has access to'), distinguishing it from siblings like 'get_space_messages' which focuses on messages within spaces rather than listing spaces themselves. The verb+resource combination is precise and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. While it implicitly suggests usage for listing accessible spaces, there's no mention of when NOT to use it or how it differs from potential sibling tools. The description focuses on authentication setup rather than usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_ip_my_addressC
Get IP address from outian.net
| Name | Required | Description | Default |
|---|---|---|---|
| city | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool gets an IP address but doesn't explain how it works (e.g., via an API call to outian.net), what the response format is, potential rate limits, or error handling. This leaves significant gaps in understanding the tool's behavior and reliability.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with a single sentence, 'Get IP address from outian.net', which is front-loaded and wastes no words. It efficiently communicates the core function without unnecessary details, making it easy to scan and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (simple but with an undocumented parameter), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what the tool returns, how the parameter affects the result, or any behavioral aspects, making it inadequate for effective use without additional guesswork or documentation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 1 parameter ('city') with 0% description coverage, and the tool description doesn't mention any parameters. This fails to compensate for the lack of schema documentation, leaving the parameter's purpose (e.g., whether it filters by city or something else) unexplained and potentially confusing for users.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool's purpose as 'Get IP address from outian.net', which includes a verb ('Get') and resource ('IP address'), but is vague about what specific IP address is retrieved (e.g., user's current IP, IP for a city). It doesn't distinguish from sibling tools like 'fetch_weather' or 'get_chat_spaces', which are unrelated, but the purpose is clear enough to understand the basic function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or exclusions, such as whether it's for geolocation, network diagnostics, or other use cases. Without this, users must infer usage from the tool name and parameters alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| space_name | Yes | ||
| start_date | Yes | ||
| end_date | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes authentication requirements ('requires OAuth authentication'), input format constraints (space_name format, date format), time range behavior (how start_date and end_date affect the query), and error conditions (raises ValueError). It doesn't mention rate limits, pagination, or what happens with large result sets, but covers core operational aspects well.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and well-structured: it starts with the core purpose, then covers prerequisites and format details, explains behavioral logic, and concludes with parameter documentation and error handling. Every sentence adds value without redundancy, and information is logically organized for quick comprehension.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and 0% schema description coverage, the description does an excellent job covering authentication, input formats, temporal logic, and errors. However, it doesn't describe the structure of returned message objects (only mentions 'List of message objects'), which would be helpful since there's no output schema. For a read-only listing tool, this is a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by explaining all three parameters: space_name (format requirements), start_date (required, format, behavior when used alone), and end_date (optional, format, behavior when combined with start_date). It adds crucial meaning beyond the bare schema, including format specifications and temporal logic.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('List messages') and resource ('from a specific Google Chat space') with additional scope ('with optional time filtering'). It distinguishes from sibling tools like 'get_chat_spaces' (which likely lists spaces rather than messages) and 'add' or 'fetch_weather' (completely different domains).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context about when to use this tool (for listing messages from a Google Chat space with time filtering) but doesn't explicitly state when NOT to use it or mention alternatives among sibling tools. It doesn't compare with other message-fetching tools if they exist, though the sibling list doesn't suggest direct alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
add - First observed
fetch_weather - First observed
get_chat_spaces - First observed
get_ip_my_address - First observed
get_space_messages
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
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)
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
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
- AlicenseBqualityDmaintenanceProvides natural language control over Google Workspace services (Calendar, Drive, Gmail, Docs, Sheets, Slides, Forms, Tasks, Chat) via MCP, with OAuth 2.1 multi-user authentication.100MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Chat that enables managing spaces, messages, members, reactions, attachments, and GIFs through the Model Context Protocol.192 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Chat through MCP, allowing listing spaces and messages, searching messages, and sending messages. Supports local and remote transports.49 npmApache 2.0