Google Chat MCP Server
導入
このプロジェクトは、FastMCPを使用してPythonで記述されたMCP(Model Control Protocol)サーバー向けのGoogle Chat統合を提供します。これにより、MCPツールを介してGoogle Chatのスペースやメッセージにアクセスし、操作できるようになります。
構造
このプロジェクトは、次の 2 つの主要コンポーネントで構成されています。
Google チャット ツールを備えた MCP サーバー: モデル コントロール プロトコルを通じて Google チャットとやり取りするためのツールを提供します。
FastMCPによる執筆
server.py: Google Chat ツールを使用したメイン MCP サーバーの実装google_chat.py: Google Chat API の統合と認証の処理
認証サーバー: Google アカウント認証用のスタンドアロン コンポーネント
FastAPIによる執筆
GoogleとのOAuth2フローを処理
アクセストークンを保存および管理します
独立して実行することも、MCP サーバーの一部として実行することもできます。
server_auth.py: 認証サーバーの実装
認証フローにより、Google API トークンを取得・更新できます。MCP ツールは、このトークンを使用して Google Chat データにアクセスします。(スペースとメッセージ)
Related MCP server: google-chat-mcp
特徴
Google Chat API を使用した OAuth2 認証
利用可能な Google Chat スペースの一覧
日付フィルタリングを使用して特定のスペースからメッセージを取得する
簡単にセットアップできるローカル認証サーバー
要件
Python 3.8以上
Chat API が有効になっている Google Cloud プロジェクト
Google Cloud Console からの OAuth2 認証情報
使い方は?
Google OAuthログインの準備
このプロジェクトを複製する
git clone https://github.com/chy168/google-chat-mcp-server.git cd google-chat-mcp-serverGoogle Cloud プロジェクト (GCP) を準備する
Google Cloud コンソール ( https://console.cloud.google.com/auth/overview?project=\ <YOUR_PROJECT_NAME>)
Google Auth Platform > クライアント > (+) クライアントの作成 > Web アプリケーション参照: https://developers.google.com/identity/protocols/oauth2/?hl=en承認済みの JavaScript オリジンの追加:
http://localhost:8000承認済みのリダイレクト URI:http://localhost:8000/auth/callbackOAuth 2.0クライアント
credentials.json作成したら、クライアントシークレットを.jsonファイルとしてダウンロードします。credentials.jsonとしてプロジェクトの最上位に保存します。
認証サーバーを実行し、Google アクセス トークンを取得します (Google のみにログインし、MCP サーバーにはまだログインしません)
python server.py -local-auth --port 8000ブラウザでhttp://localhost:8000/authを開きます。
ログインしてください!
ログイン後、アクセストークンは
token.jsonとして保存されます。
MCP 構成 (mcp.json)
{
"mcpServers": {
"google_chat": {
"command": "uv",
"args": [
"--directory",
"<YOUR_REPO_PATH>/google-chat-mcp-server",
"run",
"server.py",
"--token-path",
"<YOUR_REPO_PATH>/google-chat-mcp-server/token.json"
]
}
}ツール
MCP サーバーは次のツールを提供します。
Google チャットツール
get_chat_spaces()- ボットがアクセスできるすべての Google Chat スペースを一覧表示しますget_space_messages(space_name: str, start_date: str, end_date: str = None)- 特定の Google Chat スペースからのメッセージを、オプションの時間フィルタリング付きで一覧表示します。
開発とデバッグ
fastmcp dev server.py --with-editable .Available Tools
5 toolsaddC
Add two numbers
Inputs: a (required), b (required).
fetch_weatherB
Fetch current weather for a city
Inputs: city (required).
get_chat_spacesA
List all Google Chat spaces the bot has access to.
This tool requires OAuth authentication. On first run, it will open a browser window for you to log in with your Google account. Make sure you have credentials.json downloaded from Google Cloud Console in the current directory.
Inputs: no named parameters.
get_ip_my_addressC
Get IP address from outian.net
Inputs: city (required).
get_space_messagesA
List messages from a specific Google Chat space with optional time filtering.
This tool requires OAuth authentication. The space_name should be in the format 'spaces/your_space_id'. Dates should be in YYYY-MM-DD format (e.g., '2024-03-22').
When only start_date is provided, it will query messages for that entire day. When both dates are provided, it will query messages from start_date 00:00:00Z to end_date 23:59:59Z.
Args: space_name: The name/identifier of the space to fetch messages from start_date: Required start date in YYYY-MM-DD format end_date: Optional end date in YYYY-MM-DD format
Returns: List of message objects from the space matching the time criteria
Raises: ValueError: If the date format is invalid or dates are in wrong order
Inputs: space_name (required), start_date (required), end_date.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The tool set has significant ambiguity issues. 'add' (math operation) and 'fetch_weather' (weather API) are completely unrelated to the Google Chat domain suggested by the server name and other tools. 'get_ip_my_address' is another unrelated utility. Only 'get_chat_spaces' and 'get_space_messages' clearly belong to the Google Chat domain, creating confusion about the server's actual purpose.
Naming conventions are inconsistent across the tool set. 'add' uses a simple verb, 'fetch_weather' uses verb_noun, 'get_chat_spaces' and 'get_space_messages' use get_noun_noun pattern, and 'get_ip_my_address' mixes get_noun_adjective_noun. There's no coherent naming strategy, with tools using different verb styles and structural patterns.
With only 5 tools, the count seems reasonable at first, but the content mismatch makes it inappropriate. For a 'Google Chat MCP Server', having only 2 actual Google Chat tools alongside 3 unrelated utilities creates a poorly scoped tool set. The server name suggests a focused domain, but the tools deliver a scattered collection.
For a Google Chat server, the coverage is severely incomplete. While 'get_chat_spaces' and 'get_space_messages' provide read access, there are no tools for creating messages, updating content, managing memberships, or other essential chat operations. The inclusion of unrelated tools (add, fetch_weather, get_ip) further dilutes the domain coverage, creating significant gaps in the expected functionality.
Maintenance
Related MCP Connectors
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
Unofficial Confluence MCP — wraps the Confluence Cloud REST API v2 (OAuth)
Appreciate teammates, celebrate milestones, and run workspace ops from MCP clients via OAuth.
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables interaction with Google Chat via MCP using the internal Dynamite API, allowing listing spaces, reading and sending messages, and managing DMs. No Google Cloud Console setup required.13MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Google Chat that enables managing spaces, messages, members, reactions, attachments, and GIFs through the Model Context Protocol.35 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Chat through MCP, allowing listing spaces and messages, searching messages, and sending messages. Supports local and remote transports.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Workspace (Drive, Docs, Sheets, Gmail) via MCP tools, using OAuth credentials stored locally or inline.-