Skip to main content
Glama
hass-mcp

hass-mcp

by HiTechLabTN

hass-mcp — HiTech Lab 版本

由 HiTech Lab 维护和优化 来源:https://github.com/voska/hass-mcp

Hass-MCP

MCP Toplist

一个用于将 Home Assistant 与 Claude 及其他 LLM 集成的模型上下文协议(MCP)服务器。

概述

Hass-MCP 让 Claude 等 AI 助手能够直接与你的 Home Assistant 实例交互,从而可以:

  • 查询设备和传感器的状态

  • 控制灯光、开关和其他实体

  • 获取你的智能家居摘要

  • 排查自动化和实体问题

  • 搜索特定实体

  • 为常见任务创建引导式对话

Related MCP server: Hass-MCP

截图

功能特性

  • 实体管理:获取状态、控制设备、搜索实体

  • 域摘要:获取实体类型的高层信息

  • 自动化支持:列出并控制自动化

  • 引导式对话:使用提示词完成常见任务,例如创建自动化

  • 智能搜索:按名称、类型或状态查找实体

  • 实时仪表盘编辑:通过 Home Assistant 的 WebSocket API 读取和编辑 Lovelace 仪表盘(卡片和视图)——更改会立即出现在已打开的浏览器中,并带有自动备份和 dry-run 预览

  • Token 效率:精简的 JSON 响应以最小化 Token 使用

安装

前提条件

  • 具有 Long-Lived Access Token 的 Home Assistant 实例

  • 以下任一方式:

    • Docker(推荐)

    • Python 3.13+ 和 uv

使用 Claude Desktop 进行设置

Docker 安装(推荐)

  1. 拉取 Docker 镜像:

    docker pull voska/hass-mcp:latest
  2. 将 MCP 服务器添加到 Claude Desktop:

    a. 打开 Claude Desktop 并进入设置 b. 导航到开发者 > 编辑配置 c. 将以下配置添加到你的 claude_desktop_config.json 文件中:

    {
      "mcpServers": {
        "hass-mcp": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "-e",
            "HA_URL",
            "-e",
            "HA_TOKEN",
            "voska/hass-mcp"
          ],
          "env": {
            "HA_URL": "http://homeassistant.local:8123",
            "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
          }
        }
      }
    }

    d. 将 YOUR_LONG_LIVED_TOKEN 替换为你实际的 Home Assistant 长期访问令牌 e. 更新 HA_URL:

    • 如果 Home Assistant 运行在同一台机器上:使用 http://host.docker.internal:8123(Mac/Windows 上的 Docker Desktop)

    • 如果 Home Assistant 运行在另一台机器上:使用实际的 IP 或主机名

    f. 保存文件并重启 Claude Desktop

  3. “Hass-MCP”工具现在应该会出现在你的 Claude Desktop 工具菜单中

注意:如果你在同一台机器上的 Docker 中运行 Home Assistant,你可能需要在 Docker 参数中添加 --network host,以便容器访问 Home Assistant。或者,使用你机器的 IP 地址而不是 host.docker.internal。

uv/uvx

  1. 在你的系统上安装 uv。

  2. 将 MCP 服务器添加到 Claude Desktop:

    a. 打开 Claude Desktop 并进入设置 b. 导航到开发者 > 编辑配置 c. 将以下配置添加到你的 claude_desktop_config.json 文件中:

    {
      "mcpServers": {
        "hass-mcp": {
          "command": "uvx",
          "args": ["hass-mcp"],
          "env": {
            "HA_URL": "http://homeassistant.local:8123",
            "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
          }
        }
      }
    }

    d. 将 YOUR_LONG_LIVED_TOKEN 替换为你实际的 Home Assistant 长期访问令牌 e. 更新 HA_URL:

    • 如果 Home Assistant 运行在同一台机器上:使用 http://host.docker.internal:8123(Mac/Windows 上的 Docker Desktop)

    • 如果 Home Assistant 运行在另一台机器上:使用实际的 IP 或主机名

    f. 保存文件并重启 Claude Desktop

  3. “Hass-MCP”工具现在应该会出现在你的 Claude Desktop 工具菜单中

