Labsco
MCP SERVER

Home Assistant

by voska

Read and change one Home Assistant instance from a chat client — entity states, service calls, history, and Lovelace dashboards that are backed up before every write.

IoT, Smart Home & Embedded HardwareVerified
Summary
Dashboard changes you can preview before saving and undo after, instead of hand-edited YAML.

Every card and view tool accepts a dry run, and a backup is written before each write and listed by id, so reverting is a call rather than a git history you never kept. The read side splits along retention: raw history answers what happened last night, while recorder statistics answer what this cost in January.

What it is

An MCP front end for a single Home Assistant instance, covering entity state and control, the recorder's history and statistics, the error log, and live editing of storage-mode Lovelace dashboards over Home Assistant's WebSocket API.

What you get
  • Entity state on demand, trimmed to the fields you name or returned in full, and on, off or toggle on any entity
  • Four ways to find an entity without knowing its id: by domain, by area name matched case-insensitively, by free-text search, or from a whole-instance overview with per-domain counts and state distributions
  • The low-level route out: call any service in any domain with your own data payload, list every automation, and restart the instance
  • Live Lovelace editing — add, replace, remove and reorder cards, add, update and remove views, and target a section inside a sections-type view — with a dry run available on every write and the change appearing instantly in open browsers
  • A backup written automatically before each dashboard write, listed by id and restorable, where the restore is itself backed up first
  • Two depths of history: raw state changes over the last N hours or an explicit window, and recorder statistics as mean, min and max buckets that outlive the short-term retention window
  • The error log filtered by level, integration, search term or line count, with error and warning counts computed over the filtered output
  • Guided prompts for the recurring jobs, such as walking through creating an automation
Requirements

A Home Assistant instance with a long-lived access token, given as HA_URL and HA_TOKEN, and either Docker — the published image is the recommended path — or Python 3.13 with uv. Getting HA_URL right is the usual first stumble: from a container on the same machine that is host.docker.internal rather than localhost. Saving a dashboard needs an admin token and works only on storage-mode dashboards, so a YAML-mode one stays readable but not writable. Under Docker, the backup directory has to be volume-mounted for backups to survive the container.

Setup effort

One command plus a key — uvx hass-mcp, then supply credentials