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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-chat-mcp-server search my Google Chat messages for "budget" this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Available Tools
5 toolsget_membersA
スペースの参加者(名前・メール・種類・役割)を返す。記録の「参加者」欄に使う。
Args: space: スペースの名前(一部でよい)・URL・ID のどれか。
Inputs: space (required).
get_messagesA
1つのスペースのメッセージを読む。読み取り専用で、既読にもしない。
since を渡すかどうかで、返り値と続きの読み方が変わる。
since あり(記録の続き): since より後のメッセージを、古い順に最大 limit 件返す。 has_more が true なら、まだ新しい分がある → 返り値の next_since をそのまま since に渡して続きを読む。
since なし(最新を見る): 最新の limit 件を、古い順に並べて返す。 has_older が true なら、それより古い分がある → 返り値の older_until をそのまま until に渡して読む (next_since を since に渡しても古い分は読めない)。
記録をとるときは、最後の呼び出しの next_since を記録に残し、次回はそれをそのまま since に渡す。 next_since は小数秒まで正確な値なので、加工せずに渡せば重複も取りこぼしも無く続きから読める。
同じ時刻のメッセージは途中で分けないため、limit を少し超えて返ることがある。
各メッセージ: id・time(日本時間)・sender(名前)・sender_type(HUMAN / BOT)・text・thread。 該当するときだけ is_reply(返信)・edited(編集済み)・attachments(Drive のファイルは drive_file_id)。
Args: space: スペースの名前(一部でよい)・URL・ID(spaces/…)のどれか。DM は相手の名前で指定できる。 since: この時刻より後だけ(例 "2026-11-01"、"2026-11-01T09:00"、または前回の next_since)。 until: この時刻より前だけ(古い分を読むときは older_until を渡す)。 limit: 最大件数(既定 100、上限 500)。 thread: このスレッドだけを読む(メッセージの thread の値)。 include_bots: 既定 true(ボット・アプリの発言も含める)。false にすると除く。記録では既定のままにする。
Inputs: space (required), limit, since, until, +2 more.
get_unreadA
利用者がチャットの画面でまだ開いていない(未読の)メッセージを、スペースごとにまとめて返す。 読むだけで既読にはしない。利用者自身の発言は数えない。
space を指定するとそのスペースだけ。省略すると未読のあるスペースをすべて(最近動いた順)。
注意: 未読は利用者が画面で開いた時点で消える(スマホで開いた分も)。記録の続きの起点には使わず、 記録は get_messages の next_since で続きから読む。未読は「まだ見ていない分の把握」に使う。
人の最後の発言が 90日より前のスペースは調べない(ボットだけが投稿するスペースは space で指定する)。既読の記録が無いスペースは直近 90日分を未読とみなす (どちらも notes に書く)。
truncated が true なら limit で打ち切っている。
Args: space: スペースの名前・URL・ID。省略時は全スペース。 limit: 返すメッセージの合計の最大件数(既定 200)。 include_bots: 既定 true(ボット・アプリの発言も含める)。false にすると除く。
Inputs: limit, space, include_bots.
list_spacesA
参加している Google Chat のスペース(スペース・グループチャット・DM)を、最近動いた順に一覧する。読み取り専用。
DM とグループチャットは相手の名前で表示する(例「DM: 山田 太郎」「グループ: 佐藤、鈴木」)。 last_active は人の最後の発言の時刻で、ボット・アプリの投稿では更新されない。 返り値の space(spaces/…)か名前を、ほかのツールの space 引数に渡す。
Args: space_type: "SPACE"・"GROUP_CHAT"・"DIRECT_MESSAGE" のどれかで絞る。 active_since: この時刻以降に動いたものだけ(例 "2026-11-01"、"2026-11-01T09:00"。時差なしは日本時間)。 name_contains: 名前の一部で絞る(全角半角・大文字小文字を区別しない)。 unread_only: True なら、利用者がチャットの画面でまだ開いていない発言があるスペースだけを、 last_read(既読の時刻)付きで返す。スペースごとに問い合わせるので少し時間がかかる。
Inputs: space_type, unread_only, active_since, name_contains.
search_messagesA
期間を区切って、キーワードでメッセージを探す。Google 側に検索の仕組みが無いため、取得して手元で照合する。
keywords は空白区切りで、すべての語を含むもの(AND)を探す。全角半角・大文字小文字は区別しない。 本文と添付ファイルの名前が対象。
spaces を省略すると、人の最後の発言が期間内にあるスペースを調べる(since の既定は 30日前)。 ボットだけが投稿するスペースは対象から外れるので、探すときは spaces で指定する。 調べなかったスペースの数は notes に書く。
結果は新しい順。truncated が true なら件数上限や走査上限で打ち切っている(理由は truncated_reasons)。 その場合は期間や語で絞って探し直す。
Args: keywords: 探す語(空白区切り)。 spaces: 調べるスペースの名前・URL・ID のリスト。省略時は期間内に動いたスペースすべて。 since: この時刻より後だけ(既定は 30日前)。 until: この時刻より前だけ。 limit: 返すヒットの最大件数(既定 50)。
Inputs: keywords (required), limit, since, until, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear primary role: listing spaces, fetching members, reading messages, keyword search, and unread retrieval. The main overlap is get_unread versus list_spaces with unread_only=true, plus some conceptual overlap between get_messages and search_messages, but descriptions explain the differences well.
All five tools follow a consistent snake_case verb_noun pattern (get_members, list_spaces, get_messages, search_messages, get_unread). The verb choice (get/list/search) matches the read semantics predictably.
Five tools is a well-scoped set for a focused read/record-oriented server, with each tool covering a distinct need (spaces, members, messages, search, unread). No tool feels redundant or vestigial.
The read-only surface is coherent and internally complete (list, read, search, unread, members), with pagination handled well. However, there is no way to send or reply to messages, list threads explicitly, or download attachments, which are gaps for a full Google Chat domain.
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 gradedqualityDmaintenanceEnables reading and searching Google Chat spaces, messages, threads, and members, with optional message sending.MIT
- 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.20140 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