其他 MCP 客户端

Cursor

  1. 转到 Cursor 设置 > MCP > 添加新的 MCP 服务器

  2. 填写表单:

    • 名称:Hass-MCP

    • 类型:command

    • 命令:

      docker run -i --rm -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN voska/hass-mcp
    • 将 YOUR_LONG_LIVED_TOKEN 替换为你实际的 Home Assistant 令牌

    • 更新 HA_URL 以匹配你的 Home Assistant 实例地址

  3. 点击“添加”保存

Claude Code (CLI)

要与 Claude Code CLI 一起使用,你可以直接使用 mcp add 命令添加 MCP 服务器:

使用 Docker(推荐):

claude mcp add hass-mcp -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN -- docker run -i --rm -e HA_URL -e HA_TOKEN voska/hass-mcp

将 YOUR_LONG_LIVED_TOKEN 替换为你实际的 Home Assistant 令牌,并更新 HA_URL 以匹配你的 Home Assistant 实例地址。

HTTP 传输(Streamable)

对于无法使用 stdio 的部署——例如运行在 MCP 网关之后、托管在 Smithery 上、在多个客户端之间共享一个服务器,或从 LibreChat、OpenWebUI 等基于网络的工具连接——Hass-MCP 支持 MCP streamable HTTP 传输。服务器以无状态模式运行(无 Mcp-Session-Id,JSON 响应),适用于水平扩展的主机。

[!CAUTION] HTTP 模式会将 Home Assistant 的完整控制权暴露到网络上。 任何能访问该端口的人都可以调用任何工具——关闭灯光、解锁门、触发自动化、重启 HA。MCP 规范尚未在此服务器中提供内置的身份验证层。在它提供之前,你必须将其置于以下任一保护之后:

  • 执行 basic-auth 或 bearer-token 验证的反向代理(nginx、Caddy、Traefik)

  • VPN 或零信任网络(Tailscale、WireGuard、Cloudflare Access)

  • 仅绑定 localhost(默认——只有在你清楚自己在做什么时才更改 --host)

在没有身份验证的情况下,不要将 :8000 暴露到公网。

本地运行

使用 uvx:

HA_URL=http://homeassistant.local:8123 \
HA_TOKEN=YOUR_LONG_LIVED_TOKEN \
uvx hass-mcp --http --port 8000

服务器默认绑定 127.0.0.1。只有当你还在其前面配置了身份验证时,才使用 --host 0.0.0.0 覆盖。

在 Docker 中运行

docker run --rm -p 8000:8000 \
  -e HA_URL=http://homeassistant.local:8123 \
  -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN \
  voska/hass-mcp:latest --http --host 0.0.0.0 --port 8000

在 Docker 内部必须使用 --host 0.0.0.0,这样端口才能通过网桥访问。如果你只希望从宿主机访问,请将发布端口(-p)绑定到 127.0.0.1:8000:8000,或者在其前面放置反向代理。

端点

MCP 端点位于 /mcp。将你的客户端指向 http://<host>:<port>/mcp。

Smithery / PaaS

除了 MCP_PORT 之外,服务器还遵循 PORT 环境变量(Smithery 的约定)。Smithery 部署需要 --http 模式,并会自动读取 PORT。

自定义 / 私有 CA

如果你的 Home Assistant 实例提供由你自己的 CA(step-ca、smallstep、homelab OpenSSL)签发的证书,hass-mcp 可以在不禁用 TLS 的情况下验证它:

  • 本地:将 CA 根证书安装到你的操作系统信任库中(macOS Keychain、Windows Cert Store,或 Linux 上的 update-ca-certificates)。hass-mcp 会通过 truststore 自动获取它。

  • 在 Docker 中(或任何沙盒运行时):将 CA 文件绑定挂载,并将 SSL_CERT_FILE 指向它。

