homeassistant-mcp
Wraps the Home Assistant REST API to expose home automation capabilities as tools, letting clients control and inspect a Home Assistant instance. Beyond REST-backed control, it carries a WebSocket client for operations REST cannot do: person management (listing, creating, updating, deleting persons and binding existing device_trackers) and registry management — reading config/entity/device/area registries (including area_id, disabled_by, unique_id, config_entry_id), renaming entities, areas and devices, assigning entities and devices to areas, disabling entities, creating/renaming areas, and deleting config entry duplicates (dry-run until confirmed, with reference checks that refuse renames breaking automations, scripts, scenes and dashboards). Write and destructive operations are held behind fail-closed feature flags and audit logging.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
homeassistant-mcp
MCP server wrapping the Home Assistant REST API. Exposes home automation capabilities as MCP tools for use with Claude Code, Open WebUI, and other MCP-compatible clients.
Setup
uv sync
cp .env.example .env
# Edit .env with your HA_URL and HA_TOKENRelated MCP server: homeassistant-gateway
Usage
# stdio mode (Claude Code)
uv run homeassistant-mcp
# HTTP mode (remote clients)
HA_TRANSPORT=http uv run homeassistant-mcpHTTP mode validates the Cloudflare Access JWT and fails closed: startup errors unless
these are set (placeholders shown), or HA_REQUIRE_ACCESS_JWT=false:
HA_ACCESS_AUD=<your-access-aud>
HA_ACCESS_TEAM_DOMAIN=<your-team>.cloudflareaccess.com
HA_ACCESS_ALLOWED_EMAILS=you@example.com,alt@example.com # optional; empty by defaultFor public exposure to the Claude app (Cloudflare Tunnel + Access Managed OAuth), see docs/cloudflare-access.md.
Person management (WebSocket write path)
Most tools wrap HA's REST API, but REST cannot mutate the registry. Creating a
person and binding device_trackers is a storage-collection op HA exposes only over
its WebSocket API (/api/websocket), so the server also carries a small
WebSocket client (ha_ws.py) that opens a fresh connection per config operation.
Tools: ha_list_persons (read, ungated), ha_create_person, ha_update_person,
ha_delete_person. The write ops require an admin HA token, are gated by
HA_PERSON_WRITES_ENABLED (a fail-closed kill switch), and are audit-logged; delete
additionally requires confirm=True. Provide a dedicated admin token via
HA_WS_TOKEN to keep it distinct from the read/control HA_TOKEN. These tools bind
existing device_trackers — the tracker source (Companion app / router integration)
must already exist.
Registry management (WebSocket write path)
The same WebSocket client backs the registry tools — reads that REST cannot do
(area_id, disabled_by, unique_id, config_entry_id) and the writes REST cannot
do at all. See docs/registry-write-tools.md.
Reads (ungated): ha_list_config_entries (finds duplicate integrations),
ha_get_registry (entity/device/area registry; the only source of area_id).
Writes (gated by HA_REGISTRY_WRITE_ENABLED, audit-logged, admin token required):
ha_rename_entity, ha_assign_entity_area, ha_disable_entity, ha_create_area,
ha_rename_area, ha_assign_device_area, ha_rename_device.
Destructive (double-gated): ha_delete_config_entry removes an integration instance
and every entity and device it owns. It needs HA_REGISTRY_DESTRUCTIVE_ENABLED on top
of the write gate, and is dry-run until confirm=True — the unconfirmed call
reports exactly which entities and devices would go, so you can check you have the
duplicate and not the original. Devices shared with another config entry survive and
are reported separately.
Unlike HA_PERSON_WRITES_ENABLED, this gate defaults off — a registry change can
break references system-wide. In particular, changing an entity's entity_id (as
opposed to its display name) breaks every automation, script, scene, and dashboard
referencing the old id, because HA does not rewrite them. ha_rename_entity
reference-checks via HA's search/related and refuses when it finds any, listing
them; it also refuses if the check itself cannot run. force=True overrides.
Deployment
A push to main that passes CI is built and published as a public image,
ghcr.io/chaosbit-dev/homeassistant-mcp, signed keyless with Sigstore and carrying
an SBOM and build provenance attestation (.github/workflows/build-push.yml says how
to verify them). Tags: latest, the commit SHA, and a sortable
main-<sha7>-<unixts>.
The author runs it on Kubernetes with Flux image automation picking up the newest sortable tag; those manifests live in a separate infrastructure repo.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Supervised API-write gateway for AI agents with policy, human approval and execution receipts.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Read-only gateway for durable agent identity, consent, recognized work, and signed receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAccess Home Assistant data and control devices (lights, switches, thermostats, etc).574Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables secure, auditable access to Home Assistant through MCP, with a read-only observer profile and an operator profile for controlled mutations.2MIT
- AlicenseNot gradedqualityAmaintenanceProvides secure, read-only semantic access to Home Assistant entities, areas, floors, and domain summaries for MCP clients like ChatGPT and Codex.MIT
- AlicenseAqualityBmaintenanceEnables controlling Home Assistant from an MCP client, allowing users to read device states, call services, and run configuration commands via REST and WebSocket.5MIT