Skip to main content
Glama

Home Assistant MCP Server

ホームアシスタントMCPサーバー

Home Assistantと統合し、LLM がスマート ホームを制御およびクエリできるようにするModel Context Protocol (MCP)サーバー。

特徴

  • 自然言語でHome Assistantエンティティをクエリおよび制御する
  • MCP 互換クライアント(Claude Desktop など)で動作します
  • 状態管理、サービス呼び出し、履歴などのツールを提供します
  • Home Assistantの長期アクセストークンを使用した安全な認証
  • 複数のトランスポート オプション (ローカル プロセスの場合は stdio、リモート クライアントの場合は SSE)
  • Home Assistant が利用できない場合のテストとデモンストレーション用の模擬データを備えたデモ モード

インストール

# Install globally using bun bun install -g home-assistant-mcp-server # Or install from source git clone https://github.com/oleander/home-assistant-mcp-server.git cd home-assistant-mcp-server bun install bun run build bun link

構成

次の変数を使用して、現在のディレクトリに.envファイルを作成します。

# Required configurations HASS_URL=http://your-home-assistant:8123 # URL to your Home Assistant instance HASS_TOKEN=your_long_lived_access_token # Long-lived access token for authentication # Optional configurations PORT=3000 # Port for the HTTP server (default: 3000) HASS_MOCK=false # Enable mock data mode when Home Assistant is unavailable (default: false)

環境変数

変数必須デフォルト説明
HASS_URLはい-Home Assistant インスタンスへの URL (例: http://homeassistant.local:8123 )
HASS_TOKENはい-Home Assistant で認証するための長期アクセス トークン
PORTいいえ3000HTTP/SSEトランスポートを使用する場合のHTTPサーバーのポート番号
HASS_MOCKいいえ間違い「true」に設定すると、Home Assistant接続なしでテストするための模擬データモードが有効になります

長期間有効なアクセス トークンを取得するには:

  1. Home Assistantインスタンスにログインする
  2. プロフィール(左下)をクリックします
  3. 「長期アクセストークン」までスクロールします。
  4. わかりやすい名前で新しいトークンを作成する
  5. トークンの値をコピーします(再度表示されません)

使用法

スタンドアロンサーバーとして実行

# Standard mode (requires a running Home Assistant instance) home-assistant-mcp-server # Start with HTTP/SSE transport home-assistant-mcp-server --stdio # Start with stdio transport for direct process communication # Demo mode (with mock data when Home Assistant is unavailable) home-assistant-mcp-server --mock # Start with HTTP/SSE transport and mock data home-assistant-mcp-server --stdio --mock # Start with stdio transport and mock data

Claude Desktopとの統合

Claude Desktop で使用するには:

  1. Claude Desktop の設定ファイルを編集します。
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. サーバー構成を追加します。
{ "mcpServers": { "homeassistant": { "command": "home-assistant-mcp-server" "env": { "HASS_URL": "http://your-home-assistant:8123", "HASS_TOKEN": "your_token_here", "HASS_MOCK": "true" } } } }

Home Assistant を実行している場合は、 --mockフラグを削除し、 HASS_MOCK falseに設定するだけです。

  1. Claudeデスクトップを再起動します

利用可能なツール

サーバーは、Home Assistant と対話するためのいくつかのツールを公開します。

  • states - エンティティの状態を照会する
  • lights - ライトの一覧
  • light - ライトを制御する
  • service - ホームアシスタントサービスに電話する
  • history - 履歴エンティティデータを取得する
  • services - 利用可能なサービスを一覧表示する
  • config - Home Assistantの設定を取得する
  • domains - 利用可能なドメインの一覧
  • error_log - Home Assistant のエラーログを取得する
  • devices - Home Assistantですべてのデバイスを取得する

詳細な使用例については、 docs/hass-mcp.md を参照してください。

安全

このサーバーには、フルアクセス権限を持つHome Assistantアクセストークンが必要です。以下のセキュリティ推奨事項にご留意ください。

  • 信頼できるネットワーク上でのみサーバーを実行する
  • サーバーをリモートで公開する場合はHTTPSを使用する
  • .envファイルを安全に保ち、ソース管理にコミットしないでください。
  • 可能な場合は、権限が制限されたトークンの使用を検討してください

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

大規模な言語モデルが自然言語による対話を通じて Home Assistant スマート ホーム システムを制御およびクエリできるようにするモデル コンテキスト プロトコル サーバー。

  1. 特徴
    1. インストール
      1. 構成
        1. 環境変数
      2. 使用法
        1. スタンドアロンサーバーとして実行
        2. Claude Desktopとの統合
      3. 利用可能なツール
        1. 安全
          1. ライセンス

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              Expose all Home Assistant voice intents through a Model Context Protocol Server allowing home control.
              Last updated -
              30
              Python
              Apache 2.0
            • A
              security
              A
              license
              A
              quality
              A server that enables interaction with Home Assistant devices and automations through the Model Context Protocol, allowing users to monitor device states, control devices, trigger automations, and list entities.
              Last updated -
              4
              29
              JavaScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.
              Last updated -
              2
              Python
              • Apple
              • Linux
            • -
              security
              A
              license
              -
              quality
              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.
              Last updated -
              Python
              MIT License
              • Apple

            View all related MCP servers

            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/oleander/home-assistant-mcp-server'

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