Home Assistant MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows to interact with Home Assistant devices, including getting device states, controlling device states (on/off), triggering automations, and listing available entities

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

Home Assistantと連携するためのモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、MCP対応アプリケーションを通じてHome Assistantデバイスを制御および監視するためのツールを提供します。

このプロジェクトは、AIモデルコンテキストプロトコル(MCP)エコシステムの一部です。MCPツールに関する詳細情報とドキュメントについては、 www.aimcp.infoをご覧ください。

特徴

  • デバイスの状態を取得する
  • 制御デバイスの状態(オン/オフ)
  • 自動化をトリガーする
  • 利用可能なエンティティの一覧

インストール

  1. このリポジトリをクローンします:
git clone https://github.com/yourusername/homeassistant-server-mcp.git cd homeassistant-server-mcp
  1. 依存関係をインストールします:
npm install
  1. プロジェクトをビルドします。
npm run build
  1. MCP 設定ファイル (通常、VSCode の場合は~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonにあります) に次のコードを追加して、MCP サーバーを構成します。
{ "mcpServers": { "homeassistant": { "command": "node", "args": ["/path/to/homeassistant-mcp/homeassistant-server/build/index.js"], "env": { "HA_URL": "http://your-homeassistant-url:8123", "HA_TOKEN": "your-long-lived-access-token" } } } }

your-homeassistant-urlyour-long-lived-access-token Home Assistant インスタンスの URL とアクセス トークンに置き換えます。

使用法

サーバーは次のツールを提供します。

1. デバイスの状態を取得する

// Example usage use_mcp_tool({ server_name: "homeassistant", tool_name: "get_state", arguments: { entity_id: "light.living_room" } });

2. デバイスの状態を切り替える

// Example usage use_mcp_tool({ server_name: "homeassistant", tool_name: "toggle_entity", arguments: { entity_id: "switch.bedroom", state: "on" // or "off" } });

3. トリガーオートメーション

// Example usage use_mcp_tool({ server_name: "homeassistant", tool_name: "trigger_automation", arguments: { automation_id: "automation.morning_routine" } });

4. リストエンティティ

// Example usage use_mcp_tool({ server_name: "homeassistant", tool_name: "list_entities", arguments: { domain: "light" // optional, filters by domain } });

貢献

貢献を歓迎します!ご協力いただける方法は次のとおりです。

  1. リポジトリをフォークする
  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature
  3. 変更をコミットします ( git commit -m 'Add some amazing feature' )
  4. ブランチにプッシュする ( git push origin feature/amazing-feature )
  5. プルリクエストを開く

必要に応じてテストを更新し、既存のコード スタイルに従ってください。

ドキュメント

MCP ツールとエコシステムに関する詳細なドキュメントについては、以下を参照してください。

  • www.aimcp.infoをご覧ください
  • ウェブサイトのMCPツールディレクトリを確認してください
  • 統合ガイドとベストプラクティスを読む

ライセンス

このプロジェクトは MIT ライセンスの下でライセンスされています - 詳細については以下を参照してください:

MIT License Copyright (c) 2024 homeassistant-mcp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

安全

このサーバーを安全に使用するには:

  1. Home Assistantインスタンスでは常にHTTPSを使用してください
  2. アクセストークンを安全に保ち、バージョン管理にコミットしないでください。
  3. アクセストークンを定期的にローテーションする
  4. 機密情報には環境変数を使用する

サポート

問題が発生した場合やご質問がある場合は、以下をご覧ください。

  1. リポジトリ内の既存の問題を確認する
  2. 問題が報告されていない場合は、新しい問題を作成してください
  3. 問題を報告するときは、できるだけ多くのコンテキストを提供してください
  4. 追加のサポートリソースについては、 www.aimcp.infoをご覧ください。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

モデル コンテキスト プロトコルを介して Home Assistant デバイスおよび自動化とのやり取りを可能にするサーバー。これにより、ユーザーはデバイスの状態を監視したり、デバイスを制御したり、自動化をトリガーしたり、エンティティを一覧表示したりできるようになります。

  1. Features
    1. Installation
      1. Usage
        1. 1. Get Device State
        2. 2. Toggle Device State
        3. 3. Trigger Automation
        4. 4. List Entities
      2. Contributing
        1. Documentation
          1. License
            1. Security
              1. Support
                ID: io8m0yc5wq