docker run --rm \
  -v /path/to/your-ca.crt:/etc/ssl/certs/your-ca.crt:ro \
  -e SSL_CERT_FILE=/etc/ssl/certs/your-ca.crt \
  -e HA_URL=https://homeassistant.example.internal:8123 \
  -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN \
  voska/hass-mcp:latest

设置 SSL_CERT_FILE 后,它始终优先于操作系统信任库。有意不支持 verify=False——如果你确实想要未加密的本地局域网流量,请使用 HA_URL=http://...。

使用示例

以下是一些在 Hass-MCP 设置完成后可以配合 Claude 使用的提示词示例:

  • “我客厅灯光的当前状态是什么?”

  • “关掉厨房里所有的灯”

  • “主卧室的温度是多少?”

  • “列出客房里的所有东西”

  • “列出我所有包含温度数据的传感器”

  • “给我一个我的气候实体的摘要”

  • “创建一个在日落时开灯的自动化”

  • “帮我排查为什么我的卧室运动传感器自动化不工作”

  • “搜索与我的客厅相关的实体”

  • “显示 Home Assistant 日志中最后 50 行 ERROR”

  • “今天 mqtt 集成一直在失败什么?”

  • “显示上个月每天的用电量”

  • “上周二前门传感器发生了什么?”

可用工具

Hass-MCP 提供了多个用于与 Home Assistant 交互的工具:

  • get_version:获取 Home Assistant 版本

  • get_entity:获取特定实体的状态,并支持可选字段过滤

  • entity_action:对实体执行操作(打开、关闭、切换)

  • list_entities:获取实体列表,并支持可选域过滤和搜索

  • search_entities_tool:搜索与查询匹配的实体

  • domain_summary_tool:获取某个域的实体摘要

  • list_automations:获取所有自动化列表

  • call_service_tool:调用任何 Home Assistant 服务

  • restart_ha:重启 Home Assistant

  • get_history:获取实体的状态历史(最近 N 小时)

  • get_history_range:在明确的日期/时间范围内(start_time / end_time,ISO-8601)获取实体的状态变更历史

  • get_statistics:获取实体在最近 N 小时内的长期聚合统计信息(每个桶的均值 / 最小值 / 最大值)——适用于早于 recorder 短期保留窗口的数据

  • get_statistics_range:相同功能,但针对明确的日期/时间范围——适用于月度 / 年度趋势查询

  • get_error_log:获取 Home Assistant 错误日志,并可在服务端应用可选的 level / integration / search_term / lines 过滤器,以免嘈杂的日志撑爆 Claude 的上下文

  • get_entities_by_area:列出特定区域 / 房间中的实体

仪表盘(Lovelace)编辑

通过 Home Assistant 的 WebSocket API 读取并实时编辑仪表盘。保存后,更改会立即推送到每个已打开的浏览器——无需重启。

  • list_dashboards:列出仪表盘(默认仪表盘以及任何用户仪表盘),每个都带有其 url_path 和 mode(storage / yaml)

  • get_dashboard_config:获取仪表盘的完整配置

  • set_dashboard_config:替换仪表盘的完整配置(底层操作)

  • add_card / update_card / remove_card / move_card:在视图中编辑卡片(视图通过索引或其 path / title 选择)

  • list_view_sections:列出“sections”类型视图的各个 section

  • add_view / remove_view / update_view:编辑仪表盘的视图

  • list_dashboard_backups / restore_dashboard:列出并回滚到自动的保存前备份

Sections 视图: Home Assistant 的现代视图类型(type: sections)将其卡片存储在 sections 中,而不是单个顶层列表中。对于这些视图,请调用 list_view_sections,并将 section 参数(索引、标题或 heading)传递给卡片工具。在没有 section 的情况下对 sections 视图进行卡片编辑会被拒绝,并返回可用 sections 列表——而不是静默保存一张永远不会渲染的卡片。

