hass-mcp
Allows controlling and querying Home Assistant, including getting entity states, listing all states, and calling any service via the Home Assistant REST API.
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., "@hass-mcp turn on the living room light"
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.
hass-mcp
An open-source MCP server for controlling and querying Home Assistant.
Transport: stdio
Auth: Home Assistant long-lived token
API: Home Assistant REST API
Features
Tools exposed:
ha_get_state— get state for an entityha_list_states— list all states (can be large)ha_call_service— call any service
Related MCP server: ha-mcp
Install
pnpm install
pnpm buildRun
export HASS_URL="http://homeassistant.local:8123"
export HASS_TOKEN="<your long-lived access token>"
pnpm startConfigure in an MCP client
Example (conceptual):
{
"mcpServers": {
"homeassistant": {
"command": "npx",
"args": ["-y", "hass-mcp"],
"env": {
"HASS_URL": "http://homeassistant.local:8123",
"HASS_TOKEN": "..."
}
}
}
}Security
Treat tokens as secrets.
Prefer running this server on the same LAN as Home Assistant.
If your HA is behind Cloudflare Access, run this MCP server on the LAN side.
License
MIT
Available Tools
16 toolsha_area_lights_offA
Turn off all lights in an area (by area_id).
Inputs: area_id (required), transition.
ha_area_lights_onA
Turn on all lights in an area (by area_id).
Inputs: area_id (required), brightness_pct, transition.
ha_call_serviceC
Call a Home Assistant service (domain/service) with data payload.
Inputs: domain (required), service (required), data.
ha_get_error_logsB
Fetch the latest Home Assistant error logs.
Inputs: no named parameters.
ha_get_historyC
Fetch history since an ISO time (optionally for an entity).
Inputs: since (required), end, entity_id, minimal_response.
ha_get_logbookA
Fetch logbook entries since an ISO time (optionally for an entity).
Inputs: since (required), end, entity_id.
ha_get_stateB
Get Home Assistant entity state by entity_id.
Inputs: entity_id (required).
ha_light_turn_offB
Turn off a light by entity_id.
Inputs: entity_id (required).
ha_light_turn_onC
Turn on a light by entity_id.
Inputs: entity_id (required).
ha_list_areasA
List Home Assistant areas from the area registry.
Inputs: no named parameters.
ha_list_devicesA
List Home Assistant devices from the device registry.
Inputs: no named parameters.
ha_list_entity_registryA
List Home Assistant entity registry entries.
Inputs: no named parameters.
ha_list_servicesA
List Home Assistant services and their fields.
Inputs: no named parameters.
ha_list_statesA
List Home Assistant entity states (can be large).
Inputs: no named parameters.
ha_render_templateC
Render a Jinja2 template and return the result.
Inputs: template (required).
ha_update_entity_registryC
Update an entity registry entry (e.g., change name, entity_id, or area_id).
Inputs: entity_id (required), new_entity_id, name, area_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a distinct purpose with clear boundaries. Light control by area vs by entity are separate, state retrieval is split between single and list, and generic service call covers remaining operations without overlap.
All tools follow consistent ha_verb_noun pattern using snake_case, e.g., ha_area_lights_off, ha_get_state, ha_list_areas. No mixing of conventions.
16 tools is well-scoped for a Home Assistant server, covering core operations like state management, entity/area/device queries, history/logs, and template rendering without being overwhelming.
Covers all essential Home Assistant interactions: state queries, listings, light control, service calls, logs, history, and templates. Missing specific tools for common entities like switches or covers, but the generic ha_call_service fills gaps.
Maintenance
Related MCP Connectors
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceEnables control and monitoring of Home Assistant smart home devices through MCP, allowing users to list entities, check device states, and call services to control lights, switches, sensors, and other connected devices.4-
- AlicenseAqualityCmaintenanceA self-hosted MCP server for Home Assistant that exposes full control over entity states, service calls, history, templates, and areas via local stdio, enabling AI assistants to manage your smart home.9112 npmMIT
- AlicenseAqualityAmaintenanceA comprehensive MCP server that enables AI assistants to interact with Home Assistant, control smart home devices, query states, execute services, and manage automations via natural language.77196,503 PyPI5,847MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that exposes Home Assistant's REST and WebSocket APIs as 182 tools, enabling clients like Claude Code to control lights, climate, media, automations, and more. It also provides a status dashboard and supports running as a Home Assistant app or container.AGPL 3.0