Home Assistant MCP
This MCP server enables AI assistants to control Home Assistant smart home devices through natural language commands.
Capabilities:
Search for devices - Find Home Assistant entities using natural language descriptions (e.g., "office light", "kitchen fan") to discover their entity IDs and friendly names
Control device power - Turn any Home Assistant entity on or off by specifying its entity ID and desired state
Set light colors - Change RGB colors of compatible light entities using red, green, and blue values (0-255)
Adjust brightness - Control light brightness levels (0-255) when setting colors or independently
Two-step workflow - Search for entities using natural language, then control them using their specific entity IDs
Requirements:
Home Assistant instance accessible via API
Long-Lived Access Token for authentication
Python 3.11 or higher
Allows AI assistants to control Home Assistant devices, providing tools to search for entities in a Home Assistant instance and control devices (turn them on/off) through the Home Assistant API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Home Assistant MCPturn on the living room lights"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Home Assistant MCP
A Model Context Protocol (MCP) integration for controlling Home Assistant devices using AI assistants.
Overview
This MCP allows AI assistants to control your Home Assistant devices. It provides tools to:
Search for entities in your Home Assistant instance
Control devices (turn them on/off)
Control light colors and brightness
Related MCP server: Hass-MCP
Prerequisites
Python 3.11 or higher
Home Assistant instance running and accessible via API
Home Assistant Long-Lived Access Token
Installation
Installing via Smithery
To install Home Assistant Integration for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @hpohlmann/home-assistant-mcp --client claudeManual Installation
Clone this repository
Set up a Python environment:
cd home-assistant
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -U pip
pip install uv
uv pip install -e .Configuration
Get a Home Assistant Long-Lived Access Token
Go to your Home Assistant instance
Navigate to your profile (click on your username in the sidebar)
Scroll down to "Long-Lived Access Tokens"
Create a new token with a descriptive name like "MCP Integration"
Copy the token (you'll only see it once)
Set up in Cursor AI
Add the following configuration to your MCP configuration in Cursor:
{
"mcpServers": {
"home_assistant": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/home-assistant-mcp",
"run",
"main.py"
],
"env": {
"HOME_ASSISTANT_TOKEN": "your_home_assistant_token_here"
},
"inheritEnv": true
}
}
}Replace:
/path/to/your/home-assistantwith the actual path to this directoryyour_home_assistant_token_herewith your Home Assistant Long-Lived Access Token
Home Assistant URL Configuration
By default, the MCP tries to connect to Home Assistant at http://homeassistant.local:8123.
If your Home Assistant is at a different URL, you can modify the HA_URL variable in app/config.py.
Usage
Once configured, you can use Cursor AI to control your Home Assistant devices:
Search for devices: "Find my living room lights"
Control devices: "Turn on the kitchen light"
Control light colors: "Set my living room lights to red"
Adjust brightness: "Set my dining room lights to blue at 50% brightness"
Light Control Features
The MCP now supports advanced light control capabilities:
Color Control: Set any RGB color for compatible lights
Specify colors using RGB values (0-255 for each component)
Example:
set_device_color("light.living_room", 255, 0, 0)for red
Brightness Control: Adjust light brightness
Optional brightness parameter (0-255)
Can be combined with color changes
Example:
set_device_color("light.dining_room", 0, 0, 255, brightness=128)for medium-bright blue
Troubleshooting
If you get authentication errors, verify your token is correct and has not expired
Check that your Home Assistant instance is reachable at the configured URL
For color control issues:
Verify that your light entity supports RGB color control
Check that the light is turned on before attempting to change colors
Future Capabilities
Dynamic Entity Exposure
The current implementation requires a two-step process to control devices:
Search for entities using natural language
Control the entity using its specific entity_id
A planned enhancement is to create a more dynamic way to expose entities to the control devices tool, allowing the AI to:
Directly control devices through more natural commands (e.g., "turn off the kitchen lights")
Cache frequently used entities for faster access
Support more complex operations like adjusting brightness, temperature, or other attributes
Handle entity groups and scenes more intuitively
This would significantly reduce the time to action and create a more seamless user experience when controlling Home Assistant devices through an AI assistant.
Available Tools
3 toolscontrol_deviceB
Control a Home Assistant entity by turning it on or off.
Args:
entity_id: The Home Assistant entity ID to control (format: domain.entity)
state: The desired state ('on' or 'off')
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | Yes | ||
| state | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('turning it on or off') but lacks critical details: it doesn't mention permissions required, whether this is a destructive operation (e.g., if turning off a device has irreversible effects), rate limits, error handling, or what happens upon success/failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded: the first sentence states the core purpose, and the 'Args' section efficiently documents parameters without unnecessary details. Every sentence earns its place, making it easy to scan and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (2 parameters, mutation operation, no output schema), the description is partially complete. It covers the basic purpose and parameter semantics but lacks behavioral details (e.g., side effects, permissions) and usage guidelines. Without annotations or output schema, it leaves gaps that could hinder an agent's ability to use the tool effectively in varied contexts.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful semantics beyond the input schema, which has 0% description coverage. It explains that 'entity_id' is a Home Assistant entity ID with a specific format ('domain.entity') and that 'state' accepts 'on' or 'off' values. This clarifies the purpose and constraints of both parameters, compensating well for the schema's lack of descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Control a Home Assistant entity by turning it on or off.' This specifies the verb ('control'), resource ('Home Assistant entity'), and action ('turning it on or off'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'set_device_color' (which might control color instead of on/off state), so it misses the highest score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'search_entities' (which might be for finding entities) or 'set_device_color' (which might control color settings), nor does it specify prerequisites, exclusions, or contextual cues for usage. This leaves the agent with minimal direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_entitiesA
Search for Home Assistant entities matching a natural language description.
Args:
description: Natural language description of the entity (e.g., "office light", "kitchen fan")
Returns:
A list of matching entity IDs with their friendly names, or an error message
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the search operation and return format (list of entity IDs with friendly names or error message), which adds useful context. However, it lacks details on permissions, rate limits, or error conditions, leaving some behavioral aspects unspecified for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with a clear purpose statement followed by structured sections for arguments and returns. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, parameter semantics, and return values adequately. However, it could benefit from more behavioral details (e.g., search scope, limitations) to fully compensate for the lack of annotations and output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant meaning beyond the input schema, which has 0% coverage. It explains the 'description' parameter as a natural language description with examples ('office light', 'kitchen fan'), clarifying its purpose and format. This compensates well for the schema's lack of documentation, though it doesn't cover all possible edge cases.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Search') and resource ('Home Assistant entities'), and distinguishes it from siblings by focusing on search functionality rather than control or configuration. It specifies the search is based on natural language descriptions, which is a distinct operation from the sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool (searching for entities by natural language description), but does not explicitly mention when not to use it or name alternatives. It implies usage for discovery purposes, which is helpful but lacks explicit exclusions or comparisons to sibling tools like control_device or set_device_color.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_device_colorA
Set the color and optionally brightness of a light entity.
Args:
entity_id: The Home Assistant entity ID to control (format: light.entity)
red: Red component (0-255)
green: Green component (0-255)
blue: Blue component (0-255)
brightness: Optional brightness level (0-255)
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | Yes | ||
| red | Yes | ||
| green | Yes | ||
| blue | Yes | ||
| brightness | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a write operation ('Set') but doesn't mention permissions, side effects, error conditions, or response format. While it specifies the action, it lacks critical behavioral details like whether this requires authentication, what happens on invalid inputs, or if changes are reversible.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose in the first sentence, followed by a structured parameter list. Every sentence earns its place by clarifying parameter details without redundancy. It's appropriately sized for a tool with multiple parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description covers the action and parameters well but lacks behavioral context (e.g., error handling, permissions) and return values. For a write operation with 5 parameters, this is minimally adequate but leaves gaps in understanding full tool behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully compensate. It provides clear semantics for all 5 parameters: entity_id format ('light.entity'), RGB component ranges (0-255), and brightness as optional with range. This adds essential meaning beyond the bare schema, which only shows types and titles without context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Set the color and optionally brightness') and target resource ('a light entity'), distinguishing it from sibling tools like 'control_device' (more generic) and 'search_entities' (read-only). The verb 'set' is precise and indicates a write operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for controlling light color/brightness but doesn't explicitly state when to use this tool versus 'control_device' (which might handle other device types or operations) or 'search_entities' (for discovery). No explicit alternatives, prerequisites, or exclusions are provided, leaving usage context somewhat ambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v1.0.0- Changed
control_device1 field changed- added
Input schema / titleAdded value: +"control_deviceArguments"
- Changed
search_entities1 field changed- added
Input schema / titleAdded value: +"search_entitiesArguments"
- Changed
set_device_color1 field changed- added
Input schema / titleAdded value: +"set_device_colorArguments"
3 tool updates
- First observed
control_device - First observed
search_entities - First observed
set_device_color
TDQS
Each tool has a clearly distinct purpose with no overlap. control_device handles basic on/off states, search_entities finds devices by description, and set_device_color manages color/brightness for lights. An agent can easily distinguish when to use each tool based on the specific operation needed.
All three tools follow a consistent verb_noun pattern with snake_case throughout: control_device, search_entities, and set_device_color. The naming is predictable and follows the same grammatical structure, making the tool set easy to understand at a glance.
With only 3 tools, this feels thin for a Home Assistant integration that presumably manages many device types and operations. While the tools cover basic control, search, and color settings, the scope suggests more operations would be needed for comprehensive home automation coverage. The count is borderline minimal for the domain.
There are significant gaps in the tool surface for home automation. Missing operations include getting device status/state, adjusting non-color attributes (like temperature for thermostats or speed for fans), managing scenes/automations, and handling other entity types beyond lights. The current tools provide only partial coverage of the Home Assistant domain.
Maintenance
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
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
- ZapierOAuthcom.zapier
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.3MIT
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.16337MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows large language models to control and query Home Assistant smart home systems through natural language interactions.1095MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control Home Assistant devices and services through the Model Context Protocol.105MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/hpohlmann/home-assistant-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server