hass-mcp
hass-mcp
一个用于控制和查询 Home Assistant 的开源 MCP 服务器。
传输方式:stdio
身份验证:Home Assistant 长期访问令牌
API:Home Assistant REST API
功能
提供的工具:
ha_get_state— 获取实体的状态ha_list_states— 列出所有状态(数据量可能较大)ha_call_service— 调用任何服务
Related MCP server: ha-mcp
安装
pnpm install
pnpm build运行
export HASS_URL="http://homeassistant.local:8123"
export HASS_TOKEN="<your long-lived access token>"
pnpm start在 MCP 客户端中配置
示例(概念性):
{
"mcpServers": {
"homeassistant": {
"command": "npx",
"args": ["-y", "hass-mcp"],
"env": {
"HASS_URL": "http://homeassistant.local:8123",
"HASS_TOKEN": "..."
}
}
}
}安全性
请将令牌视为机密信息。
建议在与 Home Assistant 相同的局域网内运行此服务器。
如果您的 HA 位于 Cloudflare Access 之后,请在局域网侧运行此 MCP 服务器。
许可证
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…
An MCP server that provides agents access to the KeldynAI platform
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.9MIT
- 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.77137,969 PyPI8,231MIT
- 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