Google Chat offers a remote Model Context Protocol (MCP) server that allows AI agents to securely interact with Google Chat data. By configuring the Google Chat MCP server, you enable AI applications like Gemini CLI, Claude, or IDEs to perform actions in Google Chat.
The Google Chat MCP server provides a standardized way for AI agents to:
- Read data: List and search conversations, and read messages.
- Respect security: Inherit the same permissions and data governance controls as the user.
Prerequisites
-
A Google Cloud project. To create a project, see Create a project .
-
An MCP client, like Gemini CLI .
-
To run the commands on this page, set up the gcloud CLI in a local development environment by following these steps:
- Install the Google Cloud CLI
.
If you installed the gcloud CLI previously, make sure you have the
latest version by running
gcloud components update. - If you're using an external identity provider (IdP), sign in to the gcloud CLI with your federated identity. For more information, see Sign in to the gcloud CLI with your federated identity .
- Initialize the gcloud CLI .
- Install the Google Cloud CLI
.
If you installed the gcloud CLI previously, make sure you have the
latest version by running
Configure the Google Chat MCP server
To use the Google Chat MCP server, you must enable it in your Google Cloud project and then configure your MCP client to connect to it.
Enable the APIs
To use the Google Chat MCP server, you must enable the following APIs in your Google Cloud project:
-
Google Chat API
CLI
gcloud
services
enable
chat.googleapis.com
--project =
PROJECT_ID
Replace PROJECT_ID
with your Google Cloud project ID.
Console
Enable the APIs in the Google Cloud console:
Enable the MCP services
To enable the MCP components for Google Chat, you must enable the following service in your Google Cloud project:
-
Google Chat MCP API
CLI
gcloud
services
enable
chatmcp.googleapis.com
--project =
PROJECT_ID
Replace PROJECT_ID
with your Google Cloud project ID.
Console
Enable the MCP services in the Google Cloud console:
Configure the Chat app
To use the Google Chat MCP server, you must configure a Chat app in your Google Cloud project.
-
In the Google Cloud console, search for Google Chat API, and click Google Chat API > Manage > Configuration.
-
Set up the Chat app:
- Clear Build this Chat app as a Google Workspace add-on . A dialog opens asking you to confirm. In the dialog, click Disable .
- In App namefield, enter
Chat MCP. - In Avatar URLfield, enter
https://developers.google.com/chat/images/quickstart-app-avatar.png. - In Description, enter
Chat MCP server. - Under Functionality, turn off interactive features by toggling Enable interactive featuresoff.
- Under Visibility, select Make this Chat app available to specific people and groupsin your domain and enter your email address.
- Under Logs, select Log errors to Logging.
-
Click Save.
To learn more about building a Chat app, see Choose a Google Chat app architecture .
Set up the OAuth consent screen
The Google Chat MCP server uses OAuth 2.0 for authentication and authorization. You must configure the OAuth consent screen before you can create an OAuth client ID.
-
In the Google Cloud console, go to Google Auth Platform > Branding.
-
If you have already configured the Google Auth Platform, you can configure the following OAuth Consent Screen settings in Branding , Audience , and Data Access . If you see a message that says Google Auth Platform not configured yet, click Get Started:
- Under App Information, in App name, type
Chat MCP Server. - In User support email, select your email address or an appropriate Google group.
- Click Next.
- Under Audience, select Internal. If you can't select Internal, select External.
- Click Next.
- Under Contact Information, enter an Email addresswhere you can be notified about any changes to your project.
- Click Next.
- Under Finish, review the Google API Services User Data Policy and if you agree, select I agree to the Google API Services: User Data Policy.
- Click Continue.
- Click Create.
- If you selected Externalfor user type, add test users:
- Click Audience.
- Under Test users, click Add users.
- Enter your email address and any other authorized test users, then click Save.
- Under App Information, in App name, type
-
Click Data Access > Add or Remove Scopes. A panel appears with a list of scopes for each API that you've enabled in your Google Cloud project.
-
Under Manually add scopes, paste the scopes for the Google Chat MCP server:
-
https://www.googleapis.com/auth/chat.spaces.readonly -
https://www.googleapis.com/auth/chat.memberships.readonly -
https://www.googleapis.com/auth/chat.messages.readonly -
https://www.googleapis.com/auth/chat.users.readstate.readonly
-
-
Click Add to Table.
-
Click Update.
-
After selecting the scopes required by your app, on the Data Accesspage, click Save.
-
Configure your MCP client
To add the Google Chat remote MCP server to your MCP client, follow the instructions for your client.
Gemini CLI
To add the Google Chat remote MCP server to your Gemini
CLI, add the server configuration to your settings.json
file.
-
Create an OAuth 2.0 client ID and secret:
-
In the Google Cloud console, go to Google Auth Platform > Clients > Create Client
-
Select Desktop appas the application type.
-
Enter a Name.
-
Click Createand copy your Client IDand Client Secret.
-
-
Open or create the configuration file
~/.gemini/settings.json. -
Add the
mcpServersconfiguration tosettings.json:{ "mcpServers" : { "chat" : { "httpUrl" : "https://chatmcp.googleapis.com/mcp/v1" , "oauth" : { "enabled" : true , "clientId" : " OAUTH_CLIENT_ID " , "clientSecret" : " OAUTH_CLIENT_SECRET " , "scopes" : [ "https://www.googleapis.com/auth/chat.spaces.readonly" , "https://www.googleapis.com/auth/chat.memberships.readonly" , "https://www.googleapis.com/auth/chat.messages.readonly" , "https://www.googleapis.com/auth/chat.users.readstate.readonly" ] } } } }Replace the following:
-
OAUTH_CLIENT_ID: The client ID you created. -
OAUTH_CLIENT_SECRET: The client secret you created.
-
-
Save
settings.json. -
Start Gemini CLI:
gemini -
In Gemini CLI, authenticate with the MCP server by running the following command:
/mcp auth chat- When prompted, press
1to open an authentication page in your browser. If you're working over SSH, follow the instructions in the CLI. - Sign in to your Google Account.
- Review the requested OAuth scopes and click Allow.
- A message appears confirming authentication was successful.
- When prompted, press
-
In Gemini CLI, run
/mcp listto view your configured MCP servers and their tools.The response is similar to the following:
🟢 chat - Ready (2 tools) Tools: - search_conversations - list_messages
The remote MCP server is ready to use in Gemini CLI.
Claude
To use the Google Chat remote MCP server with Claude.ai or Claude Desktop, you must have the Claude Enterprise, Pro, Max, or Team plan.
To add the Google Chat remote MCP server to Claude, configure a custom connector with an OAuth client ID and secret.
-
Create an OAuth 2.0 client ID and secret:
-
In the Google Cloud console, go to Google Auth Platform > Clients > Create Client
-
Select Web applicationas the application type.
-
Enter a Name.
-
In the Authorized redirect URIssection, click + Add URI, and then add
https://claude.ai/api/mcp/auth_callbackin the URIsfield. -
Click Createand copy your Client IDand Client Secret.
-
-
Configure the MCP server in Claude:
- In Claude.ai or Claude Desktop, go to Settings(or Admin settings) > Connectors.
- Click Add custom connector.
- Enter the connection details for the Google Chat product:
- Server name:
Google Chat. - Remote MCP server URL:
https://chatmcp.googleapis.com/mcp/v1
- Server name:
- In Advanced settings, enter your OAuth client IDand OAuth client secret.
- Click Add.
Others
Many AI applications have ways to connect to a remote MCP server. You typically need to enter details about the server, like its name, endpoints, transport protocol, and authentication method. For the Google Chat remote MCP server, enter the following:
-
Server name:
chat -
Server URL:
https://chatmcp.googleapis.com/mcp/v1 -
Transport: HTTP
-
Authentication: The Google Chat remote MCP server uses OAuth 2.0. For details, see Learn about authentication and authorization .
For more details on connecting different types of clients, see Configure MCP in an AI application .
Test the Google Chat MCP server
After you configure the MCP client, you can verify the connection by running some test prompts.
Try asking your MCP client the following questions:
-
"What was the last message in the 'Project X' space?"
The client finds the space using
search_conversationsand then retrieves messages usinglist_messages.
If the tools execute successfully and you receive relevant responses, your Google Chat MCP server is correctly configured.
Troubleshooting
If you encounter issues connecting to the MCP server, you can check for errors in the OAuth logs. Ask your administrator to check the OAuth log eventsin the security investigation tool .
Tool reference
The following tools are available for the Google Chat MCP server:
-
search_conversations -
list_messages
Important security consideration: Indirect prompt injection
When you expose a language model to untrusted data, there is a risk of an indirect prompt injection attack . Because MCP clients like Gemini CLI have access to powerful tools and APIs through the Google Chat MCP server, they can read, modify, and delete data in your Google Account.
To mitigate these risks, follow these best practices:
- Only use trusted tools.Never connect Google Chat MCP server to untrusted or unverified applications.
- Be cautious with untrusted inputs.Avoid asking your MCP client to process messages or other resources from unverified sources. These inputs may contain hidden instructions that can hijack your session, allowing an attacker to modify, steal, or delete your data.
- Review all actions.Always carefully review the actions taken by your AI client on your behalf to ensure they are correct and align with your intentions.

