MCP server · stdio · npx

Let your agent build your smart home, not just flip its switches.

An MCP server that gives AI agents the Home Assistant admin surface: write and debug automations, rename devices, set up integrations, manage helpers, dashboards and registries — with every tool group behind a feature flag.

  • 216tools
  • 25toolsets you can switch on or off
  • 600+HA commands tracked for drift
agent session

The new WC lamp shows up as "Licht WC". Rename it and tidy up.

list_devices

found "Licht WC" · ZHA · 6 entities

rename_device name_by_user: "Licht Keller WC"

rename_entity ×6

remove_entity light.licht_keller_wc

orphaned template light removed

Done. The device and its six entities are renamed, and the leftover entry is gone.

Install

Two environment variables and you are connected.

It runs locally over stdio through npx. You need Node.js 20+ and a Home Assistant long-lived access token (Profile → Security). No HTTPS endpoint, no port forwarding, no add-on.

Claude Code
claude mcp add homeassistant \
  --env HASS_URL=http://homeassistant.local:8123 \
  --env HASS_TOKEN=your-long-lived-access-token \
  -- npx -y @orellbuehler/homeassistant-mcp
any MCP client (.mcp.json)
{
  "mcpServers": {
    "homeassistant": {
      "command": "npx",
      "args": ["-y", "@orellbuehler/homeassistant-mcp"],
      "env": {
        "HASS_URL": "http://homeassistant.local:8123",
        "HASS_TOKEN": "your-long-lived-access-token"
      }
    }
  }
}

What you can ask

Jobs that used to mean clicking through Settings.

Each of these is a real multi-step task the agent can finish and verify on its own.

Write an automation that closes the blinds when the sun is low and the living room is above 25 °C. list_entities → validate_automation_config → upsert_automation
Why didn't the hallway motion light fire last night? list_traces → get_trace → get_history
The Shelly integration failed to load after the update. What happened? list_config_entries → get_error_log → reload_config_entry
Put every device in the basement on a new "Keller" floor and label the Zigbee ones. create_floor → update_area → update_device
Add a vacation-mode toggle and use it as a condition in my heating automations. create_helper → get_automation_config → upsert_automation
Clean up the entities left over from the integration I removed. list_registry_entities → remove_entity

Comparison

How it differs from Home Assistant's built-in MCP server.

Home Assistant ships its own MCP server integration. It is built for using the home: reading state and calling actions. This project is built for changing how the home is set up. They work well side by side.

Capability Built-in mcp_server homeassistant-mcp
Read states, history, logs, render templates Yes Yes
Call actions and control devices Yesits main purpose Opt-incontrol toolset, off by default
List and reload integrations Yes Yesplus config flows, enable/disable, delete, diagnostics
Write automations, scripts and scenes No Yesvalidated by HA, then reloaded
Debug with automation traces No Yes
Rename, enable, remove entities and devices No Yes
Areas, floors, labels, categories No Yes
Helpers, dashboards, Lovelace resources, blueprints No Yes
Check config, energy dashboard, ZHA groups, HACS No Yes
Limit access to entities exposed to Assist YesDevice control set Nosees what the token's user sees
Choose which tools the agent gets Per tool setplus a read-only mode Per toolset and per toolplus a read-only mode
Connection HTTP at /api/mcp, OAuthClaude Code needs HTTPS Local stdio via npxlong-lived access token

Use the built-in server when…

you want an assistant that operates the home: turn things on, answer "is the garage open", play media — scoped to the entities you expose to voice assistants.

Use homeassistant-mcp when…

you want an agent that maintains the home: authoring automations, fixing integrations, reorganising devices and cleaning up registries. Most of that has no action to call, only an admin API.

Tools

216 tools in 25 toolsets.

Pick a toolset to see what is in it, or search across everything. Toolsets marked opt-in stay off until you name them in HASS_TOOLSETS.

The tool list loads from tools.json. See TOOLS.md for the full reference.

Feature flags

Give the agent exactly the surface you are comfortable with.

Config authoring and inspection are on by default. Device control, raw API passthrough, backups, user management and household lists are opt-in. Three environment variables decide what gets registered.

HASS_TOOLSETS
Comma-separated toolsets. Use default, all, a name to add it, or -name to drop it.
HASS_READ_ONLY
Set to true to remove every tool that changes anything in Home Assistant.
HASS_DISABLED_TOOLS
Comma-separated tool names to hide, whatever toolset they belong to.
examples
# the defaults plus device control
HASS_TOOLSETS=default,control

# everything except the raw passthrough
HASS_TOOLSETS=all,-raw

# a look-but-don't-touch agent
HASS_READ_ONLY=true

# authoring only, and never delete automations
HASS_TOOLSETS=entities,services,templates,automations,trace
HASS_DISABLED_TOOLS=delete_automation

API drift

Checked against every Home Assistant release.

Home Assistant's WebSocket API has no published schema and changes between releases. A scheduled job reads the commands and routes straight out of the Home Assistant source and compares them with what the tools call. The snapshot in this repository currently tracks Home Assistant the latest release.

  1. Extract

    Every WebSocket command, its parameters and every REST route is read from the Home Assistant core source.

  2. Snapshot

    The result is committed as ha-api/snapshot.json, pinned to a Home Assistant version.

  3. Verify

    CI fails if a tool calls a command or route that is not in the snapshot.

  4. Watch

    Weekly, a new release is diffed against the snapshot and a pull request lists what changed and which tools it touches.