Google Home MCP Server

by jmagar
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Implements Smart Home API intents for Google Assistant, handling device discovery, state queries, and command execution for smart home devices.

  • Integrates with Google Cloud Project for enabling the Smart Home API, necessary for the authentication and operation of the Google Home device control.

  • Allows control of Google Home smart plugs, enabling listing of available devices, turning them on/off, and monitoring their real-time status through the Smart Home API.

Google Home MCP 서버

Smart Home API를 통해 Google Home 스마트 플러그를 제어하기 위한 MCP 서버 구현입니다.

특징

  • 사용 가능한 모든 스마트 플러그와 해당 상태를 나열합니다.
  • 스마트 플러그 제어(켜기/끄기)
  • 특정 스마트 플러그의 실시간 상태를 확인하세요
  • 자동 장치 상태 새로 고침
  • 스마트 홈 API를 사용한 OAuth2 인증

필수 조건

  1. 스마트 홈 API가 활성화된 Google Cloud 프로젝트
  2. Google 스마트 홈 액션 프로젝트
  3. 스마트 홈 작업을 위한 OAuth 2.0 클라이언트 자격 증명
  4. Node.js 18 이상
  5. Google Home 스마트 플러그에 액세스

설정

  1. 스마트 홈 작업 만들기:
    • Google 콘솔에서 작업 으로 이동
    • 새 프로젝트를 만듭니다
    • 프로젝트 유형으로 "스마트 홈"을 선택하세요
    • 계정 연결 구성:
      • OAuth 클라이언트 ID
      • OAuth 클라이언트 비밀번호
      • 승인 URL
      • 토큰 URL
  2. OAuth 2.0 설정:
    • OAuth 서버 엔드포인트 구성
    • 사용자 인증 흐름 설정
    • 토큰 생성/검증 구현
  3. 종속성 설치:

지엑스피1

  1. 서버를 구성하세요:
    • config.json.example``config.json 으로 복사합니다.
    • 다음을 입력하세요:
      • OAuth 클라이언트 ID
      • OAuth 클라이언트 비밀번호
  2. 서버를 빌드하세요:
pnpm build
  1. 서버를 시작합니다:
pnpm start

사용 가능한 도구

1. 스마트 플러그 목록

{ name: "list_smart_plugs", description: "List all available smart plugs and their current states", response: Array<{ id: string; name: string; state: { on: boolean; online: boolean; } }> }

2. 스마트 플러그 제어

{ name: "control_smart_plug", description: "Turn a smart plug on or off", parameters: { deviceId: string; // Device ID from list_smart_plugs state: boolean; // true for on, false for off }, response: { success: boolean; device: { id: string; name: string; state: { on: boolean; online: boolean; } } } }

3. 스마트 플러그 상태 확인

{ name: "get_smart_plug_state", description: "Get the current state of a specific smart plug", parameters: { deviceId: string; // Device ID from list_smart_plugs }, response: { id: string; name: string; state: { on: boolean; online: boolean; } } }

API 세부 정보

서버는 스마트 홈 API 인텐트를 구현합니다.

  1. SYNC 인텐트
    • 사용자가 계정을 연결할 때 호출됩니다.
    • 사용 가능한 장치 및 기능을 보고합니다.
    • 장치 검색을 처리합니다
  2. 쿼리 의도
    • 장치의 현재 상태를 보고합니다
    • Google Assistant의 상태 쿼리를 처리합니다.
    • 온라인/오프라인 상태를 반환합니다.
  3. 실행 의도
    • 장치 제어 명령을 처리합니다
    • 켜짐/꺼짐 작업을 실행합니다
    • 명령 성공/실패 보고

오류 처리

서버는 특정 오류 코드를 사용하여 포괄적인 오류 처리를 구현합니다.

  • CONFIG_ERROR : 구성 로딩 또는 검증 오류
  • API_ERROR : 스마트 홈 API 오류
  • DEVICE_NOT_FOUND : 사용 가능한 장치에서 장치 ID를 찾을 수 없습니다.
  • COMMAND_ERROR : 장치 명령 실행 중 오류 발생

각 오류에는 다음이 포함됩니다.

  • 오류 메시지
  • 오류 코드
  • 자세한 오류 정보는 가능한 경우 제공됩니다.

보안

  • OAuth 2.0 인증 흐름
  • 안전한 토큰 처리
  • 요청 검증
  • 명령 권한 부여
  • HTTPS 통신
  • 입력 살균

개발

  1. 개발 모드에서 시작:
pnpm dev
  1. 테스트 실행:
pnpm test
  1. 디버그 로그:
    • 모든 API 호출이 기록됩니다
    • 오류 세부 정보가 캡처됩니다.
    • 장치 상태 변경 사항이 추적됩니다.

기여하다

  1. 저장소를 포크하세요
  2. 기능 브랜치 생성
  3. 변경 사항을 커밋하세요
  4. 지점으로 밀어 넣기
  5. 풀 리퀘스트 만들기

특허

MIT

ghome-mcp-server

-
security - not tested
F
license - not found
-
quality - not tested

OAuth2 인증을 사용하여 Smart Home API를 사용하여 사용자가 Google Home 스마트 플러그를 제어할 수 있도록 하여 실시간 장치 상태 관리 및 제어 작업을 제공합니다.

  1. Features
    1. Prerequisites
      1. Setup
        1. Available Tools
          1. 1. List Smart Plugs
          2. 2. Control Smart Plug
          3. 3. Get Smart Plug State
        2. API Details
          1. Error Handling
            1. Security
              1. Development
                1. Contributing
                  1. License
                    1. ghome-mcp-server
                      ID: 8gner2riks