google-chat-mcp-server
Provides read-only access to Google Chat, allowing agents to list spaces, group chats, and DMs; read and search messages; retrieve space members; and view unread messages without marking them as read.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
google-chat-mcp-server
Minimal read-only Google Chat MCP server for Claude Code.
Claude Code に Google Chat のやりとりを読ませ、把握・記録させるための MCP サーバーです。
読み取り専用のスコープ4つだけを要求します(送信・編集・削除・既読の変更はできません)
外部への送信先は Google の API だけです(第三者のサーバーを経由しません)
ツールは5つ: スペース一覧/メッセージを読む/キーワード検索/参加者/未読
同じ作者の google-sheets-mcp-server(読み取り専用の Sheets MCP)と同じ考え方で作っています。
ツール
ツール | 用途 |
| 参加しているスペース・グループチャット・DM を最近動いた順に一覧。DM は相手の名前で表示 |
| 1つのスペースのメッセージ。最新 N 件、または |
| 期間を区切ったキーワード検索(AND・全角半角を区別しない・添付名も対象) |
| 参加者の名前・メール・種類・役割 |
| まだ画面で開いていない(未読の)メッセージ。既読にはしない |
space には、スペースの名前(一部でよい)・URL・ID(spaces/…)のどれでも渡せます。
Related MCP server: google-chat-mcp
記録のとり方と、未読との使い分け
記録は
next_sinceで続きから読みます。get_messagesの返り値のnext_sinceを記録に残し、次回はそれをsinceに渡すと、重複も取りこぼしもなく続きから読めます(next_sinceは API の時刻そのままで、小数秒まで落としません)。sinceを渡したときのhas_moreがtrueなら、まだ新しい分があります。sinceを渡さずに「最新 N 件」を読んだときは、has_olderとolder_untilを見ます。has_olderがtrueなら、それより古い分があります。older_untilをuntilに渡すと、さらに古い分を読めます。同じ時刻のメッセージは2回の読み取りに分けません(
limitを少し超えることがあります)。未読は「まだ見ていない分の把握」に使います。 未読は、利用者が Chat の画面で開いた時点で(スマホで開いた分も)消えます。記録の続きの起点には使いません。
件数の上限で打ち切ったときは、必ず
has_more/truncated/notesで知らせます。黙って切ることはしません。
セットアップ
1. Google Cloud の準備(Google Workspace のアカウントが必要)
Chat API は Google Workspace のアカウント専用です。
Google Cloud コンソールで、自分の Workspace の組織の中に新しいプロジェクトを作る
「API とサービス」→「ライブラリ」で Google Chat API を有効にする
Google Chat API の 「構成」 タブで、アプリ名・説明を入れ、「インタラクティブ機能を有効にする」をオフにして保存する(読むだけでも、この登録が必要です)
「Google Auth Platform」で同意画面を作る。対象は「内部」 にする
「外部」でテスト中のままだと、ログインが7日で切れます(Google のドキュメント)
「クライアント」→「クライアントを作成」で 「デスクトップ アプリ」 を作る。「このクライアントを AI 搭載エージェントに使用する」にチェックを入れる(MCP 連携向けの自己申告で、権限は増えません。Google のヘルプ)
作成直後の画面で JSON をダウンロードし、次の場所に置く
mkdir -p ~/.config/google-chat-mcp && chmod 700 ~/.config/google-chat-mcp
mv ~/Downloads/client_secret_*.json ~/.config/google-chat-mcp/credentials.json
chmod 600 ~/.config/google-chat-mcp/credentials.json2. インストール
git clone https://github.com/tg-tool/google-chat-mcp-server.git
cd google-chat-mcp-server
python3 -m venv .venv
.venv/bin/pip install -e .3. ログイン(初回のみ)
.venv/bin/python -m google_chat_mcp.authブラウザが開くので、Workspace のアカウントでログインし、表示される読み取りの権限をすべて許可します。トークンは ~/.config/google-chat-mcp/token.json(0600)に保存されます。
4. Claude Code に登録
claude mcp add google-chat-readonly --scope user -- /path/to/google-chat-mcp-server/.venv/bin/python -m google_chat_mcp.server
claude mcp get google-chat-readonly保存先は環境変数 GOOGLE_CHAT_MCP_CREDENTIALS / GOOGLE_CHAT_MCP_TOKEN で変えられます。
セキュリティ
スコープは次の4つだけです。
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/chat.users.readstate.readonly
読み取り専用は三重に担保しています。
要求するスコープが読み取り専用だけ(テストで完全一致を確認)。保存済みのトークンも、スコープがこの4つと完全に一致しなければ使いません
Google の API に触れるのは
src/google_chat_mcp/api.pyの1か所だけで、呼ぶのはlist・get・getSpaceReadStateだけ(テストでソースを走査して確認)Google 側でも、読み取り専用のトークンでの書き込みは拒否される
認証情報とログの扱い
認証情報はローカルの
~/.config/google-chat-mcp/(0600)に置き、git に入れません(.gitignore済み)サーバーのログは WARNING 以上だけで、メッセージの本文やスペース名をログに出しません
読んだ内容の行き先
読んだチャットの内容は、MCP クライアント(Claude)に渡ります。機密の扱いは、利用者の組織の規定に従ってください。
開発
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest -q
.venv/bin/ruff check src testsテストは偽の Chat API(tests/fakes.py)で行い、ネットワークにはつなぎません。
ライセンス
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only Google Ads, GA4 and Search Console data for Claude, with no Google Cloud setup.
Read-only Google Search Console and Google Analytics for AI agents.
Read-only access to your CodeMouse accounts, repositories, and AI pull-request reviews.
Read Spruce Health contacts, conversations, messages, phone lines and team members (read-only).
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 gradedqualityCmaintenanceEnables reading and searching Google Chat spaces, messages, threads, and members, with optional message sending.60 npmMIT
- 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.20406 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables reading, searching, and writing to Google Chat spaces, direct messages, and sidebar through MCP clients such as Claude Code and Claude Desktop.Apache 2.0