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.
接入你的智能体
从发布者处安装。不是 PlugMCP 端点。
远程 URL 还是本机命令? 两种安装方式的区别
来自发布者
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.
Home Assistant MCP Server - Control your smart home with AI assistants via the Model Context Protocol
readOnlyHint lets clients skip confirmation prompts for safe operationsNo 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 install homeassistant-mcp
homeassistant-mcp
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
The server needs two environment variables:
Optional:
These can be set via environment variables (as shown in the MCP client configs above) or in a .env file. See .env.example.
Add to your config file:
~/Library/Application Support/Claude/claude_desktop_config.json%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"
}
}
}
}
Same config format. Place it in your client's MCP configuration file (e.g. .cursor/mcp.json, .kiro/settings/mcp.json).
The server uses stdio transport, which is the standard for MCP.
With 40 tools, the server uses BM25 search to keep the LLM's context lean. Instead of sending all 40 tool schemas upfront, the LLM sees 8 tools:
The LLM calls discover_tools() to see what's available, then search_tools(query="lights brightness") to get the full schema, then calls the tool directly.
git clone https://github.com/robbrad/homeassistant-mcp.git
cd homeassistant-mcp
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
# Run tests
pytest
# Format and lint
black src/ tests/
ruff check src/ tests/
# Type check
mypy src/
Commits to main auto-publish to PyPI via GitHub Actions + python-semantic-release:
fix: commits → patch bump (3.1.0 → 3.1.1)feat: commits → minor bump (3.1.0 → 3.2.0)BREAKING CHANGE: → major bump (3.1.0 → 4.0.0)AI Assistant <--> MCP Server (FastMCP/stdio) <--> Home Assistant REST API
|
+-----+-----+
| |
Tools Cache
Layer Layer
MIT
Home Assistant MCP Server - Control your smart home with AI assistants via the Model Context Protocol
工具
暂无工具列表。远程服务器在首次健康检查后会获得工具列表。
常见问题
在本页复制适用于 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 配置。它使用发布者的安装方式,而不是 PlugMCP 代理。
此记录未列出必需的环境变量。
Homeassistant 通过 stdio 在本地运行。
上次检查时间:2026-10-28。 Home Assistant MCP Server - Control your smart home with AI assistants via the Model Context Protocol