Skip to main content
Glama
soonnn1

mcp_ha_xiaozhi

by soonnn1

mcp_ha_xiaozhi

小智官方服务器(虾哥)对接home assistant的mcp server

原理

使用小智官方给的示例代码,结合mcp_proxy,实现小智官方服务器和home assistant的mcp server打通

参数

XIAOZHI_MCP_ENDPOINT:你的小智 MCP 接入点 HA_MCP_ENDPOINT:你的 HA MCP SERVER 地址 API_ACCESS_TOKEN:你的长效 API 令牌 MCP_TRANSPORT:autossestreamablehttp,默认 auto

  1. 小智 MCP 接入点: 登录小智官方服务器即可获取。

  2. HA MCP SERVER 地址: 可以使用旧版官方 SSE 地址,也可以使用新版 HA-MCP 的 Streamable HTTP 地址。

    • 点击此链接:Home Assistant MCP Server 集成直达安装

    • 或 在 Home Assistant 中,前往 设置 > 设备和服务 > 添加集成

    • 从列表中选择“模型上下文协议服务器”,并按照屏幕上的说明完成设置。

    • 使用新版 HA-MCP 时,填写设置页面生成的 /private_xxx 连接地址,并确保地址末尾没有空格。

  3. 长效 API 令牌: 用于授权访问你的 Home Assistant 实例。

1.1.0 代理式工具路由

本版本不再把全部 HA 工具压缩后直接发布给小智,也不需要额外的大模型。 桥接器缓存 HA-MCP 的完整工具目录,只向小智后台的模型提供三个循环工具:

  • ha_discover:根据用户目标发现相关工具和推荐执行流程。

  • ha_get_tool_help:按需读取一个真实 HA 工具的完整参数结构。

  • ha_execute:执行真实 HA 工具,并把结果交回小智模型继续判断。

复杂任务采用“发现 → 查看参数 → 执行 → 根据结果继续”的循环。例如搜索歌曲时, 桥接器会明确引导模型依次查询 music_assistant 服务、获取集成配置条目,最后调用 music_assistant.search,避免把歌曲搜索误判为普通 HA 实体搜索。

启动成功后,日志应出现:

Agentic tool router ready: 78 HA tools cached, exposing 3 loop tools to XiaoZhi

小智执行任务时,还会依次出现 Capability discoveryServing full helpAgent loop executing HA tool。这表示后台模型正在持续使用同一组工具结果完成多步任务。

docker运行

docker run -d --name mcp_ha_xiaozhi \
-e XIAOZHI_MCP_ENDPOINT="你的小智MCP接入点" \
-e HA_MCP_ENDPOINT="你的HA MCP SERVER地址" \
-e API_ACCESS_TOKEN="你的长时效API令牌" \
-e MCP_TRANSPORT=auto \
shawn68/mcp_ha_xiaozhi

https://hub.docker.com/r/shawn68/mcp_ha_xiaozhi/

新版 HA-MCP 配置示例

新版 HA-MCP 的连接地址通常是设置页面生成的私密地址,使用 Streamable HTTP:

docker run -d --name mcp_ha_xiaozhi \
  -e XIAOZHI_MCP_ENDPOINT="你的小智 MCP 接入点" \
  -e HA_MCP_ENDPOINT="http://192.168.1.8:9584/private_xxx" \
  -e MCP_TRANSPORT=streamablehttp \
  -e API_ACCESS_TOKEN="你的长期访问令牌" \
  mcp_ha_xiaozhi:local

HA_MCP_ENDPOINT 末尾不要有空格。使用 /private_xxx 私密地址时,完整地址本身就是凭据,请不要公开。

作为 Home Assistant 自定义应用安装

  1. 在 Home Assistant 的应用商店中添加本仓库地址: https://github.com/soonnn1/mcp_ha_xiaozhi-custom

  2. 找到“小智 MCP Server(新版)”并安装。

  3. 在配置中填写小智 MCP 地址和 HA-MCP 私密地址。

  4. MCP_TRANSPORT 选择 streamablehttp,然后启动应用。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Wraps the SJTU Zhiyuan No.1 API as a local MCP server, allowing direct use of SJTU models in Claude Code and Codex without custom integration scripts.
    4
    11
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    A lightweight MCP server that lets AI assistants publish notes to Xiaohongshu (Little Red Book) via browser automation. Supports login, image-text note publishing with up to 9 images, and search.
    4
    1
    -
  • A
    license
    A
    quality
    B
    maintenance
    A self-hosted MCP server for Home Assistant that exposes full control over entity states, service calls, history, templates, and areas via local stdio, enabling AI assistants to manage your smart home.
    9
    91
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/soonnn1/mcp_ha_xiaozhi-custom'

If you have feedback or need assistance with the MCP directory API, please join our Discord server