Skip to main content
Glama

ha-nexus-agent

Home Assistant用MCPサーバー — 21ドメインにわたる202個のツールを通じて、AIアシスタントにスマートホームの完全な制御権を与えます。エンティティ(一括制御 + 音声アシスタントへの公開)、オートメーションとスクリプト(完全なCRUD + トレース)、ブループリント、ダッシュボード、ヘルパー、エリア、デバイスレジストリ、カレンダー、ToDoリスト、履歴、システム管理、YAML設定ファイル、Gitベースのバージョン管理、リアルタイムWebSocketイベント、エネルギーダッシュボード設定ゾーン(ジオフェンシング)ラベルとカテゴリあいまい検索と検出Supervisor経由のアドオン管理HACS統合などが含まれます。

Claude Code CLIClaude DesktopVS CodeCursorWindsurfOpenAI Codex CLIGemini CLIで動作します。


インストール — Home Assistantアドオン(推奨)

  1. Home Assistantで 設定 → アドオン → アドオンストア に移動します

  2. 右上の3点メニュー(⋮)をクリックし、リポジトリ を選択します

  3. 以下を追加します:

    https://github.com/Fistacho/ha-nexus-agent
  4. Nexus Agent を見つけて インストール をクリックします

  5. 開始 をクリックします

  6. Web UIを開く をクリックします

Web UIにはAPIキーが表示され、各MCPクライアントに貼り付けるための設定が生成されます。手動でのトークン設定は不要で、アドオンが自動的にHome Assistantに接続します。


インストール — スタンドアロン(HA外部)

git clone https://github.com/Fistacho/ha-nexus-agent
cd ha-nexus-agent
pip install -r requirements.txt
cp .env.example .env
# Edit .env: set HA_URL and HA_TOKEN
python server.py

http://localhost:7123 を開き、APIキーとMCPクライアント設定を取得します。

Home Assistantトークンの取得

  1. HAで プロフィール → セキュリティ → 長期アクセス用トークン に移動します

  2. トークンを作成 をクリックし、名前を nexus にします

  3. .env ファイルの HA_TOKEN として貼り付けます


MCPクライアントの接続

Nexus起動後、http://your-ha-ip:7123 を開きます。セットアップページで各クライアント用の正確なコマンドや設定スニペットが生成されるので、コピーして貼り付けるだけです。

すべてのSSEベースのクライアントは以下に接続します:

http://your-ha-ip:7123/mcp?token=YOUR_API_KEY

Claude Code CLI

claude mcp add nexus --transport sse "http://your-ha-ip:7123/mcp?token=YOUR_API_KEY" --scope user

OpenAI Codex CLI

codex mcp add nexus --url "http://your-ha-ip:7123/mcp?token=YOUR_API_KEY"

Gemini CLI

gemini mcp add nexus --url "http://your-ha-ip:7123/mcp?token=YOUR_API_KEY"

VS Code

.vscode/mcp.json を作成します:

{
  "servers": {
    "nexus": {
      "type": "sse",
      "url": "http://your-ha-ip:7123/mcp?token=YOUR_API_KEY"
    }
  }
}

Cursor

~/.cursor/mcp.json に貼り付けます:

{
  "mcpServers": {
    "nexus": {
      "url": "http://your-ha-ip:7123/mcp?token=YOUR_API_KEY",
      "type": "sse"
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json に貼り付けます:

{
  "mcpServers": {
    "nexus": {
      "url": "http://your-ha-ip:7123/mcp?token=YOUR_API_KEY",
      "type": "sse"
    }
  }
}

Claude Desktop (スタンドアロン、サブプロセスモード)

%APPDATA%/Claude/claude_desktop_config.json (Windows) または ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) に貼り付けます:

{
  "mcpServers": {
    "nexus": {
      "command": "python",
      "args": ["server.py"],
      "cwd": "/path/to/ha-nexus-agent",
      "env": {
        "HA_URL": "http://homeassistant.local:8123",
        "HA_TOKEN": "your_ha_token_here"
      }
    }
  }
}

ヒント: Nexus Web UI (http://your-ha-ip:7123) から、実際のパスとキーが含まれた正確な設定をコピーしてください。


機能

  • 202個のMCPツール(21カテゴリ)

  • リアルタイムWebSocket — 状態変化、イベント、トリガーをライブで購読

  • Gitバージョン管理 — 設定変更を自動コミットし、即座にロールバック可能

  • YAMLバリデーション — 設定ファイル書き込み前の検証

  • セットアップWeb UI — 各クライアント用のMCP設定を自動生成

  • HAアドオンネイティブ — アドオンストアからワンクリックインストール、手動トークン設定不要

  • APIキー認証 — MCPエンドポイントを保護し、URLクエリパラメータでトークンを渡す


ツール概要

カテゴリ

entities_*

17

list_entities, turn_on/off/toggle, bulk_control, set/get_entity_exposure (音声アシスタント)

services_*

19

call_service, send_notification, set_light_color, camera_snapshot, camera_record, persistent_notification create/dismiss

automations_*

21

list/trigger/enable/disable, get/set/delete_automation_config (完全なYAML CRUD), list/get_automation_traces (デバッグ)、スクリプト・シーンも同様

blueprints_*

4

list, import (URLから), delete, substitute (入力付きでインスタンス化)

areas_*

8

list_areas, create_area, get_area_states, control_area

devices_*

4

list_devices, update_device (名前変更 / エリア移動 / 無効化), remove_device, list_devices_in_area

calendar_*

4

list_calendars, list_events, create_event, delete_event

todo_*

5

list_todo_lists, list_items, add_item, update_item, remove_item

helpers_*

11

set_input_boolean, set_input_number, start_timer, increment_counter

history_*

5

get_state_history, get_logbook, get_error_log

system_*

9

check_config, create_backup, restart_ha, list_integrations

dashboards_*

6

get_dashboard_config, add_card_to_view, add_view_to_dashboard

files_*

6

read_config_file, write_config_file, validate_yaml_content

git_*

11

git_commit_all, git_rollback_file, git_log, safe_write_with_checkpoint

ws_*

7

listen_state_changes, listen_events, subscribe_trigger

supervisor_*

20

アドオンのlist/install/start/stop/restart/update/uninstall, addon_logs, addon_options, backups (list/create/restore/delete), core/host 情報 + 再起動

hacs_*

7

HACSリポジトリのlist/install/uninstall/update, カスタムリポジトリ追加, クリティカルアップデートのリスト


Gitバージョン管理

NexusはHA設定ディレクトリのGit履歴を保持します。リスクのある変更を行う前に git_safe_write_with_checkpoint を使用してください。現在の状態をコミットしてから変更を適用するため、問題が発生した場合は即座にロールバックできます。

git_init_config()                                    # run once
git_safe_write_with_checkpoint("automations.yaml", new_content)
git_rollback_file("automations.yaml")                # undo single file
git_rollback_to_commit("abc1234")                    # full rollback
git_log(limit=10)                                    # see history

環境変数

変数

必須

デフォルト

説明

HA_URL

はい

http://homeassistant.local:8123

Home AssistantのURL

HA_TOKEN

スタンドアロンのみ

長期アクセス用トークン

SUPERVISOR_TOKEN

アドオンのみ

自動注入

HAにより自動設定

HA_CONFIG_PATH

Gitツール用

/config

HA設定ディレクトリへのパス

NEXUS_API_KEY

いいえ

自動生成

特定のAPIキーに固定

NEXUS_PORT

いいえ

7123

HTTPサーバーポート

Install Server
A
license - permissive license
B
quality
B
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
4Releases (12mo)

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Fistacho/ha-nexus-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server