每个编辑工具都接受 dry_run=true,以便在不保存的情况下预览生成的配置和变更摘要。

重要说明:

  • 需要管理员令牌。 保存 Lovelace 配置要求长期令牌属于管理员用户。

  • 仅限 storage 模式。 只有 UI 管理的(“storage”)仪表盘才能被编辑。YAML 模式仪表盘会被检测到并以明确消息拒绝——请直接编辑它们的 YAML 文件。

  • 整配置写入。 Home Assistant 没有部分编辑 API;每次更改都是对整个仪表盘的读取-修改-写入。高层卡片/视图工具会为你处理这一点。

  • 自动备份。 每次写入前,当前配置都会保存到 HASS_MCP_BACKUP_DIR(默认 ~/.hass-mcp/dashboard-backups/)。在 Docker 中运行时,请在该路径挂载一个卷,否则容器重建时备份会丢失。

引导式对话的提示词

Hass-MCP 包含多个用于引导式对话的提示词:

  • create_automation:基于触发器类型创建 Home Assistant 自动化的指南

  • debug_automation:针对无法正常工作的自动化的故障排除帮助

  • troubleshoot_entity:诊断实体问题

  • routine_optimizer:分析使用模式并根据实际行为建议优化例程

  • automation_health_check:审查所有自动化,查找冲突、冗余或改进机会

  • entity_naming_consistency:审计实体名称并建议标准化改进

  • dashboard_layout_generator:根据用户偏好和使用模式创建优化的仪表板

可用资源

Hass-MCP 提供以下资源端点:

  • hass://entities/{entity_id}:获取特定实体的状态

  • hass://entities/{entity_id}/detailed:获取具有所有属性的实体的详细信息

  • hass://entities:列出按域分组的全部 Home Assistant 实体

  • hass://entities/domain/{domain}:获取特定域的实体列表

  • hass://search/{query}/{limit}:使用自定义结果限制搜索匹配查询的实体

开发

运行测试

uv run pytest tests/

许可证

MIT 许可证

Available Tools

29 tools
add_cardA

Add a card to a dashboard view (live)

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view — an integer index, or a string matching the view's path or title. card: The card config dict (must include a string type), e.g. {"type": "markdown", "content": "Hello"}. position: Insert index within the target card list (default: append). section: For a "sections"-type view, which section to add into — an index, section title, or heading text. REQUIRED for sections views (use list_view_sections to see them); omit for classic views. dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: card, view, dry_run, section, +2 more. Returns: result

add_viewA

Add a new view to a dashboard (live)

Args: url_path: Dashboard URL path, or None for the default dashboard. view_config: The view config dict, e.g. {"title": "Garage", "path": "garage"}. position: Insert index among views (default: append). dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: dry_run, position, url_path, view_config. Returns: result

call_service_toolA

Call any Home Assistant service (low-level API access)

Args: domain: The domain of the service (e.g., 'light', 'switch', 'automation') service: The service to call (e.g., 'turn_on', 'turn_off', 'toggle') data: Optional data to pass to the service (e.g., {'entity_id': 'light.living_room'})

Returns: A dictionary with success status, the domain/service called, and the list of affected entity states returned by Home Assistant.

Examples: domain='light', service='turn_on', data={'entity_id': 'light.x', 'brightness': 255} domain='automation', service='reload' domain='fan', service='set_percentage', data={'entity_id': 'fan.x', 'percentage': 50}

Inputs: domain (required), service (required), data. Returns: result

domain_summary_toolA

Get a summary of entities in a specific domain

Args: domain: The domain to summarize (e.g., 'light', 'switch', 'sensor') example_limit: Maximum number of examples to include for each state

Returns: A dictionary containing: - total_count: Number of entities in the domain - state_distribution: Count of entities in each state - examples: Sample entities for each state - common_attributes: Most frequently occurring attributes

Examples: domain="light" - get light summary domain="climate", example_limit=5 - climate summary with more examples Best Practices: - Use this before retrieving all entities in a domain to understand what's available

