RH

robbrad/homeassistant-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

106 stars 6 forks 品質 74 トレンド 0MIT

robbrad/homeassistant-mcpは、[[T0]からインポートされたMCPサーバー候補です。

概要

robbrad/homeassistant-mcpは、[[T0]からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

AIアシスタントがHome Assistantを制御できるモデルコンテキストプロトコル(MCP)サーバー。PythonとFastMCPで構築。

Claude、GPT-4、Cursor、Kiro、そしてMCP互換クライアントと連携します。

それが何をするのか

  • 照明、気候、カバー、ロック、メディアプレーヤー、掃除機、扇風機、カメラ、アラームなどをカバーする40の工具**
  • BM25ツール検索 — LLMは40スキーマすべてを事前に受け取るのではなく、オンデマンドでツールを発見します
  • MCPリソース 読み取り専用エンティティ、エリア、デバイス、サービスデータ
  • MCPプロンプト:自動化作成、トラブルシューティング、エネルギー最適化などのガイド付きワークフロー
  • ツール注釈 — readOnlyHintはクライアントが確認プロンプトをスキップして安全な操作を行えるようにします
  • スマートエラーログ解析 — 生テキストをダンプする代わりにHAエラーログを重複から削除・要約します
  • コンテキスト認識応答 — コンパクトなリスト応答、ドメインフィルタクエリ、進捗報告
  • 全線非同期でTTLベースのキャッシュを用いてAPI負荷を軽減

設置

UVX(推奨)

インストールは不要です。MCPクライアントを設定するだけです:

ピップ

ソースより

構成

サーバーには2つの環境変数が必要です:

変数 説明

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Home Assistant MCP Server

A Model Context Protocol (MCP) server that lets AI assistants control Home Assistant. Built with Python and FastMCP.

Works with Claude, GPT-4, Cursor, Kiro, and any MCP-compatible client.

What it does

  • 40 tools covering lights, climate, covers, locks, media players, vacuums, fans, cameras, alarms, and more
  • BM25 tool search — LLMs discover tools on demand instead of receiving all 40 schemas upfront
  • MCP Resources for read-only entity, area, device, and service data
  • MCP Prompts for guided workflows (automation creation, troubleshooting, energy optimization)
  • Tool annotations — readOnlyHint lets clients skip confirmation prompts for safe operations
  • Smart error log parsing — deduplicates and summarises HA error logs instead of dumping raw text
  • Context-aware responses — compact list responses, domain-filtered queries, progress reporting
  • Async throughout with TTL-based caching to reduce API load

Installation

No install needed. Just configure your MCP client:

{
  "mcpServers": {
    "homeassistant": {
      "command": "uvx",
      "args": ["homeassistant-mcp"],
      "env": {
        "HASS_HOST": "http://homeassistant.local:8123",
        "HASS_TOKEN": "your_long_lived_access_token_here"
      }
    }
  }
}

pip

pip install homeassistant-mcp
homeassistant-mcp

From source

git clone https://github.com/robbrad/homeassistant-mcp.git
cd homeassistant-mcp
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -e ".[dev]"
homeassistant-mcp

Configuration

The server needs two environment variables:

Variable Description
HASS_HOST Home Assistant URL, e.g. http://homeassistant.local:8123
HASS_TOKEN Long-lived access token (how to create one)

Optional:

Variable Default Description
CACHE_TTL_STATES 30 Cache TTL for bulk state queries (seconds)
CACHE_TTL_ENTITY 10 Cache TTL for individual entity queries (seconds)
LOG_LEVEL INFO Logging level

These can be set via environment variables (as shown in the MCP client configs above) or in a .env file. See .env.example.

MCP Client Setup

Claude Desktop

Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "homeassistant": {
      "command": "uvx",
      "args": ["homeassistant-mcp"],
      "env": {
        "HASS_HOST": "http://homeassistant.local:8123",
        "HASS_TOKEN": "your_token_here"
      }
    }
  }
}

Cursor / Kiro / Other MCP Clients

GitHub で README 全文を見る

インストール

uvx homeassistant-mcp
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "homeassistant": { "command": "uvx", "args": ["homeassistant-mcp"], "env": { "HASS_HOST": "http://homeassistant.local:8123", "HASS_TOKEN": "your_long_lived_access_token_here" } } } }