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

Claude や他の LLM と Home Assistant を統合するための Model Context Protocol (MCP) サーバーです。

概要

Hass-MCP は、Claude などの AI アシスタントが Home Assistant インスタンスと直接やり取りできるようにし、以下の操作を可能にします:

  • デバイスやセンサーの状態を照会する

  • 照明、スイッチ、その他のエンティティを制御する

  • スマートホームの概要を取得する

  • オートメーションやエンティティのトラブルシューティングを行う

  • 特定のエンティティを検索する

  • 一般的なタスク向けのガイド付き会話を作成する

Related MCP server: Hass-MCP

スクリーンショット

特徴

  • エンティティ管理: 状態の取得、デバイスの制御、エンティティの検索

  • ドメイン概要: エンティティタイプに関する高レベルの情報を取得

  • オートメーション対応: オートメーションの一覧表示と制御

  • ガイド付き会話: オートメーション作成などの一般的なタスクにプロンプトを使用

  • スマート検索: 名前、タイプ、または状態でエンティティを検索

  • ライブダッシュボード編集: Home Assistant の WebSocket API 経由で Lovelace ダッシュボード(カードとビュー)を読み取り・編集 — 変更は開いているブラウザに即座に反映され、自動バックアップとドライランプレビューも利用できます

  • トークン効率: トークン使用量を最小限に抑えるスリムな JSON レスポンス

インストール

前提条件

  • 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 を開き、Settings に移動します b. Developer > Edit Config に移動します 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 の Long-Lived Access Token に置き換えます 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 のツールメニューに表示されるはずです

注記: 同じマシンで Home Assistant を Docker で実行している場合、コンテナが Home Assistant にアクセスできるように Docker の引数に --network host を追加する必要があるかもしれません。あるいは、host.docker.internal の代わりにマシンの IP アドレスを使用してください。

uv/uvx

  1. システムに uv をインストールします。

  2. MCP サーバーを Claude Desktop に追加します:

    a. Claude Desktop を開き、Settings に移動します b. Developer > Edit Config に移動します 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 の Long-Lived Access Token に置き換えます 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 の Settings > MCP > Add New MCP Server に移動します

  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. 「Add」をクリックして保存します

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 でホストする、1 つのサーバーを複数のクライアントで共有する、LibreChat や OpenWebUI のようなネットワークベースのツールから接続する)向けに、Hass-MCP は MCP の streamable HTTP transport をサポートしています。サーバーはステートレスモード(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

--host 0.0.0.0 は Docker 内でポートがブリッジ経由で到達可能になるために必要です。ホストからのみ到達できればよい場合は、公開(-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 ルートを OS のトラストストア(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 は設定されている場合、常に OS のストアより優先されます。verify=False は意図的にサポートされていません — 暗号化されていないローカル LAN トラフィックを本当に使用したい場合は HA_URL=http://... を使用してください。

使用例

Hass-MCP をセットアップした後、Claude で使用できるプロンプトの例をいくつか示します:

  • 「リビングの照明の現在の状態は?」

  • 「キッチンの照明をすべて消して」

  • 「主寝室の温度は?」

  • 「ゲストルームにあるものをすべてリストアップして」

  • 「温度データを含むすべてのセンサーをリストアップして」

  • 「気候(climate)エンティティの概要を教えて」

  • 「日没時に照明をオンにするオートメーションを作成して」

  • 「寝室の人感センサーのオートメーションが機能しない理由のトラブルシューティングを手伝って」

  • 「リビングに関連するエンティティを検索して」

  • 「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 時間分取得します — レコーダーの短期保持ウィンドウより古いデータでも動作します

  • 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」タイプのビューのセクションを一覧表示します

  • add_view / remove_view / update_view: ダッシュボードのビューを編集します

  • list_dashboard_backups / restore_dashboard: 自動保存前バックアップの一覧表示と、そのバックアップへのロールバック

Sections ビュー: Home Assistant のモダンなビュータイプ(type: sections)は、カードを単一のトップレベルリストではなくセクション内に保存します。そのようなビューでは、list_view_sections を呼び出し、カードツールに section 引数(インデックス、タイトル、または見出し)を渡してください。section なしの sections ビューへのカード編集は、利用可能なセクションのリスト付きで拒否されます — レンダリングされない場所にカードを黙って保存することはありません。

すべての編集ツールは dry_run=true を受け付け、保存せずに結果の設定と変更サマリーをプレビューできます。

重要な注意事項:

  • 管理者トークンが必要です。 Lovelace 設定の保存には、Long-Lived Token が管理者ユーザーに属している必要があります。

  • ストレージモードのみ。 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 License

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