Inputs: domain (required), example_limit. Returns: result

entity_actionA

Perform an action on a Home Assistant entity (on, off, toggle)

Args: entity_id: The entity ID to control (e.g. 'light.living_room') action: The action to perform ('on', 'off', 'toggle') params: Optional dictionary of additional parameters for the service call

Returns: The response from Home Assistant

Examples: entity_id="light.living_room", action="on", params={"brightness": 255} entity_id="switch.garden_lights", action="off" entity_id="climate.living_room", action="on", params={"temperature": 22.5}

Domain-Specific Parameters: - Lights: brightness (0-255), color_temp, rgb_color, transition, effect - Covers: position (0-100), tilt_position - Climate: temperature, target_temp_high, target_temp_low, hvac_mode - Media players: source, volume_level (0-1)

Inputs: action (required), entity_id (required), params.

get_dashboard_configA

Get a dashboard's full configuration

Args: url_path: The dashboard's URL path (e.g. "my-dash"). Omit or pass None for the default "Overview" dashboard.

Returns: The dashboard config dict (a top-level views list of cards). If the dashboard has no stored config yet, returns an empty {"views": []} scaffold with a note.

Inputs: url_path. Returns: result

get_entities_by_areaA

Get all entities assigned to a specific Home Assistant area (room).

Area lookup is case-insensitive and matches the area's name as configured in Home Assistant (e.g., "Kitchen", "Living Room"). Entities inherit their area from their parent device when no area is set directly, matching HA's own resolution behavior.

Args: area: Name of the area to filter by (case-insensitive) domain: Optional domain to further filter results (e.g., 'light') lean: If True (default), returns token-efficient entity records

Returns: A dictionary containing: - area: The matched area name (as canonicalized by HA) - count: Number of matching entities - entities: List of entity records with their state and area

Examples: get_entities_by_area(area="Kitchen") - everything in the kitchen get_entities_by_area(area="Living Room", domain="light") - lights only

Inputs: area (required), lean, domain. Returns: result

get_entityA

Get the state of a Home Assistant entity with optional field filtering

Args: entity_id: The entity ID to get (e.g. 'light.living_room') fields: Optional list of fields to include (e.g. ['state', 'attr.brightness']) detailed: If True, returns all entity fields without filtering

Examples: entity_id="light.living_room" - basic state check entity_id="light.living_room", fields=["state", "attr.brightness"] - specific fields entity_id="light.living_room", detailed=True - all details

Inputs: entity_id (required), fields, detailed.

get_error_logA

Get the Home Assistant error log for troubleshooting.

All filters are optional and combine (AND semantics). Stats (error_count, warning_count, integration_mentions, total_lines) are computed over the filtered output so they match what's returned.

Args: level: Filter to lines containing this log level — ERROR, WARNING, INFO, or DEBUG. Case-insensitive. integration: Filter to lines mentioning this integration. Matches [name] or [homeassistant.components.name]. Case-insensitive. search_term: Case-insensitive substring filter applied per line. Useful for entity IDs, exception names, etc. lines: Return only the most recent N lines (applied after other filters). Useful when you only care about the tail.

Returns: A dictionary containing: - log_text: The (possibly filtered) error log text - error_count: Number of ERROR entries in the filtered output - warning_count: Number of WARNING entries in the filtered output - integration_mentions: Map of integration names to mention counts - total_lines: Number of lines in the filtered output - filters_applied: Map of which filter args were supplied - error: Error message if retrieval failed

Examples: get_error_log() # full log get_error_log(level="ERROR") # errors only get_error_log(integration="zwave_js") # one integration get_error_log(search_term="light.kitchen") # specific entity get_error_log(level="ERROR", lines=50) # last 50 errors

Best Practices: - Filter on the server side (here) rather than pulling the full log into Claude's context — saves tokens on noisy logs. - Combine integration + level="ERROR" to triage a single integration that's misbehaving. - Use lines to bound output when scanning a long-running HA.

