Sponsored by Deepsite.site

Google Home MCP Server

Created By
MCP-Mirrora year ago
Mirror of
Content

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

  1. Google Cloud Project with Smart Home API enabled
  2. Actions on Google Smart Home Action project
  3. OAuth 2.0 Client credentials for Smart Home Action
  4. Node.js 18 or higher
  5. Access to Google Home smart plugs

Setup

  1. 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
  2. Set up OAuth 2.0:

    • Configure your OAuth server endpoints
    • Set up user authentication flow
    • Implement token generation/validation
  3. Install dependencies:

pnpm install
  1. Configure the server:

    • Copy config.json.example to config.json
    • Fill in your:
      • OAuth Client ID
      • OAuth Client Secret
  2. Build the server:

pnpm build
  1. Start the server:
pnpm start

Available Tools

1. List Smart Plugs

{
  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. Control Smart Plug

{
  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. Get Smart Plug State

{
  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 Details

The server implements the Smart Home API intents:

  1. SYNC Intent

    • Called when users link their account
    • Reports available devices and capabilities
    • Handles device discovery
  2. QUERY Intent

    • Reports current state of devices
    • Handles state queries from Google Assistant
    • Returns online/offline status
  3. 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 errors
  • API_ERROR: Errors from Smart Home API
  • DEVICE_NOT_FOUND: Device ID not found in available devices
  • COMMAND_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

  1. Start in development mode:
pnpm dev
  1. Run tests:
pnpm test
  1. Debug logs:
    • All API calls are logged
    • Error details are captured
    • Device state changes are tracked

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT

ghome-mcp-server

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。