Skip to main content
Glama

google-chat-mcp

Google Chat 用の MCP サーバー。Claude (Code / Desktop) や任意の MCP クライアントが、スペースの一覧表示、メッセージの読み取り・検索、スレッドとメンバーの取得、そしてオプトインでメッセージの送信を可能にします。

デフォルトでは読み取り専用です。stdio 経由でローカル実行されます。リフレッシュトークンは ~/.google-chat-mcp/ 配下に 0600 で保存されます。

ツール

ツール

入力

備考

list_spaces

type (all/space/group/dm)、query、resolveDmNames、limit

最終アクティビティ順にソート。DM には名前がないため、resolveDmNames を使用(最大40件のルックアップに制限)。

list_messages

space、since、until、limit ≤100、pageToken

新しい順。since/until はサーバー側でフィルタリング。

search_messages

query (部分文字列または /regex/)、spaces?、since、until、limit

クライアント側スキャン。Chat API には全文検索がありません。デフォルトの期間は14日、スペースあたり ≤500 メッセージ。

get_thread

thread

すべての返信を古い順に取得。

list_members

space

ユーザーとロール。名前/メールは People API 経由。

send_message

space、text、thread?

SEND_ENABLED=true の場合のみ登録されます。

送信者名は People API ディレクトリ(directory.readonly)から取得されます。その API が無効またはユーザーが外部の場合は、代わりに users/<id> が返されます。それ以外はすべて正常に動作します。

Related MCP server: google-mcp

セットアップ

Google Workspace アカウントが必要です。コンシューマー向け @gmail.com アカウントは Chat API を呼び出せません(403)。

1. Google Cloud プロジェクト(初回のみ、約10分)

  1. console.cloud.google.com → プロジェクトを作成または選択。

  2. API とサービス → ライブラリ → Google Chat API と People API を有効化。

  3. Google Chat API → 設定 タブ → アプリ名、アバター URL、説明 を入力。インタラクティブ機能は オフ、可視性は自社ドメインに設定。保存。

    注意: このフォームを保存するまで、Chat API は読み取り専用のユーザー認証でも すべての OAuth 呼び出しを 403 で拒否します。

  4. OAuth 同意画面 → 内部 → スコープを追加:

    • https://www.googleapis.com/auth/chat.spaces.readonly

    • https://www.googleapis.com/auth/chat.messages.readonly

    • https://www.googleapis.com/auth/chat.memberships.readonly

    • https://www.googleapis.com/auth/directory.readonly

    • https://www.googleapis.com/auth/chat.messages.create(send_message を使用する場合のみ)

  5. 認証情報 → 認証情報を作成 → OAuth クライアント ID → デスクトップ アプリ → JSON をダウンロード。リポジトリに含めないでください。

2. ログイン

export GOOGLE_CHAT_CLIENT_SECRET_PATH=/path/to/client_secret.json
npx google-chat-mcp login        # browser opens → sign in with your Workspace account
npx google-chat-mcp whoami       # sanity check

3. Claude Code に登録

claude mcp add google-chat \
  -e GOOGLE_CHAT_CLIENT_SECRET_PATH=/path/to/client_secret.json \
  -- npx -y google-chat-mcp

Claude Desktop(claude_desktop_config.json):

{
  "mcpServers": {
    "google-chat": {
      "command": "npx",
      "args": ["-y", "google-chat-mcp"],
      "env": { "GOOGLE_CHAT_CLIENT_SECRET_PATH": "/path/to/client_secret.json" }
    }
  }
}

環境変数

変数

デフォルト

目的

GOOGLE_CHAT_CLIENT_SECRET_PATH

—

デスクトップ OAuth クライアント JSON。macOS では Keychain 項目 jay-google-oauth/client にフォールバック。

GOOGLE_CHAT_TOKEN_PATH

~/.google-chat-mcp/token.json

リフレッシュトークンのキャッシュ。

SEND_ENABLED

false

true にすると send_message が登録され、作成スコープが要求されます。変更後は login を再実行してください。

クォータに関する注意

Chat API: 約60リクエスト/分/ユーザー。スペースとメンバーリストはプロセス内で5分間キャッシュされ、解決済みのユーザー名は ~/.google-chat-mcp/users.json にディスクキャッシュされます。search_messages はコストが高いため、spaces と since で範囲を絞ってください。

開発

pnpm install
pnpm dev login
pnpm typecheck && pnpm lint && pnpm build

Node ≥ 22。TypeScript strict、ESM、tsup ビルド。

ライセンス

MIT

Related MCP Connectors

Related MCP Servers

  • 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.
    34 npm
    Apache 2.0
  • -
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to read and send messages in Google Chat spaces using service account authentication.
    -
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI assistants to work in Google Chat through natural language: find spaces and direct messages, read and send messages, manage threads, reactions, attachments, and memberships while acting as the signed-in user.
    20
    488 npm
    MIT