hass-mcp-server
by ganhammar·★ 34·综合分 44
Home Assistant MCP 服务器,支持 HTTP 传输协议,可通过 OAuth 或长期令牌远程访问。
概述
这个 MCP 服务器使 AI 助手如 Claude 能够通过 HTTP 传输与 Home Assistant 交互,提供 OAuth 和长期令牌两种认证方式。它提供对 Home Assistant 功能的全面访问,包括实体管理、自动化控制、配置文件管理、仪表板操作和系统管理。该服务器专门需要 OAuth 2.0 认证的基于 Web 的 AI 客户端设计,满足了官方仅支持 SSE 的集成未能满足的需求。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
如果您需要通过 Claude.ai 或任何基于 Web 的 AI 助手远程访问 Home Assistant,特别是需要 OAuth 认证时,请选择此方案。
什么时候不要选它
如果您只需要使用 SSE 传输的本地访问 Home Assistant,或者更喜欢官方的 Home Assistant MCP 集成,请不要选择此方案。
此 server 暴露的工具
从 README 抽取出 12 个工具get_stateGet the current state of any entity
list_entitiesList all entities with optional domain filter
call_serviceCall any Home Assistant service
list_automationsList all automations with full configuration
get_automation_configGet full configuration of a single automation
create_automationCreate a new automation
list_dashboardsList all Lovelace dashboards with metadata
get_dashboard_configGet full dashboard configuration
list_config_filesList all YAML files in the config directory
get_system_statusGet system overview including version, domain counts, and entity totals
list_devicesList devices, optionally filtered by area
list_servicesList available services, optionally filtered by domain
可对比工具
安装
安装
HACS(推荐)
- 在 Home Assistant 中打开 HACS
- 搜索 "MCP Server"
- 点击 "Download"
- 重启 Home Assistant
- 配置集成
Claude Desktop 集成
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["@modelcontextprotocol/server-homeassistant"],
"env": {
"HOME_ASSISTANT_URL": "https://your-home-assistant.com",
"HOME_ASSISTANT_TOKEN": "your-long-lived-token"
}
}
}
}FAQ
- 如何列出所有自动化、场景或脚本?
- 使用专用列表工具:`list_automations()`、`list_scenes()` 或 `list_scripts()` 获取完整配置。
- OAuth 和长期令牌认证有什么区别?
- OAuth 用于像 Claude 这样的基于浏览器的客户端,需要 hass-oidc-server 集成。长期令牌用于本地客户端,无需额外依赖即可使用。
hass-mcp-server 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。