netixc/homeassistant-server-mcp
If you are the rightful owner of homeassistant-server-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server designed to facilitate interaction with Home Assistant, enabling control and monitoring of smart home devices through MCP-enabled applications.
get_state
Get entity states
toggle_entity
Toggle entities on/off
trigger_automation
Trigger automations
run_script
Run scripts
list_entities
List available entities
control_light
Advanced light control
send_remote_command
Send remote commands
launch_app
Launch apps on devices
open_streaming_app
Quick streaming app launcher
activate_scene
Activate scenes
list_scenes
List available scenes
control_media_player
Control media players
get_media_player_state
Get media player state
send_notification
Send notifications
list_notify_services
List notification services
get_sensor_data
Get sensor data
list_sensors
List all sensors
call_service
Call any HA service
list_services
List available services
render_template
Render templates
get_events
Get recent events
fire_event
Fire custom events
backup_management
Manage backups
system_info
Get system information
manage_todo_lists
Manage to-do lists
manage_shopping_list
Manage shopping list
Home Assistant MCP Server
A Model Context Protocol (MCP) server for interacting with Home Assistant. This server provides tools to control and monitor your Home Assistant devices through MCP-enabled applications.
Features
Core Device Control
- Get device states for any Home Assistant entity
- Control device states (on/off) for switches, lights, etc.
- Advanced light control with brightness, RGB colors, and color temperature
- List available entities with optional domain filtering
Entertainment & Media Control
- Send remote control commands to TV/Android TV devices
- Launch apps by package name on smart devices
- Quick streaming app launcher (Plex, YouTube, Netflix, Prime Video, Disney+)
Automation & Scripts
- Trigger Home Assistant automations
- Run Home Assistant scripts
Installation
- Clone this repository:
git clone https://github.com/netixc/homeassistant-server-mcp.git
cd homeassistant-server-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
- Configure the MCP server by adding the following to your MCP settings file (typically located at
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
for VSCode):
{
"mcpServers": {
"homeassistant": {
"command": "node",
"args": ["/path/to/homeassistant-server-mcp/build/index.js"],
"env": {
"HA_URL": "http://your-homeassistant-url:8123",
"HA_TOKEN": "your-long-lived-access-token"
}
}
}
}
Replace your-homeassistant-url
and your-long-lived-access-token
with your Home Assistant instance URL and access token.
Selective Tool Loading
You can optionally enable only specific tools by using the --tools
parameter:
{
"mcpServers": {
"homeassistant": {
"command": "node",
"args": [
"/path/to/homeassistant-server-mcp/build/index.js",
"--tools=get_state,toggle_entity,trigger_automation,run_script,list_entities,control_light,send_remote_command,launch_app,open_streaming_app,activate_scene,list_scenes,control_media_player,get_media_player_state,send_notification,list_notify_services,get_sensor_data,list_sensors,call_service,list_services,render_template,get_events,fire_event,backup_management,system_info,manage_todo_lists,manage_shopping_list"
],
"env": {
"HA_URL": "http://your-homeassistant-url:8123",
"HA_TOKEN": "your-long-lived-access-token"
}
}
}
}
Available tools:
get_state
- Get entity statestoggle_entity
- Toggle entities on/offtrigger_automation
- Trigger automationsrun_script
- Run scriptslist_entities
- List available entitiescontrol_light
- Advanced light controlsend_remote_command
- Send remote commandslaunch_app
- Launch apps on devicesopen_streaming_app
- Quick streaming app launcheractivate_scene
- Activate sceneslist_scenes
- List available scenescontrol_media_player
- Control media playersget_media_player_state
- Get media player statesend_notification
- Send notificationslist_notify_services
- List notification servicesget_sensor_data
- Get sensor datalist_sensors
- List all sensorscall_service
- Call any HA servicelist_services
- List available servicesrender_template
- Render templatesget_events
- Get recent eventsfire_event
- Fire custom eventsbackup_management
- Manage backupssystem_info
- Get system informationmanage_todo_lists
- Manage to-do listsmanage_shopping_list
- Manage shopping list
If no --tools
parameter is provided, all tools will be enabled.
Usage
The server provides the following tools:
Device Control Tools
Get Device State
Get the current state of any Home Assistant entity.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "get_state",
arguments: {
entity_id: "light.living_room"
}
});
Toggle Entity
Turn any entity on or off.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "toggle_entity",
arguments: {
entity_id: "switch.bedroom",
state: "on" // or "off"
}
});
Advanced Light Control
Control lights with brightness, color, and color temperature.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "control_light",
arguments: {
entity_id: "light.living_room",
state: "on",
brightness: 200,
rgb_color: [255, 100, 50],
color_temp: 300
}
});
List Entities
List all available entities, optionally filtered by domain.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "list_entities",
arguments: {
domain: "light" // optional, filters by domain
}
});
Entertainment & Remote Control Tools
Send Remote Command
Send remote control commands to TV/Android TV devices.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "send_remote_command",
arguments: {
entity_id: "remote.tv",
command: "DPAD_UP" // Navigation, volume, media controls, etc.
}
});
Launch App
Launch specific apps on smart devices.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "launch_app",
arguments: {
entity_id: "remote.tv",
activity: "com.plexapp.android"
}
});
Quick Streaming Apps
One-click launch of popular streaming services.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "open_streaming_app",
arguments: {
entity_id: "remote.tv",
app: "netflix" // plex, youtube, netflix, prime, disney
}
});
Automation Tools
Trigger Automation
Run Home Assistant automations.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "trigger_automation",
arguments: {
automation_id: "automation.morning_routine"
}
});
Run Script
Execute Home Assistant scripts.
use_mcp_tool({
server_name: "homeassistant",
tool_name: "run_script",
arguments: {
script_id: "script.open_plex"
}
});
Important Notes
Shopping List Implementation
The shopping list functionality in this server uses Home Assistant's todo service rather than the legacy shopping list REST API. This provides better compatibility with modern Home Assistant installations where the shopping list is implemented as a todo entity.
All shopping list operations (add, update, remove, get) use the todo service calls:
todo.add_item
- Add items to the shopping listtodo.update_item
- Update existing items (mark complete/incomplete, rename)todo.remove_item
- Remove items from the shopping listtodo.get_items
- Get all items from the shopping list
Shopping List Tool:
manage_shopping_list
- Works specifically with the default Home Assistant shopping list (todo.shopping_list
)
For Custom Todo Lists: Use the existing manage_todo_lists
tool for managing todo list entities themselves, and the call_service
tool to interact with items in custom lists using the todo service calls.
This ensures reliable functionality and avoids HTTP 405 errors that can occur with the legacy REST API endpoints.
License
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2024 homeassistant-mcp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Security
To securely use this server:
- Always use HTTPS for your Home Assistant instance
- Keep your access tokens secure and never commit them to version control
- Regularly rotate your access tokens
- Use environment variables for sensitive information