🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

google-chat-mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-chat-mcp

MCP server for Google Chat — spaces, messages, members, reactions, attachments

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

google-chat-mcp

MCP server for Google Chat — manage spaces, messages, members, reactions, attachments, and GIFs through the Model Context Protocol.

Features

  • 19 MCP tools covering the full Google Chat API
  • Spaces — list, get, create, update, delete
  • Messages — list (newest first), get, send, reply to threads, update, delete
  • Members — list, add, remove, get user info
  • Reactions — add, remove
  • Attachments — get metadata, upload files with messages
  • Two transports — stdio and HTTP/SSE
  • Automatic OAuth — browser-based flow, token caching + auto-refresh
  • Smart formatting — concise human-readable responses, automatic user name resolution

Setup

1. Google Cloud Project & Chat API Setup

Create Project & Enable API

  • Go to Google Cloud Console
  • Create a new project (or select existing)
  • Go to APIs & Services > Library
  • Search for "Google Chat API" and click Enable

Configure the Chat App

This step is required — without it, the Chat API won't work.

  • After enabling the Google Chat API, click on it to open its settings
  • Go to the Configuration tab
  • Fill in the following:
    • App name — give it a name (e.g. "Chat MCP Assistant")
    • Avatar URL — optional, any image URL for the app icon
    • Description — a short description (e.g. "MCP server for Google Chat")
    • Enable Interactive features — toggle ON
    • Functionality — check "Receive 1:1 messages" and "Join spaces and group conversations"
    • Connection settings — select "Apps Script project" (this won't actually be used, but a selection is required)
    • Visibility — choose who can use the app:
      • For personal use: select your own account
      • For team use: select your Google Workspace domain
  • Click Save

Create OAuth Credentials

  • Go to APIs & Services > Credentials
  • Click Create Credentials > OAuth client ID
  • If prompted, configure the OAuth consent screen first:
    • Choose Internal (for Workspace) or External (for personal Gmail)
    • Fill in app name and your email
    • Add these scopes: chat.spaces, chat.messages, chat.memberships, chat.messages.reactions, userinfo.profile, directory.readonly
    • Save and continue through the remaining steps
  • Back on Credentials, click Create Credentials > OAuth client ID
  • Choose Desktop app or Web application
    • If Web application: add http://localhost:18273/auth/callback as an authorized redirect URI (or any http://localhost:{port}/{path} — the server reads it from your credentials file)
    • If Desktop app: no redirect URI needed
  • Download the JSON and save it as credentials.json

2. Install & Run

# Run directly with npx (no install needed)
npx google-chat-mcp --credentials-path ./credentials.json

# Or install globally
npm install -g google-chat-mcp
google-chat-mcp --credentials-path ./credentials.json

# HTTP/SSE transport
npx google-chat-mcp --transport http --port 3000 --credentials-path ./credentials.json

On first run, your browser will open for Google authentication. Approve access and the token is cached automatically.

3. Connect to AI Agents

Claude Code (CLI)

claude mcp add google-chat -- npx google-chat-mcp --credentials-path /absolute/path/to/credentials.json

Add -s user to make it available across all projects:

claude mcp add google-chat -s user -- npx google-chat-mcp --credentials-path /absolute/path/to/credentials.json

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "google-chat": {
      "command": "npx",
      "args": [
        "google-chat-mcp",
        "--credentials-path",
        "/absolute/path/to/credentials.json"
      ]
    }
  }
}

Cursor

Add to Cursor's MCP settings (Settings > MCP Servers):

{
  "google-chat": {
    "command": "npx",
    "args": [
      "google-chat-mcp",
      "--credentials-path",
      "/absolute/path/to/credentials.json"
    ]
  }
}

Windsurf / Continue / Other MCP Clients

Any MCP client that supports stdio transport can connect. Use:

  • Command: npx
  • Args: google-chat-mcp --credentials-path /absolute/path/to/credentials.json

For HTTP/SSE clients, run with --transport http --port 3000 and connect to http://localhost:3000/sse.

CLI Options

FlagDefaultDescription
--transportstdioTransport mode: stdio or http
--port3000Port for HTTP transport
--credentials-path./credentials.jsonPath to OAuth credentials file
--token-path./token.jsonPath to stored token
--disable-token-savingfalseDon't persist tokens to disk

Tools

Spaces

ToolDescription
list_spacesList all accessible spaces (concise format, configurable pageSize)
get_spaceGet full details of a specific space
create_spaceCreate a new space
update_spaceUpdate space display name or description
delete_spaceDelete a space

Messages

ToolDescription
list_messagesList messages newest-first with sender names resolved. Supports date filtering (local timezone) and pageSize
get_messageGet a specific message with sender name resolved
send_messageSend a text message to a space
reply_to_threadReply to an existing thread
update_messageUpdate a message's text
delete_messageDelete a message

Members

ToolDescription
list_membersList members with display names resolved
add_memberAdd a user to a space
remove_memberRemove a member from a space
get_user_infoLook up a user's display name, email, and photo

Reactions

ToolDescription
add_reactionAdd an emoji reaction to a message
remove_reactionRemove a reaction

Attachments

ToolDescription
get_attachmentGet attachment metadata and download URL
upload_attachmentUpload a file and send it as a message

OAuth Scopes

The server requests these Google OAuth scopes:

  • chat.spaces — read/write spaces
  • chat.messages — read/write messages
  • chat.memberships — read/write memberships
  • chat.messages.reactions — read/write reactions
  • userinfo.profile — authenticated user profile
  • directory.readonly — workspace user directory (for name resolution)

Troubleshooting

redirect_uri_mismatch error

Your OAuth credentials have a registered redirect URI that doesn't match. The server reads the redirect URI from your credentials.json automatically. Make sure the URI registered in Google Cloud Console matches what's in the file.

User names showing as users/123456...

The People API may not resolve names depending on your Google Workspace privacy settings. The server caches display names from Chat API responses (members, message senders) as a fallback.

Token expired

Delete your token.json file and restart — the browser auth flow will re-trigger.

Development

npm install
npm run build
npm test

License

MIT

Keywords

mcp

FAQs

Package last updated on 29 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts