Google Home MCP Server
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 Server
An MCP server implementation for controlling Google Home smart plugs through the Smart Home API.
Features
- List all available smart plugs and their states
- Control smart plugs (turn on/off)
- Get real-time state of specific smart plugs
- Automatic device state refresh
- OAuth2 authentication with Smart Home API
Prerequisites
- Google Cloud Project with Smart Home API enabled
- Actions on Google Smart Home Action project
- OAuth 2.0 Client credentials for Smart Home Action
- Node.js 18 or higher
- Access to Google Home smart plugs
Setup
- Create a Smart Home Action:
- Go to Actions on Google Console
- Create a new project
- Choose "Smart Home" as the project type
- Configure Account Linking:
- OAuth Client ID
- OAuth Client Secret
- Authorization URL
- Token URL
- Set up OAuth 2.0:
- Configure your OAuth server endpoints
- Set up user authentication flow
- Implement token generation/validation
- Install dependencies:
- Configure the server:
- Copy
config.json.example
toconfig.json
- Fill in your:
- OAuth Client ID
- OAuth Client Secret
- Copy
- Build the server:
- Start the server:
Available Tools
1. List Smart Plugs
2. Control Smart Plug
3. Get Smart Plug State
API Details
The server implements the Smart Home API intents:
- SYNC Intent
- Called when users link their account
- Reports available devices and capabilities
- Handles device discovery
- QUERY Intent
- Reports current state of devices
- Handles state queries from Google Assistant
- Returns online/offline status
- EXECUTE Intent
- Handles device control commands
- Executes on/off operations
- Reports command success/failure
Error Handling
The server implements comprehensive error handling with specific error codes:
CONFIG_ERROR
: Configuration loading or validation errorsAPI_ERROR
: Errors from Smart Home APIDEVICE_NOT_FOUND
: Device ID not found in available devicesCOMMAND_ERROR
: Error executing device command
Each error includes:
- Error message
- Error code
- Detailed error information when available
Security
- OAuth 2.0 authentication flow
- Secure token handling
- Request validation
- Command authorization
- HTTPS communication
- Input sanitization
Development
- Start in development mode:
- Run tests:
- Debug logs:
- All API calls are logged
- Error details are captured
- Device state changes are tracked
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT
ghome-mcp-server
This server cannot be installed
Enables users to control Google Home smart plugs using the Smart Home API with OAuth2 authentication, offering real-time device state management and control operations.
- Features
- Prerequisites
- Setup
- Available Tools
- API Details
- Error Handling
- Security
- Development
- Contributing
- License
- ghome-mcp-server