Model Context Protocol
The Model Context Protocol
Controlling Home Assistant is done by providing MCP clients access to the Assist API of Home Assistant. You can control what devices and entities it can access from the exposed entities page.
Prerequisites
- You will need an MCP server
. - If your MCP server only supports the stdio protocol, you will also need an additional
MCP proxy (such as mcp-proxy
) to expose the server over SSE.
配置
要将 Model Context Protocol integration 添加到您的 Home Assistant 实例中,请使用此 My 按钮:
手动配置步骤
如果上述 My 按钮不起作用,您也可以手动执行以下步骤:
-
浏览到您的 Home Assistant 实例。
-
转到
设置 > 设备与服务。 -
在右下角,选择
Add Integration 按钮。 -
从列表中选择 Model Context Protocol。
-
按照屏幕上的说明完成设置。
Configuration options
The integration provides the following configuration options:
Architecture overview
This integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] can provide additional functionality for LLM conversation agents (for example Anthropic, Google Generative AI, Ollama, Open AI).
Home Assistant acts as a client to the MCP server you specify. Home Assistant will
poll the MCP server SSE endpoint and query the list of available tools. The tools are
made available for use by Home Assistant conversation agents, similar to the Assist API.
See the Model Context Protocol Introduction
The Home Assistant Model Context Protocol integration acts as a client using the
Server-Sent Events (SSE) transport
Once the integration is configured, you also need to configure the conversation agent to use the tools.
Supported functionality
Tools
MCP Tools
Known limitations
The Home Assistant Model Context Protocol integration currently only supports a subset of MCP features:
Feature | Supported by Home Assistant |
---|---|
Prompts | ❌ |
Tools | ✅ |
Resources | ❌ |
Sampling | ❌ |
Notifications | ❌ |
Troubleshooting
See Model Context Protocol: Debugging
Remove integration
This integration can be removed by following these steps:
从Home Assistant中移除集成实例
- 前往 设置 > 设备与服务 并选择集成卡片。
- 从设备列表中,选择要删除的集成实例。
- 在条目旁边,选择三个点
菜单。然后,选择 删除。