google-chat-mcp
google-chat-mcp
Google Chat 用の MCP サーバー。Claude (Code / Desktop) や任意の MCP クライアントが、スペースの一覧表示、メッセージの読み取り・検索、スレッドとメンバーの取得、そしてオプトインでメッセージの送信を可能にします。
デフォルトでは読み取り専用です。stdio 経由でローカル実行されます。リフレッシュトークンは ~/.google-chat-mcp/ 配下に 0600 で保存されます。
ツール
ツール | 入力 | 備考 |
|
| 最終アクティビティ順にソート。DM には名前がないため、 |
|
| 新しい順。 |
|
| クライアント側スキャン。Chat API には全文検索がありません。デフォルトの期間は14日、スペースあたり ≤500 メッセージ。 |
|
| すべての返信を古い順に取得。 |
|
| ユーザーとロール。名前/メールは People API 経由。 |
|
|
|
送信者名は People API ディレクトリ(directory.readonly)から取得されます。その API が無効またはユーザーが外部の場合は、代わりに users/<id> が返されます。それ以外はすべて正常に動作します。
Related MCP server: google-mcp
セットアップ
Google Workspace アカウントが必要です。コンシューマー向け @gmail.com アカウントは Chat API を呼び出せません(403)。
1. Google Cloud プロジェクト(初回のみ、約10分)
console.cloud.google.com → プロジェクトを作成または選択。
API とサービス → ライブラリ → Google Chat API と People API を有効化。
Google Chat API → 設定 タブ → アプリ名、アバター URL、説明 を入力。インタラクティブ機能は オフ、可視性は自社ドメインに設定。保存。
注意: このフォームを保存するまで、Chat API は読み取り専用のユーザー認証でも すべての OAuth 呼び出しを
403で拒否します。OAuth 同意画面 → 内部 → スコープを追加:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.messages.readonlyhttps://www.googleapis.com/auth/chat.memberships.readonlyhttps://www.googleapis.com/auth/directory.readonlyhttps://www.googleapis.com/auth/chat.messages.create(send_messageを使用する場合のみ)
認証情報 → 認証情報を作成 → 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 check3. Claude Code に登録
claude mcp add google-chat \
-e GOOGLE_CHAT_CLIENT_SECRET_PATH=/path/to/client_secret.json \
-- npx -y google-chat-mcpClaude 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" }
}
}
}環境変数
変数 | デフォルト | 目的 |
| — | デスクトップ OAuth クライアント JSON。macOS では Keychain 項目 |
|
| リフレッシュトークンのキャッシュ。 |
|
|
|
クォータに関する注意
Chat API: 約60リクエスト/分/ユーザー。スペースとメンバーリストはプロセス内で5分間キャッシュされ、解決済みのユーザー名は ~/.google-chat-mcp/users.json にディスクキャッシュされます。search_messages はコストが高いため、spaces と since で範囲を絞ってください。
開発
pnpm install
pnpm dev login
pnpm typecheck && pnpm lint && pnpm buildNode ≥ 22。TypeScript strict、ESM、tsup ビルド。
ライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Workspace messaging: conversations, contacts, agents, and connected lines through scoped OAuth.
Read email/chat conversations, messages, contacts and teams; draft, send and update threads.
Read Spruce Health contacts, conversations, messages, phone lines and team members (read-only).
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceConnects Claude to Google Chat for searching messages, spaces, and DMs, automatically resolving user IDs to real display names.MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Chat through MCP, allowing listing spaces and messages, searching messages, and sending messages. Supports local and remote transports.34 npmApache 2.0
- -licenseNot gradedqualityDmaintenanceEnables AI assistants to read and send messages in Google Chat spaces using service account authentication.-
- AlicenseAqualityBmaintenanceEnables 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.20488 npmMIT