Google Chat MCP Server

by chy168

Integrations

  • Provides tools for accessing and interacting with Google Chat spaces and messages, including listing available spaces and retrieving messages with date filtering.

  • Utilizes Google Cloud authentication for OAuth2 credentials required to access Google Chat API.

導入

このプロジェクトは、FastMCPを使用してPythonで記述されたMCP(Model Control Protocol)サーバー向けのGoogle Chat統合を提供します。これにより、MCPツールを介してGoogle Chatのスペースやメッセージにアクセスし、操作できるようになります。

構造

このプロジェクトは、次の 2 つの主要コンポーネントで構成されています。

  1. Google チャット ツールを備えた MCP サーバー: モデル コントロール プロトコルを通じて Google チャットとやり取りするためのツールを提供します。
    • FastMCPによる執筆
    • server.py : Google Chat ツールを使用したメイン MCP サーバーの実装
    • google_chat.py : Google Chat API の統合と認証の処理
  2. 認証サーバー: Google アカウント認証用のスタンドアロン コンポーネント
    • FastAPIによる執筆
    • GoogleとのOAuth2フローを処理
    • アクセストークンを保存および管理します
    • 独立して実行することも、MCP サーバーの一部として実行することもできます。
    • server_auth.py : 認証サーバーの実装

認証フローにより、Google API トークンを取得・更新できます。MCP ツールは、このトークンを使用して Google Chat データにアクセスします。(スペースとメッセージ)

特徴

  • Google Chat API を使用した OAuth2 認証
  • 利用可能な Google Chat スペースの一覧
  • 日付フィルタリングを使用して特定のスペースからメッセージを取得する
  • 簡単にセットアップできるローカル認証サーバー

要件

  • Python 3.8以上
  • Chat API が有効になっている Google Cloud プロジェクト
  • Google Cloud Console からの OAuth2 認証情報

使い方は?

Google OAuthログインの準備

  1. このプロジェクトを複製する
    git clone https://github.com/chy168/google-chat-mcp-server.git cd google-chat-mcp-server
  2. Google Cloud プロジェクト (GCP) を準備する
  3. Google Cloud コンソール ( https://console.cloud.google.com/auth/overview?project=\ <YOUR_PROJECT_NAME>)
  4. Google Auth Platform > クライアント > (+) クライアントの作成 > Web アプリケーション参照: https://developers.google.com/identity/protocols/oauth2/?hl=en承認済みの JavaScript オリジンの追加: http://localhost:8000承認済みのリダイレクト URI: http://localhost:8000/auth/callback
  5. OAuth 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 .
-
security - not tested
F
license - not found
-
quality - not tested

OAuth2 認証を通じて Google Chat のスペースやメッセージにアクセスし、操作するための MCP (Model Control Protocol) ツールを提供します。

  1. Structure
    1. Features
      1. Requirements
        1. How to use?
          1. Prepare Google Oauth Login
          2. Run Auth server and get your Google access token (login google only, not MCP server yet)
          3. MCP Configuration (mcp.json)
          4. Tools
          5. Development and Debug

        Related MCP Servers

        • -
          security
          F
          license
          -
          quality
          A specialized Model Context Protocol (MCP) server that integrates Google services (Gmail, Calendar, etc.) into your AI workflows. This server enables seamless access to Google services through MCP, allowing AI agents to interact with Gmail, Google Calendar, and other Google services.
          Last updated -
          10
          3
          TypeScript
        • -
          security
          F
          license
          -
          quality
          This server provides a standardized framework using the Model Context Protocol (MCP) to seamlessly integrate and manage diverse tools, enabling features like Twitter automation, cryptocurrency updates, and ElizaOS interaction.
          Last updated -
          2
          Python
        • -
          security
          A
          license
          -
          quality
          A secure MCP (Model Context Protocol) server hosted on Google Cloud Run that enables team collaboration by providing authenticated access via Google Cloud IAM, allowing teams to share custom MCP servers over the internet before official MCP authentication is implemented.
          Last updated -
          16
          TypeScript
          MIT License
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that provides seamless integration with Google Workspace, allowing operations with Google Drive, Docs, and Sheets through secure OAuth2 authentication.
          Last updated -
          Python
          MIT License
          • Linux
          • Apple

        View all related MCP servers

        ID: 8bcrxn62bu