H
Home Assistant
community
ai
Docker-ready MCP server for Home Assistant with entity management, domain summaries, automation support, and guided conversations. Includes pre-built container images for easy installation.
Hass-MCP
A Model Context Protocol (MCP) server for Home Assistant integration with Claude and other LLMs.
Overview
Hass-MCP enables AI assistants like Claude to interact directly with your Home Assistant instance, allowing them to:
- Query the state of devices and sensors
- Control lights, switches, and other entities
- Get summaries of your smart home
- Troubleshoot automations and entities
- Search for specific entities
- Create guided conversations for common tasks
Screenshots
<img width="700" alt="Screenshot 2025-03-16 at 15 48 01" src="https://github.com/user-attachments/assets/5f9773b4-6aef-4139-a978-8ec2cc8c0aea" /> <img width="400" alt="Screenshot 2025-03-16 at 15 50 59" src="https://github.com/user-attachments/assets/17e1854a-9399-4e6d-92cf-cf223a93466e" /> <img width="400" alt="Screenshot 2025-03-16 at 15 49 26" src="https://github.com/user-attachments/assets/4565f3cd-7e75-4472-985c-7841e1ad6ba8" />Features
- Entity Management: Get states, control devices, and search for entities
- Domain Summaries: Get high-level information about entity types
- Automation Support: List and control automations
- Guided Conversations: Use prompts for common tasks like creating automations
- Smart Search: Find entities by name, type, or state
- Token Efficiency: Lean JSON responses to minimize token usage
Installation
Prerequisites
- Home Assistant instance with Long-Lived Access Token
- One of the following:
- Docker (recommended)
- Python 3.13+ and uv
Setting Up With Claude Desktop
Docker Installation (Recommended)
-
Pull the Docker image:
docker pull voska/hass-mcp:latest
-
Add the MCP server to Claude Desktop:a. Open Claude Desktop and go to Settings b. Navigate to Developer > Edit Config c. Add the following configuration to your
file:claude_desktop_config.json
{ "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" } } } }
d. Replace
with your actual Home Assistant long-lived access token e. Update theYOUR_LONG_LIVED_TOKEN
:HA_URL
- If running Home Assistant on the same machine: use
(Docker Desktop on Mac/Windows)http://host.docker.internal:8123
- If running Home Assistant on another machine: use the actual IP or hostname
f. Save the file and restart Claude Desktop - If running Home Assistant on the same machine: use
-
The "Hass-MCP" tool should now appear in your Claude Desktop tools menu
Note: If you're running Home Assistant in Docker on the same machine, you may need to addto the Docker args for the container to access Home Assistant. Alternatively, use the IP address of your machine instead of--network host
.host.docker.internal
Other MCP Clients
Cursor
- Go to Cursor Settings > MCP > Add New MCP Server
- Fill in the form:
- Name:
Hass-MCP
- Type:
command
- Command:
docker run -i --rm -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN voska/hass-mcp
- Replace
with your actual Home Assistant tokenYOUR_LONG_LIVED_TOKEN
- Update the HA_URL to match your Home Assistant instance address
- Name:
- Click "Add" to save
Claude Code (CLI)
To use with Claude Code CLI, you can add the MCP server directly using the
mcp add
command:Using Docker (recommended):
claude mcp add hass-mcp -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN -- docker run -i --rm -e HA_URL -e HA_TOKEN voska/hass-mcp
Replace
YOUR_LONG_LIVED_TOKEN
with your actual Home Assistant token and update the HA_URL to match your Home Assistant instance address.Usage Examples
Here are some examples of prompts you can use with Claude once Hass-MCP is set up:
- "What's the current state of my living room lights?"
- "Turn off all the lights in the kitchen"
- "List all my sensors that contain temperature data"
- "Give me a summary of my climate entities"
- "Create an automation that turns on the lights at sunset"
- "Help me troubleshoot why my bedroom motion sensor automation isn't working"
- "Search for entities related to my living room"
Available Tools
Hass-MCP provides several tools for interacting with Home Assistant:
: Get the Home Assistant versionget_version
: Get the state of a specific entity with optional field filteringget_entity
: Perform actions on entities (turn on, off, toggle)entity_action
: Get a list of entities with optional domain filtering and searchlist_entities
: Search for entities matching a querysearch_entities_tool
: Get a summary of a domain's entitiesdomain_summary_tool
: Get a list of all automationslist_automations
: Call any Home Assistant servicecall_service_tool
: Restart Home Assistantrestart_ha
: Get the state history of an entityget_history
: Get the Home Assistant error logget_error_log
Prompts for Guided Conversations
Hass-MCP includes several prompts for guided conversations:
: Guide for creating Home Assistant automations based on trigger typecreate_automation
: Troubleshooting help for automations that aren't workingdebug_automation
: Diagnose issues with entitiestroubleshoot_entity
: Analyze usage patterns and suggest optimized routines based on actual behaviorroutine_optimizer
: Review all automations, find conflicts, redundancies, or improvement opportunitiesautomation_health_check
: Audit entity names and suggest standardization improvementsentity_naming_consistency
: Create optimized dashboards based on user preferences and usage patternsdashboard_layout_generator
Available Resources
Hass-MCP provides the following resource endpoints:
: Get the state of a specific entityhass://entities/{entity_id}
: Get detailed information about an entity with all attributeshass://entities/{entity_id}/detailed
: List all Home Assistant entities grouped by domainhass://entities
: Get a list of entities for a specific domainhass://entities/domain/{domain}
: Search for entities matching a query with custom result limithass://search/{query}/{limit}
Development
Running Tests
uv run pytest tests/
License
Related Servers

AgentQL
official
Enable AI agents to get structured data from unstructured web with [AgentQL](https://www.agentql.com/).
View Details
BICScan
official
Risk score / asset holdings of EVM blockchain address (EOA, CA, ENS) and even domain names.
View DetailsChronulus AI
official
Predict anything with Chronulus AI forecasting and prediction agents.
View Details