Home Assistant MCP Server
Configuration
View docs{
"mcpServers": {
"voska-hass-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"HA_URL",
"-e",
"HA_TOKEN",
"voska/hass-mcp"
],
"env": {
"HA_URL": "http://homeassistant.local:8123",
"HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
}
}
}
}You can run Hass-MCP as a local MCP server that lets Claude and other LLMs interact with your Home Assistant instance. It exposes Home Assistant data and actions through a lean, token-efficient interface, enabling you to query device states, control entities, explore automations, and troubleshoot your smart home workflows from your AI assistant.
Use Hass-MCP with an MCP client to perform common Home Assistant tasks through natural prompts. You can ask it to check the current state of devices, turn lights on or off, search for entities by name or domain, list automations, or create guided conversations for automations. The responses are designed to be concise to save tokens while still giving you the information you need.
Prerequisites you need before starting:
Choose one setup path and follow the steps below.
docker pull voska/hass-mcp:latestConfigure Hass-MCP as a stdio MCP server via Docker and connect it to Claude Desktop. The following configuration runs the MCP server container and exposes the required environment variables.
{
"mcpServers": {
"hass-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"HA_URL",
"-e",
"HA_TOKEN",
"voska/hass-mcp"
],
"env": {
"HA_URL": "http://homeassistant.local:8123",
"HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
}
}
}
}Install uv on your system and run Hass-MCP through uvx. This path is lightweight and suitable for local development or minimal deployments.
{
"mcpServers": {
"hass-mcp": {
"command": "uvx",
"args": ["hass-mcp"],
"env": {
"HA_URL": "http://homeassistant.local:8123",
"HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
}
}
}
}If you run Home Assistant on a different machine, update the HA_URL to point to that machine’s address. Ensure the long-lived access token has the necessary permissions for the actions you intend to perform.
Ask Hass-MCP to describe the current state of your living room lights, list all temperature sensors, or create a simple automation to turn on lights at sunset. Use concise prompts to get targeted results and minimize token usage.
Treat your Home Assistant token like a secret key. Keep it in a secure environment variable and restrict access to the MCP client, especially when using shared workstations or cloud-based tooling.
Retrieve the Home Assistant version currently running in your instance.
Fetch the state of a specific entity with optional attribute filtering.
Perform actions on entities, such as turning them on, off, or toggling their state.
List entities with optional domain filtering and search terms.
Search for entities matching a query across domains.
Provide a high-level summary of entities within a domain.
List all automations in your Home Assistant setup.
Call a Home Assistant service with parameters.
Restart Home Assistant.
Retrieve the state history for an entity.
Get the Home Assistant error log.