Inputs: level, lines, integration, search_term. Returns: result

get_historyA

Get the history of an entity's state changes

Args: entity_id: The entity ID to get history for hours: Number of hours of history to retrieve (default: 24)

Returns: A dictionary containing: - entity_id: The entity ID requested - states: List of state objects with timestamps - count: Number of state changes found - first_changed: Timestamp of earliest state change - last_changed: Timestamp of most recent state change

Examples: entity_id="light.living_room" - get 24h history entity_id="sensor.temperature", hours=168 - get 7 day history Best Practices: - Keep hours reasonable (24-72) for token efficiency - Use for entities with discrete state changes rather than continuously changing sensors - Consider the state distribution rather than every individual state

Inputs: entity_id (required), hours. Returns: result

get_history_rangeA

Get raw state-change history for an entity over a date/time range.

Like get_history, but takes an explicit window instead of "N hours from now". Useful for inspecting what happened on a specific day or correlating with an external event.

Args: entity_id: The entity to fetch history for. start_time: ISO-8601 start (e.g. 2026-05-15 or 2026-05-15T08:00:00Z). Treated as UTC if no offset. end_time: ISO-8601 end. Defaults to now (UTC).

Returns: Same shape as get_history: entity_id, states, count, first_changed, last_changed.

Examples: get_history_range("light.kitchen", "2026-05-15") get_history_range("sensor.power", "2026-05-15T00:00:00Z", "2026-05-16T00:00:00Z")

Best Practices: - Bound the window — wider ranges return more data and more tokens. - For aggregated long-term data, prefer get_statistics_range.

Inputs: entity_id (required), start_time (required), end_time. Returns: result

get_statisticsA

Get long-term aggregated statistics for an entity over the last N hours.

Uses HA's recorder statistics (over WebSocket) — aggregated buckets (mean / min / max per period) that survive the short-term retention window. Use this instead of get_history when: - You want data older than the recorder's default 10-day window. - You want aggregated values rather than every individual change. - The entity is a high-frequency sensor (temperature, power) and raw history would be too many tokens.

Args: entity_id: The entity (must have a state_class HA records as statistics — measurement, total, total_increasing). hours: How far back from now. Defaults to 24. period: Bucket size — 5minute, hour, day, week, month. Defaults to hour.

Returns: entity_id, period, start_time, end_time, statistics (list of {start, end, mean, min, max, ...} points).

Examples: get_statistics("sensor.power_usage", hours=168, period="day") get_statistics("sensor.temperature", hours=24)

Inputs: entity_id (required), hours, period. Returns: result

get_statistics_rangeA

Get long-term aggregated statistics for an entity over a date/time range.

Same data source as get_statistics, but with an explicit window — useful for "what was my power usage from Jan 1 to Jan 31?" type questions. Aggregated bucket data survives the short-term retention window, so this works for data months/years old.

Args: entity_id: The entity (must be statistics-tracked). start_time: ISO-8601 start (2026-01-01 or 2026-01-01T00:00:00Z). UTC if no offset. end_time: ISO-8601 end. Defaults to now. period: 5minute, hour, day, week, or month.

Returns: entity_id, period, start_time, end_time, statistics.

Examples: get_statistics_range("sensor.energy", "2026-01-01", "2026-02-01", period="day") get_statistics_range("sensor.temperature", "2026-05-01", period="hour")

Inputs: entity_id (required), start_time (required), period, end_time. Returns: result

get_versionA

Get the Home Assistant version

Returns: A string with the Home Assistant version (e.g., "2025.3.0")

Inputs: no named parameters. Returns: result

list_automationsA

Get a list of all automations from Home Assistant

This function retrieves all automations configured in Home Assistant, including their IDs, entity IDs, state, and display names.

Returns: A list of automation dictionaries, each containing id, entity_id, state, and alias (friendly name) fields.

