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(모델 제어 프로토콜) 서버용 Google Chat 통합 기능을 제공합니다. MCP 도구를 통해 Google Chat 공간 및 메시지에 접근하고 상호작용할 수 있습니다.

구조

이 프로젝트는 두 가지 주요 구성 요소로 구성됩니다.

  1. Google Chat 도구가 포함된 MCP 서버 : 모델 제어 프로토콜을 통해 Google Chat과 상호 작용하기 위한 도구를 제공합니다.
    • 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 공간 나열
  • 날짜 필터링을 사용하여 특정 공간에서 메시지 검색
  • 간편한 설정을 위한 로컬 인증 서버

요구 사항

  • 파이썬 3.8 이상
  • Chat API가 활성화된 Google Cloud 프로젝트
  • Google Cloud Console의 OAuth2 자격 증명

어떻게 사용하나요?

Google Oauth 로그인 준비

  1. 이 프로젝트를 복제하세요지엑스피1
  2. Google Cloud 프로젝트(GCP) 준비
  3. Google Cloud 콘솔( https://console.cloud.google.com/auth/overview?project=\ <YOUR_PROJECT_NAME>)
  4. Google Auth Platform > 클라이언트 > (+) 클라이언트 생성 > 웹 애플리케이션 참조: https://developers.google.com/identity/protocols/oauth2/?hl=en 승인된 JavaScript 원본 추가: http://localhost:8000 승인된 리디렉션 URI: http://localhost:8000/auth/callback
  5. OAuth 2.0 클라이언트를 생성한 후 클라이언트 시크릿을 .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(모델 제어 프로토콜) 도구를 제공합니다.

  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