Home Assistant MCP Server
Provides tools for configuring and maintaining a Home Assistant instance, including managing integrations/config flows, devices, entities, areas, floors and labels, automations, scripts, scenes, helpers, dashboards and blueprints, plus backups, diagnostics, repairs, traces, state inspection, templates, and system-level reload/restart operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Home Assistant MCP Servercreate an automation that turns on the porch light at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Home Assistant MCP Server
An MCP (Model Context Protocol) server for setting up and maintaining Home Assistant with an AI assistant. It adds integrations through config flows, organises devices and entities, builds automations, scripts, scenes, helpers, dashboards and blueprints, fixes repairs, debugs automation traces, and manages backups.
It is aimed at configuration, not day-to-day device control. The generic
call_service tool is off by default.
Features
Registry queries -- list and search devices, entities, areas, floors, and labels
Registry editing -- create/update/delete areas, floors, and labels; rename entities and devices, assign them to areas, attach labels, and hide/disable them
Device control -- call any Home Assistant service to actuate devices (turn lights on/off, set a thermostat, run a script)
Integration management -- list, reload, and enable/disable configured integrations (config entries)
Backups -- list existing backups and create a new full backup
System control -- reload a config domain, restart core (with a config check first), inspect core config, system health, and the available services
Live events -- listen to Home Assistant events for a bounded window (e.g. to watch what a device does)
State inspection -- read entity states, history, logbook entries, error logs, and render Jinja2 templates
Automation management -- full CRUD, toggle, duplicate, and conflict detection for automations; retrieve recent automation traces and build evidence-based diagnoses for failed runs or automations that may not have triggered
Script management -- create, read, update, and delete scripts
Scene management -- create, read, update, and delete scenes
Helper management -- create, update, and delete input helpers (
input_boolean,input_number,input_text,input_select,input_datetime,input_button)Dashboard management -- manage Lovelace dashboards, views, and cards
Blueprint management -- list, import, and create automations or scripts from blueprints
Configuration validation -- validate automation configs, check HA core configuration, and validate YAML syntax
Proactive suggestions -- analyze device coverage, suggest automations, detect conflicts, and suggest dashboard layouts
Guided workflows -- six prompt templates for common tasks like creating automations, building dashboards, and troubleshooting
Integration setup -- start and step through config flows, options flows and subentry flows; handle discovered and ignored flows; delete integrations
Registries -- list, search and edit devices, entities, areas, floors, labels and categories; remove orphaned entities and devices
Automations, scripts, scenes -- full CRUD, validated against Home Assistant before saving, plus conflict detection
Helpers --
input_*,counter,timerandschedule, and config-flow helpers (template, group, utility_meter, ...) via config flowsDashboards and blueprints -- views, cards, blueprint import and instantiation
Diagnostics -- repairs, structured system log, automation/script traces, one-call automation diagnoses combining enabled state, traces, trigger/condition entity history, and matching logbook evidence; discovery of the triggers, conditions and services available for a target
Backups -- list, create, delete, and configure automatic backups
System -- reload domains, restart core after a config check, system health
Guided workflows -- six prompt templates
Tools added in 0.2.0 (config flows, registry removal, categories,
diagnostics, backup configuration, counter/timer/schedule helpers)
are not yet verified against a live Home Assistant.
Related MCP server: Home Assistant MCP Server (HA-mcp)
Security model
MCP clients authenticate with an API key (
Authorization: Bearer <key>). The add-on generates one on first start; the pip version refuses to serve HTTP without one.Confirmation is a server setting (
confirm_mode), never a tool argument, so the model can't skip it.Every tool carries MCP annotations (read-only / destructive), so your client can auto-approve reads and prompt for changes.
read_onlymode exposes only read tools.Shell/Python execution, Supervisor services, stop/restart and recorder purge are blocked in
call_serviceeven when device control is on.
Installation
Home Assistant add-on (recommended)
Settings > Add-ons > Add-on Store, overflow menu (⋮) > Repositories, add
https://github.com/bimo443trimdon/ha-mcp-trace.Install Home Assistant MCP Server and click Start.
Open the MCP Server panel in the sidebar. It shows your API key and ready-to-copy snippets for Claude Code, Claude Desktop, Cursor, VS Code and other clients.
For example, Claude Code:
claude mcp add --transport http --scope user home-assistant http://homeassistant.local:8099/mcp \
--header "Authorization: Bearer <API_KEY>"Claude Desktop (requires Node.js; Settings > Developer > Edit Config):
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://homeassistant.local:8099/mcp",
"--allow-http", "--header", "Authorization:${AUTH_HEADER}"],
"env": { "AUTH_HEADER": "Bearer <API_KEY>" }
}
}
}Claude Desktop's custom connectors can't reach a server on your LAN, so use the config file above. See docs/configuration.md for all clients.
pip install
Requires Python 3.11+ and a long-lived access token.
pip install .
export HA_MCP_HA_URL="http://homeassistant.local:8123"
export HA_MCP_HA_TOKEN="<long-lived-access-token>"
ha-mcp # stdio, for clients that launch the server themselvesFor HTTP, an API key is required:
export HA_MCP_TRANSPORT=http
export HA_MCP_API_KEY="$(python3 -c 'import secrets; print(secrets.token_urlsafe(32))')"
ha-mcp # serves http://127.0.0.1:8099/mcpAutomation debugging
Use get_automation_diagnosis with an automation entity ID such as
automation.garage_door (or its config ID) to gather a bounded set of
recent traces, the current enabled state, recent history for entities
referenced by its triggers and conditions, and matching logbook entries.
The result separates observed facts from hypotheses and includes evidence
sources and timestamps. An empty trace result is not proof that an
automation never ran: Home Assistant retains a limited number of traces,
and entity history cannot verify every trigger type.
Configuration
Variable | Default | Description |
|
| Home Assistant base URL |
| (required) | Long-lived access token |
|
|
|
|
| Bind address for |
|
| Port for |
| (empty) | Required for |
|
| Allow |
|
|
|
|
| Only expose read-only tools |
|
| Expose |
|
| Logging level |
Documentation
Configuration -- environment variables, transport options, and client setup
Tools reference -- all MCP tools with parameters and descriptions
Prompts reference -- guided workflow templates
Architecture -- project structure, module design, and extension guide
License
See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
1Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
Set up and run an in-product AI assistant: widgets, knowledge, MCP connections, usage.
Connect AI assistants to explicitly paired computers, servers, and VMs for permitted remote actions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive control and monitoring of Home Assistant smart home devices, automations, scenes, and system management through AI assistants. Supports lights, climate, media players, notifications, history tracking, and advanced automation workflows.3 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with Home Assistant to control smart home devices, query entity states, and manage automations using natural language. It provides over 90 tools for comprehensive system management, including dashboard configuration, service execution, and automation debugging.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control Home Assistant via natural language, including device control, automation management, and system monitoring.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to inspect devices and automation rules, preview and apply changes, create backups, compare snapshots, and restore rules on a local MiJia gateway, with writes requiring confirmation.MIT