Examples: Returns all automation objects with state and friendly names

Inputs: no named parameters. Returns: result

list_dashboard_backupsA

List on-disk backups of a dashboard's config

Backups are written automatically before every dashboard write. NOTE: in Docker, backups persist only if HASS_MCP_BACKUP_DIR is volume-mounted.

Args: url_path: Dashboard URL path, or None for the default dashboard.

Returns: A list of {backup_id, path}, oldest first.

Inputs: url_path. Returns: result

list_dashboardsA

List Home Assistant dashboards (Lovelace)

Returns: A list of dashboards. Each entry has url_path (None for the default "Overview" dashboard), title, and mode ("storage" or "yaml"). Only "storage"-mode dashboards can be edited via these tools.

Inputs: no named parameters. Returns: result

list_entitiesA

Get a list of Home Assistant entities with optional filtering

Args: domain: Optional domain to filter by (e.g., 'light', 'switch', 'sensor') search_query: Optional search term to filter entities by name, id, or attributes (Note: Does not support wildcards. To get all entities, leave this empty) limit: Maximum number of entities to return (default: 100) fields: Optional list of specific fields to include in each entity detailed: If True, returns all entity fields without filtering

Returns: A list of entity dictionaries with lean formatting by default

Examples: domain="light" - get all lights search_query="kitchen", limit=20 - search entities domain="sensor", detailed=True - full sensor details

Best Practices: - Use lean format (default) for most operations - Prefer domain filtering over no filtering - For domain overviews, use domain_summary_tool instead of list_entities - Only request detailed=True when necessary for full attribute inspection - To get all entity types/domains, use list_entities without a domain filter, then extract domains from entity_ids

Inputs: limit, domain, fields, detailed, +1 more. Returns: result

list_view_sectionsA

List the sections of a "sections"-type dashboard view

Modern Home Assistant views of type: sections hold their cards inside sections (not a top-level card list). Use this to discover which section to target with the card tools' section argument.

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view (index, or matching path/title).

Returns: A list of {index, title, heading, card_count}, one per section. Errors if the view is not a sections view.

Inputs: view, url_path. Returns: result

move_cardB

Reorder a card within a dashboard view (live)

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view (index, or matching path/title). card_index: Current index of the card. new_index: Destination index within the same card list. section: For a "sections"-type view, which section the card is in (index/title/heading). Required for sections views. dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: view, dry_run, section, url_path, +2 more. Returns: result

remove_cardA

Remove a card from a dashboard view (live)

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view (index, or matching path/title). card_index: Index of the card to remove within the target card list. section: For a "sections"-type view, which section the card is in (index/title/heading). Required for sections views. dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: view, dry_run, section, url_path, +1 more. Returns: result

remove_viewA

Remove a view from a dashboard (live)

⚠️ Removes the view and all its cards.

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view (index, or matching path/title). dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: view, dry_run, url_path. Returns: result

restart_haA

Restart Home Assistant

⚠️ WARNING: Temporarily disrupts all Home Assistant operations

Returns: Result of restart operation

Inputs: no named parameters. Returns: result

restore_dashboardA

Restore a dashboard from a backup (live)

Restores the most recent backup unless backup_id is given. The current config is itself backed up first, so a restore can be undone.

Args: url_path: Dashboard URL path, or None for the default dashboard. backup_id: A specific backup id from list_dashboard_backups (default: newest). dry_run: Preview without saving.

Returns: Save result plus restored_from, or a dry-run preview.

Inputs: dry_run, url_path, backup_id. Returns: result

search_entities_toolA

Search for entities matching a query string

Args: query: The search query to match against entity IDs, names, and attributes. (Note: Does not support wildcards. To get all entities, leave this blank or use list_entities tool) limit: Maximum number of results to return (default: 20)

Returns: A dictionary containing search results and metadata: - count: Total number of matching entities found - results: List of matching entities with essential information - domains: Map of domains with counts (e.g. {"light": 3, "sensor": 2})

