MCPSERV.CLUB
allenporter

Home Assistant MCP Server

MCP Server

Integrate Home Assistant with Model Context Protocol for AI assistants

Stale(40)
61stars
1views
Updated 16 days ago

About

A lightweight MCP server that connects Home Assistant to Claude Desktop via a custom component, exposing device data and automations through WebSocket and API tokens. It enables AI assistants to query and control Home Assistant devices seamlessly.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Overview

The mcp-server-home-assistant is a Model Context Protocol (MCP) server that bridges Claude and other AI assistants with Home Assistant, the open‑source home automation platform. By exposing Home Assistant’s entities, services and state updates through MCP, the server lets AI assistants read, interpret and act on smart‑home data without custom code or proprietary APIs. This solves the friction that developers face when trying to give conversational agents control over a home’s devices—each integration typically requires bespoke HTTP requests or WebSocket handling, whereas MCP standardises the interface.

What It Does

  • Contextual awareness – The server streams real‑time state changes (e.g., a light turning on, a door opening) to the AI assistant so that responses can reference current conditions.
  • Command execution – Through MCP tools, the assistant can invoke Home Assistant services (turn lights on/off, set thermostats, trigger automations) using natural language.
  • Entity discovery – The server lists available entities and their attributes, enabling the assistant to ask follow‑up questions or provide suggestions based on what’s actually in the user’s environment.

These capabilities are delivered via a single command‑line executable that connects to Home Assistant’s WebSocket API and translates the data into MCP resources, tools, prompts and sampling endpoints. Developers can then configure Claude Desktop (or any MCP‑compatible client) to launch the server automatically and start interacting with their home devices.

Key Features

  • Real‑time WebSocket integration – Uses Home Assistant’s native WebSocket endpoint for low‑latency updates.
  • Long‑lived access token authentication – Securely authenticates with Home Assistant using a token that can be generated from the user’s account.
  • Extensible via custom components – Relies on a Home Assistant custom component that is moving into the core, ensuring long‑term support and compatibility.
  • Developer-friendly configuration – The server is launched through a simple JSON entry in Claude Desktop’s config, making it easy to add or remove instances.
  • Verbose logging – Provides detailed logs that help diagnose connection issues or verify that commands are being executed.

Use Cases

  • Smart‑home control – Users can ask the assistant to turn on lights, adjust thermostats or check security camera status, and receive instant confirmation.
  • Contextual automation – The assistant can trigger Home Assistant automations based on conversational context (e.g., “When I say ‘good night’, turn off all lights and lock doors”).
  • Home monitoring – Developers can build dashboards or alerts that notify the assistant when critical sensors change state, enabling proactive responses.
  • Educational demos – Showcasing how conversational AI can integrate with IoT ecosystems for students or hobbyists.

Integration Flow

  1. Launch the MCP server – The AI client starts the executable, passing Home Assistant URL and token via environment variables.
  2. Discover resources – The client queries the MCP endpoints to list available entities and services.
  3. Execute commands – When a user requests an action, the assistant calls the corresponding MCP tool which forwards the request to Home Assistant.
  4. Receive updates – Any state changes are pushed back through MCP, keeping the assistant’s context current.

Standout Advantages

  • Unified protocol – By adhering to MCP, the server eliminates the need for multiple adapters or custom wrappers.
  • Low overhead – A single binary handles all communication, reducing runtime complexity for developers.
  • Future‑proofing – With the custom component slated to join Home Assistant Core, the integration will remain supported as the platform evolves.

In summary, mcp-server-home-assistant empowers developers to give AI assistants seamless, real‑time control over Home Assistant environments, turning conversational queries into actionable smart‑home operations with minimal friction.