
paulomac1000/ha-mcp-readonly
API developmentこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
paulomac1000/ha-mcp-readonly は [https://github.com/paulomac1000/ha-mcp-readonly.] からインポートされた MCP サーバーの候補です
概要
paulomac1000/ha-mcp-readonly は [https://github.com/paulomac1000/ha-mcp-readonly.] からインポートされた MCP サーバーの候補です
概要(AI 翻訳)
ホームアシスタント用のMCP(Model Context Protocol)サーバーを読み取り専用 AI アシスタント (デスクトップ、LibreChat、Cline) をスマート ホームにフル オブザベーシビリティ — 実体の状態、自動化、スクリプト、デバイス、ログ、診断 — 書き込みアクセスなし。 また、カスタムナレッジファイルを受け入れるRAGシステム、ChatGPTプロジェクト、Qwenなどのツール用の静的なAIコンテキストスナップショットを生成します。 Python で構築され、ローカル、Docker 、または MCP の統合として、どこでも実行できます。
要件
- Python 3.11+ (ローカル使用のために) または Docker
- 長期アクセストークンを持つホームアシスタントインスタンス
- あなたのHAプロファイルで1を作成します:設定→セキュリティ→ロングライブアクセストークン
- ホームアシスタントコンフィグディレクトリへのアクセス(ファイルシステムツール用)
クイックスタート
##1. 環境の設定
[.env]を認証情報で編集します。
重要: [.env]ファイルには、アクセストークンが含まれています。 決して約束されてはならない。
##2. Dockerで実行する
まず、資格情報の設定を行います。 [.envファイル(推奨)、または直接変数を渡します。
Option A — [.env]ファイルとドッカーコンポース:
含まれている `docker-compose.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
HA-MCP-Readonly
Read-only MCP (Model Context Protocol) server for Home Assistant. Gives AI assistants (Claude Desktop, LibreChat, Cline) full observability into your smart home — entity states, automations, scripts, devices, logs, diagnostics — without any write access. Also generates static AI context snapshots for RAG systems, ChatGPT Projects, Qwen, and other tools that accept custom knowledge files. Built in Python, runs anywhere — locally, in Docker, or as an MCP integration.
Requirements
- Python 3.11+ (for local use) or Docker
- A Home Assistant instance with a long-lived access token
- Create one in your HA profile: Settings → Security → Long-Lived Access Tokens
- Access to your Home Assistant config directory (for filesystem tools)
Quick Start
1. Configure environment
cp .env.example .env
Edit .env with your credentials:
HA_URL=http://your-ha-ip:8123
HA_TOKEN=your_long_lived_access_token_here
# HA_CONFIG_PATH=/config # optional, default shown
# MCP_DEV_TOOLS_ENABLED=1 # optional, default shown
# HEALTH_CHECK_PORT=9091 # optional, default shown
# MCP_PORT=9092 # Streamable HTTP port when enabled
# REST_API_PORT=9093 # optional, default shown
# RUN_TESTS_ON_STARTUP=0 # optional, default shown
# OUTPUT_PATH=/app/output/ha-ai-context.md # optional, default shown
IMPORTANT: The .env file contains your access token. It is gitignored and must never be committed.
2. Run with Docker
First, configure your credentials. Either use a .env file (recommended) or pass variables directly.
Option A — with .env file and docker compose:
cp .env.example .env
# edit .env with your HA_URL and HA_TOKEN
docker compose up -d
The included docker-compose.yml pulls the image from GitHub Container Registry and mounts your HA config read-only:
services:
ha-mcp-readonly:
image: ghcr.io/paulomac1000/ha-mcp-readonly:latest
container_name: ha-mcp-readonly
env_file: .env
environment:
MCP_TRANSPORT: http
MCP_BIND_HOST: 0.0.0.0
MCP_AUTH_TOKEN: ${MCP_AUTH_TOKEN:?Set a strong MCP_AUTH_TOKEN}
ports:
- "127.0.0.1:9091:9091" # health
- "127.0.0.1:9092:9092" # authenticated Streamable HTTP MCP
volumes:
インストール
docker run -d \設定
{
"mcpServers": {
"ha-mcp-readonly": {
"command": "ha-mcp-readonly",
"env": {
"HA_URL": "http://homeassistant.local:8123",
"HA_TOKEN": "replace-with-a-long-lived-access-token",
"HA_CONFIG_PATH": "/path/to/home-assistant/config"
}
}
}
}