Examples: query="temperature" - find temperature entities query="living room", limit=10 - find living room entities query="", limit=500 - list all entity types

Inputs: query (required), limit. Returns: result

set_dashboard_configA

Replace a dashboard's full configuration (low-level write)

⚠️ WARNING: Overwrites the ENTIRE dashboard and updates every open browser live. The prior config is backed up first (use restore_dashboard to undo). Requires an admin token; only storage-mode dashboards can be saved.

Args: url_path: Dashboard URL path, or None for the default dashboard. config: The complete new config dict (must contain a views list). dry_run: If True, validate and return the resulting config + a change summary WITHOUT saving.

Returns: On save: {success, url_path, backup_id, summary}. On dry_run: {dry_run: True, url_path, summary, config}.

Inputs: config, dry_run, url_path. Returns: result

system_overviewA

Get a comprehensive overview of the entire Home Assistant system

Returns: A dictionary containing: - total_entities: Total count of all entities - domains: Dictionary of domains with their entity counts and state distributions - domain_samples: Representative sample entities for each domain (2-3 per domain) - domain_attributes: Common attributes for each domain - area_distribution: Entities grouped by area (if available)

Examples: Returns domain counts, sample entities, and common attributes Best Practices: - Use this as the first call when exploring an unfamiliar Home Assistant instance - Perfect for building context about the structure of the smart home - After getting an overview, use domain_summary_tool to dig deeper into specific domains

Inputs: no named parameters. Returns: result

update_cardB

Replace a card in a dashboard view (live)

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view (index, or matching path/title). card_index: Index of the card to replace within the target card list. card: The new card config dict (must include a string type). section: For a "sections"-type view, which section the card is in (index/title/heading). Required for sections views. dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: card, view, dry_run, section, +2 more. Returns: result

update_viewA

Update a view's properties — title, path, icon, etc. (live)

Cards in the view are preserved unless changes includes a cards key.

Args: url_path: Dashboard URL path, or None for the default dashboard. view: Target view (index, or matching path/title). changes: Dict of view properties to merge in, e.g. {"title": "New Title"}. dry_run: Preview without saving.

Returns: Save result with a backup_id, or a dry-run preview.

Inputs: view, changes, dry_run, url_path. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 29 tools

    Disambiguation3/5

    There are several overlapping tools for entity queries (list_entities, search_entities_tool, get_entities_by_area, domain_summary_tool, system_overview) and history (get_history, get_history_range, get_statistics, get_statistics_range). While each has a distinct primary purpose, the entity discovery/query tools especially overlap in what an agent might use to 'find entities,' requiring careful reading of descriptions to pick correctly. Dashboard tools and service/entity_action tools are more clearly distinct.

    Naming Consistency3/5

    Naming is inconsistent: many use snake_case verbs (list_entities, get_entity, add_card, remove_view) but several use different patterns: call_service_tool, entity_action, search_entities_tool, domain_summary_tool, system_overview, restore_dashboard, list_dashboard_backups. Mixed conventions like search_entities_tool/suffix '_tool' and camelCase-less words like 'system_overview' create inconsistency, though most are readable.

    Tool Count3/5

    29 tools is on the heavy side. The dashboard CRUD cluster (add_card, update_card, remove_card, move_card, add_view, remove_view, update_view, list_view_sections, restore_dashboard, set_dashboard_config, get_dashboard_config) plus history/statistics tools and system overview tools make the surface feel broad. While each tool serves a real purpose, the count is approaching the upper bound where agents may struggle to select among many options.

    Completeness4/5

    Core coverage is strong: entity reads, writes, service calls, dashboard CRUD with backups and restore, history and statistics queries, plus system diagnostics. Minor gaps: no explicit entity create/delete (though call_service_tool can cover some), no persistent state management, and no dashboard section mutation beyond listing. But the lifecycle for the stated domain (entity control, dashboard editing, history) is well covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.
      29
      353
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A 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.
      9
      MIT