Home Assistant MCP Server

Interact with Home Assistant to control smart home devices, query states, manage automations, and troubleshoot your smart home setup.

Local serverstdioPython

What is the Home Assistant MCP server?

Home Assistant becomes available to MCP clients through the home assistant mcp server. Interact with Home Assistant to control smart home devices, query states, manage automations, and troubleshoot your smart home setup.

What Home Assistant does

A Model Context Protocol (MCP) server for Home Assistant integration with Claude and other LLMs.

Hass-MCP enables AI assistants like Claude to interact directly with your Home Assistant instance, allowing them to:

Key capabilities

  • Entity Management — Get states, control devices, and search for entities
  • Domain Summaries — Get high-level information about entity types
  • Automation Support — List and control automations
  • Guided Conversations — Use prompts for common tasks like creating automations
  • Smart Search — Find entities by name, type, or state
  • Token Efficiency — Lean JSON responses to minimize token usage

Tools it exposes

Once connected, the assistant can call these 14 tools directly:

  • get_version — Get the Home Assistant version
  • get_entity — Get the state of a specific entity with optional field filtering
  • entity_action — Perform actions on entities (turn on, off, toggle)
  • list_entities — Get a list of entities with optional domain filtering and search
  • search_entities_tool — Search for entities matching a query
  • domain_summary_tool — Get a summary of a domain's entities
  • list_automations — Get a list of all automations
  • call_service_tool — Call any Home Assistant service
  • restart_ha — Restart Home Assistant
  • get_history — Get the state history of an entity (last N hours)
  • get_history_range — Get state-change history for an entity over an
  • get_statistics — Get long-term aggregated statistics (mean / min / max
  • get_statistics_range — Same, but for an explicit date/time range —
  • get_error_log — Get the Home Assistant error log, with optional

Installing the home assistant mcp server

The server is distributed via PyPI as hass-mcp, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.

Configuration

Before the server will start you need to supply 3 environment variables: HA_URL, HA_TOKEN, YOUR_LONG_LIVED_TOKEN. Keep credentials in your client's env block or a secrets manager rather than committing them.

Requirements

  • Home Assistant instance with Long-Lived Access Token - One of the following: - Docker (recommended) - Python 3.13+ and uv

Where it fits

Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Home Assistant sits in that group, and the shape of its toolset — get_version, get_entity, entity_action among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • It will not start until its required credentials are present, so set those before wondering why the tools never appear.
  • With 14 tools exposed, expect a noticeable bump in prompt size — disable it in projects that never use Home Assistant.
  • Written in Python.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the home assistant mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Available tools

ToolWhat it does
get_versionGet the Home Assistant version
get_entityGet the state of a specific entity with optional field filtering
entity_actionPerform actions on entities (turn on, off, toggle)
list_entitiesGet a list of entities with optional domain filtering and search
search_entities_toolSearch for entities matching a query
domain_summary_toolGet a summary of a domain's entities
list_automationsGet a list of all automations
call_service_toolCall any Home Assistant service
restart_haRestart Home Assistant
get_historyGet the state history of an entity (last N hours)
get_history_rangeGet state-change history for an entity over an
get_statisticsGet long-term aggregated statistics (mean / min / max
get_statistics_rangeSame, but for an explicit date/time range —
get_error_logGet the Home Assistant error log, with optional

How to install the Home Assistant MCP server

{
  "mcpServers": {
    "hass": {
      "command": "uvx",
      "args": ["hass-mcp"],
      "env": {
        "HA_URL": "your-value",
        "HA_TOKEN": "your-value",
        "YOUR_LONG_LIVED_TOKEN": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Home Assistant instance with Long-Lived Access Token - One of the following: - Docker (recommended) - Python 3.13+ and uv
VariableDescriptionRequired
HA_URLEndpoint or connection string the server talks to.Yes
HA_TOKENCredential the server authenticates with.Yes
YOUR_LONG_LIVED_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • Use Home Assistant to get version.
  • Use Home Assistant to get entity.
  • Use Home Assistant to entity action.

Frequently asked questions

It connects Home Assistant to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (get_version, get_entity, entity_action, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Home Assistant directly.