control_device
Control a Home Assistant entity by turning it on or off.
Find a Home Assistant entity by describing it, then switch it on or off and set an RGB colour and brightness.
LABSCO SUMMARY
Two steps rather than one is the honest shape here — the assistant has to find the entity id before it can control anything, and the README says so rather than pretending otherwise. Colour control only lands on lights that support RGB, and the light has to be on before a colour change takes. The instance URL living in a source file rather than an environment variable is the one rough edge worth knowing about up front.
A small Home Assistant bridge built around a two-step flow: search for entities in natural language, then act on the entity_id you get back. Lights get colour and brightness control on top of on/off.
Python 3.11 or higher and a reachable Home Assistant instance. It needs a Long-Lived Access Token, created from your Home Assistant profile page and passed as HOME_ASSISTANT_TOKEN. The instance address defaults to http://homeassistant.local:8123; a different address means editing HA_URL in app/config.py.
Build from source
USE CASES
Describe the device, get the matching entities back, then act on one.
RGB components go in directly, with brightness as an optional fourth value.
Brightness rides along with the colour call rather than needing a separate step.
Listed in project code.
control_deviceControl a Home Assistant entity by turning it on or off.
search_entitiesSearch for Home Assistant entities matching a natural language description.
set_device_colorSet the color and optionally brightness of a light entity.
BEFORE YOU INSTALL
3 tools registered in the project's code.
INSTALLATION
git clone https://github.com/hpohlmann/home-assistant-mcp.git
cd home-assistant-mcp
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install uv
uv pip install -e .If your Home Assistant is not at http://homeassistant.local:8123, set HA_URL in app/config.py
Add the server to Cursor with the full path of this folder after --directory
{
"mcpServers": {
"home_assistant": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_HOME_ASSISTANT_MCP>",
"run",
"main.py"
],
"env": {
"HOME_ASSISTANT_TOKEN": "<YOUR_HOME_ASSISTANT_TOKEN>"
},
"inheritEnv": true
}
}
}<YOUR_PATH_TO_HOME_ASSISTANT_MCP> is the full path of your clone, and <YOUR_HOME_ASSISTANT_TOKEN> is a Long-Lived Access Token from your Home Assistant profile page.