hass-mcp-server
Provides full Home Assistant control, allowing AI agents to manage dashboards, automations, files, apps, entities, and more via REST API, WebSocket API, and SSH/SFTP.
Click on "Deploy 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., "@hass-mcp-server turn off all lights in the house"
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.
hass-mcp-server
MCP server for full Home Assistant control. AI agents (GitHub Copilot, Claude, etc.) can manage your dashboards, automations, files, apps, entities, and more — so you never have to touch HA settings yourself.
Features
Dashboard management — Create, update, delete Lovelace dashboards and deploy full dashboard configs
File management — Upload, read, list, and delete files on your HA instance via SFTP (e.g. custom cards, images, HTML files)
Automations, scripts, scenes — Full CRUD for automations, scripts, and scenes
Input helpers — Create and manage input_boolean, input_number, input_text, input_select, input_datetime, input_button, counter, and timer helpers
App management — Install, start, stop, restart, uninstall, and configure apps (add-ons)
Entity & service control — Query states, call services, render templates, browse entity/device/area registries
System tools — System info, config validation, backups, core restart, error log
Event & calendar tools — List event types, fire events, calendar queries
State management — Set, delete entity states; handle intents
66 tools across 5 categories, using three HA transport layers: REST API, WebSocket API, and SSH/SFTP.
Related MCP server: ha-mcp
Prerequisites
Home Assistant OS (or any HA installation with Supervisor)
Long-lived access token — Create one in HA → Profile → Security → Long-Lived Access Tokens
Node.js 20+
(Optional) SSH app — Required only for file management tools. Install "Advanced SSH & Web Terminal" from the app store.
Quick Start
No installation needed — your MCP client runs the server automatically via npx. Just add the configuration to your client and you're ready to go.
Configuration
The server is configured through environment variables set in your MCP client's configuration file. The client injects these into the server process at launch time — you never need to set system-wide environment variables.
Required Variables
Variable | Description | Example |
| Home Assistant base URL |
|
| Long-lived access token | (from HA Profile → Security) |
Optional Variables (for file management)
File management tools require SSH access. See Setting Up SSH below.
Variable | Description | Example |
| SSH hostname |
|
| SSH port (default: |
|
| SSH username (must be |
|
| Path to SSH private key | See examples per OS |
| SSH password (alternative to key) | (your password) |
Getting a Long-Lived Access Token
Open your Home Assistant UI
Click your profile icon (bottom-left)
Scroll to Long-Lived Access Tokens under the Security tab
Click Create Token, give it a name, and copy the token
MCP Client Setup
Choose the setup for your MCP client below. In each case, add the configuration and the client will automatically download and run the server via npx.
Tip: You can omit the
HA_SSH_*variables if you don't need file management tools. The server will start without SFTP and only fail if you try to use a file tool.
VS Code (GitHub Copilot)
Option A: Install the extension (recommended)
The easiest way — install the Home Assistant MCP Server extension from the VS Code Marketplace. It registers the MCP server automatically and stores your credentials securely.
Install the extension from the Marketplace (or search "Home Assistant MCP Server" in the Extensions view).
Set your Home Assistant URL in Settings →
homeAssistantMcp.url.Run "Home Assistant MCP: Set Access Token" from the Command Palette (
Ctrl+Shift+P).The MCP server appears in Copilot Chat automatically.
For file management, configure the SSH settings (homeAssistantMcp.ssh.*) and optionally run "Home Assistant MCP: Set SSH Password".
Option B: One-click install via mcp.json
Click the badge at the top of this README, or use the link below. VS Code will prompt you for your Home Assistant URL and access token.
Option C: Manual mcp.json setup
Create .vscode/mcp.json in your workspace (or add to your User Settings for global access):
{
"inputs": [
{
"type": "promptString",
"id": "ha-url",
"description": "Home Assistant base URL (e.g. http://homeassistant.local:8123)"
},
{
"type": "promptString",
"id": "ha-token",
"description": "Home Assistant long-lived access token",
"password": true
}
],
"servers": {
"home-assistant": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jarahkon/hass-mcp-server@latest"],
"env": {
"HA_URL": "${input:ha-url}",
"HA_TOKEN": "${input:ha-token}"
}
}
}
}With SSH (for file management tools):
{
"inputs": [
{
"type": "promptString",
"id": "ha-url",
"description": "Home Assistant base URL (e.g. http://homeassistant.local:8123)"
},
{
"type": "promptString",
"id": "ha-token",
"description": "Home Assistant long-lived access token",
"password": true
}
],
"servers": {
"home-assistant": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jarahkon/hass-mcp-server@latest"],
"env": {
"HA_URL": "${input:ha-url}",
"HA_TOKEN": "${input:ha-token}",
"HA_SSH_HOST": "homeassistant.local",
"HA_SSH_USER": "root",
"HA_SSH_KEY_PATH": "/home/you/.ssh/ha_ed25519"
}
}
}
}Claude Desktop
Edit the Claude Desktop config file:
OS | Config file path |
Windows |
|
macOS |
|
Linux |
|
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@jarahkon/hass-mcp-server@latest"],
"env": {
"HA_URL": "http://homeassistant.local:8123",
"HA_TOKEN": "your_long_lived_access_token_here"
}
}
}
}Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@jarahkon/hass-mcp-server@latest"],
"env": {
"HA_URL": "http://homeassistant.local:8123",
"HA_TOKEN": "your_long_lived_access_token_here"
}
}
}
}Other MCP Clients
Any MCP client that supports stdio servers will work. Use npx as the command with -y @jarahkon/hass-mcp-server@latest as args, and pass HA_URL and HA_TOKEN in the env block.
Setting Up SSH (for file management)
File management tools (ha_upload_file, ha_read_file, ha_list_files, etc.) require SSH access to your Home Assistant instance.
1. Install the SSH app in Home Assistant
In HA, go to Settings → Apps → App Store
Install Advanced SSH & Web Terminal
In the app configuration, set the username to
root(required for SFTP) and enablesftp: trueConfigure authentication — either set a password or add your public key to
authorized_keys(recommended)Start the app and check the logs to confirm it started successfully
2. Generate an SSH key (recommended)
Key-based authentication is more secure than passwords.
# Generate a key pair (leave passphrase empty for automated use)
ssh-keygen -t ed25519 -f ~/.ssh/ha_ed25519 -C "ha-mcp-server"This creates ~/.ssh/ha_ed25519 (private key) and ~/.ssh/ha_ed25519.pub (public key).
Add the public key contents to the app configuration in HA:
ssh:
username: root
password: ""
authorized_keys:
- "ssh-ed25519 AAAA...contents of ha_ed25519.pub..."
sftp: true3. Add SSH variables to your MCP client config
Add these environment variables alongside HA_URL and HA_TOKEN in the env block of your MCP client configuration:
"HA_SSH_HOST": "homeassistant.local",
"HA_SSH_USER": "root",
"HA_SSH_KEY_PATH": "/home/you/.ssh/ha_ed25519"Or if using password authentication:
"HA_SSH_HOST": "homeassistant.local",
"HA_SSH_USER": "root",
"HA_SSH_PASSWORD": "your_ssh_password_here"SSH key path examples
OS | Example |
Windows |
|
macOS |
|
Linux |
|
Tool Reference
Dashboards (6 tools)
Tool | Description |
| List all Lovelace dashboards |
| Create a new dashboard with url_path, title, icon |
| Update dashboard properties (title, icon, sidebar visibility) |
| Delete a dashboard by ID |
| Get the full Lovelace config JSON for a dashboard |
| Deploy a complete Lovelace config to a dashboard |
Files (7 tools) — requires SSH
Tool | Description |
| List files in a directory on HA (relative to |
| Read file contents from HA |
| Upload a local file to HA via SFTP |
| Write string content directly to a file on HA |
| Delete a file on HA (restricted to safe directories) |
| Create a directory on HA |
| Check if a file or directory exists on HA |
Automations, Scripts, Scenes & Helpers (17 tools)
Tool | Description |
| List all automations |
| Get a specific automation's config by ID |
| Create a new automation |
| Update an existing automation |
| Delete an automation |
| List all scripts |
| Create a new script |
| Update an existing script |
| Delete a script |
| List all scenes |
| Create a new scene |
| Update an existing scene |
| Delete a scene |
| List all input helpers (booleans, numbers, etc.) |
| Create an input helper of any type |
| Update an existing helper |
| Delete a helper |
Apps & System (18 tools)
Tool | Description |
| List all installed apps with status |
| Get detailed info about a specific app |
| Install an app by slug |
| Start an app |
| Stop an app |
| Restart an app |
| Uninstall an app |
| Get or set app configuration options |
| Get system info (core, OS, supervisor, host) |
| Validate HA configuration before reload |
| Create a full or partial backup |
| List all backups |
| Restart Home Assistant core |
| Check if the HA API is accessible and responding |
| Get HA configuration (location, units, version, components) |
| Update core configuration (internal/external URL, location, units) |
| List all loaded HA integrations/components |
| Get the Home Assistant error log contents |
Entities & Services (18 tools)
Tool | Description |
| Get all entity states (optionally filtered by domain) |
| Get full state and attributes of a specific entity |
| Call any HA service (turn_on, turn_off, notify, etc.) |
| List available services by domain |
| Render a Jinja2 template |
| List entities from the entity registry |
| List all devices |
| List all areas (rooms) |
| Create a new area |
| Get state history for an entity over a time period |
| Get logbook entries (activity log), optionally filtered by entity |
| List all available event types |
| Fire a custom event to trigger automations |
| Set or create an entity state (virtual sensors, overrides) |
| Delete an entity state |
| List all calendar entities |
| Get events from a specific calendar |
| Handle a conversation/voice intent |
Architecture
The server uses three transport layers to communicate with Home Assistant:
Layer | Used For | Library |
REST API ( | Service calls, states, history, templates, Supervisor proxy, automation/script/scene CRUD | Built-in |
WebSocket API ( | Dashboard CRUD, helper CRUD, entity registry |
|
SSH/SFTP | File upload/download/list/delete on HA filesystem |
|
src/
├── index.ts # MCP server entry point, registers all tools
├── config.ts # Environment variable parsing and validation
├── ha/
│ ├── rest-client.ts # REST API client with auth header
│ ├── ws-client.ts # WebSocket client with auto-reconnect
│ └── sftp-client.ts # SFTP client with path safety checks
└── tools/
├── dashboards.ts # 6 dashboard tools
├── files.ts # 7 file management tools
├── automations.ts # 17 automation/script/scene/helper tools
├── addons.ts # 18 app and system tools
└── entities.ts # 18 entity and service tools
vscode-extension/ # VS Code Marketplace extension wrapper
└── src/
└── extension.ts # Registers MCP server via mcpServerDefinitionProviders APISecurity Notes
SFTP path restrictions: Read operations are allowed anywhere under
/config/. Write and delete operations are restricted to safe subdirectories (www/,custom_components/,themes/,blueprints/,scripts/,automations/) and specific files (configuration.yaml,automations.yaml,scripts.yaml,scenes.yaml). Write operations to system directories likedeps/or.storage/are blocked.Token security: Never commit your
.envfile. The.gitignorealready excludes it.SSH authentication: Prefer SSH key-based auth (
HA_SSH_KEY_PATH) over passwords. Never commit private keys or passwords to source control.
License
MIT
Available Tools
66 toolsha_addon_infoA
Get detailed information about a specific add-on
Inputs: slug (required).
ha_addon_optionsB
Get or set configuration options for an add-on
Inputs: slug (required), options.
ha_call_serviceC
Call a Home Assistant service (e.g. turn on a light, lock a door, send a notification)
Inputs: domain (required), service (required), data, target.
ha_check_apiA
Check if the Home Assistant API is accessible and responding
Inputs: no named parameters.
ha_check_configA
Validate the Home Assistant configuration. Run this before reloading to catch errors.
Inputs: no named parameters.
ha_create_areaB
Create a new area (room) in Home Assistant
Inputs: name (required), icon.
ha_create_automationC
Create a new automation in Home Assistant
Inputs: config (required).
ha_create_backupC
Create a Home Assistant backup
Inputs: name, partial, folders, addons.
ha_create_dashboardC
Create a new Lovelace dashboard
Inputs: url_path (required), title (required), icon, require_admin, +1 more.
ha_create_helperB
Create a new input helper (input_boolean, input_number, input_text, input_select, input_datetime, input_button, counter, timer)
Inputs: domain (required), config (required).
ha_create_sceneB
Create a new scene in Home Assistant
Inputs: config (required).
ha_create_scriptB
Create a new script in Home Assistant
Inputs: object_id (required), config (required).
ha_delete_automationC
Delete an automation
Inputs: automation_id (required).
ha_delete_dashboardB
Delete a Lovelace dashboard
Inputs: dashboard_id (required).
ha_delete_fileA
Delete a file from the Home Assistant server. Path is relative to /config/. Restricted to safe directories.
Inputs: path (required).
ha_delete_helperC
Delete an input helper
Inputs: domain (required), helper_id (required).
ha_delete_sceneC
Delete a scene
Inputs: scene_id (required).
ha_delete_scriptC
Delete a script
Inputs: object_id (required).
ha_delete_stateB
Delete an entity state from Home Assistant
Inputs: entity_id (required).
ha_file_existsB
Check if a file or directory exists on the Home Assistant server. Path is relative to /config/.
Inputs: path (required).
ha_fire_eventB
Fire a custom event in Home Assistant to trigger automations or integrations
Inputs: event_type (required), event_data.
ha_get_automationA
Get the full configuration of an automation by its ID
Inputs: automation_id (required).
ha_get_calendar_eventsC
Get events from a specific calendar entity
Inputs: entity_id (required), start, end.
ha_get_calendarsA
List all calendar entities in Home Assistant
Inputs: no named parameters.
ha_get_componentsA
List all currently loaded Home Assistant integrations/components
Inputs: no named parameters.
ha_get_configA
Get the Home Assistant configuration (location, unit system, version, components, etc.)
Inputs: no named parameters.
ha_get_dashboard_configA
Get the full Lovelace configuration of a dashboard (all views, cards, etc.)
Inputs: url_path.
ha_get_entityB
Get the full state and attributes of a specific entity
Inputs: entity_id (required).
ha_get_error_logA
Get the Home Assistant error log contents
Inputs: no named parameters.
ha_get_eventsA
List all available event types in Home Assistant
Inputs: no named parameters.
ha_get_historyA
Get the state history for an entity over a time period
Inputs: entity_id (required), start_time, end_time.
ha_get_logbookC
Get logbook entries (activity log) for a time period, optionally filtered by entity
Inputs: entity_id, start_time, end_time.
ha_get_statesB
Get the current state of all entities, optionally filtered by domain (e.g. 'light', 'switch', 'sensor')
Inputs: domain.
ha_handle_intentB
Handle a conversation/voice intent in Home Assistant (e.g. natural language commands)
Inputs: name (required), data.
ha_install_addonA
Install a Home Assistant add-on by slug
Inputs: slug (required).
ha_list_addonsA
List all installed Home Assistant add-ons with their status
Inputs: no named parameters.
ha_list_areasB
List all areas (rooms) in Home Assistant
Inputs: no named parameters.
ha_list_automationsA
List all automations in Home Assistant with their IDs, aliases, and states
Inputs: no named parameters.
ha_list_backupsB
List all Home Assistant backups
Inputs: no named parameters.
ha_list_dashboardsA
List all Lovelace dashboards in Home Assistant
Inputs: no named parameters.
ha_list_devicesA
List all devices from the device registry
Inputs: no named parameters.
ha_list_entity_registryB
List all entities from the entity registry with their IDs, names, platforms, and areas
Inputs: domain.
ha_list_filesB
List files and directories on the Home Assistant server. Path is relative to /config/ (e.g. 'www' lists /config/www/).
Inputs: path.
ha_list_helpersA
List all input helpers (input_boolean, input_number, input_text, input_select, input_datetime, input_button, counter, timer)
Inputs: domain.
ha_list_scenesA
List all scenes in Home Assistant
Inputs: no named parameters.
ha_list_scriptsB
List all scripts in Home Assistant
Inputs: no named parameters.
ha_list_servicesA
List all available services, optionally filtered by domain
Inputs: domain.
ha_mkdirA
Create a directory on the Home Assistant server (recursively). Path is relative to /config/.
Inputs: path (required).
ha_read_fileA
Read a file from the Home Assistant server. Path is relative to /config/.
Inputs: path (required).
ha_render_templateB
Render a Jinja2 template using Home Assistant's template engine
Inputs: template (required).
ha_restart_addonC
Restart a Home Assistant add-on
Inputs: slug (required).
ha_restart_coreA
Restart the Home Assistant core. This will briefly make HA unavailable.
Inputs: no named parameters.
ha_save_dashboard_configB
Save/overwrite the full Lovelace configuration of a dashboard. Provide the complete config with views and cards.
Inputs: config (required), url_path.
ha_set_stateA
Set or create the state of an entity. Useful for creating virtual sensors or overriding states.
Inputs: entity_id (required), state (required), attributes.
ha_start_addonC
Start a Home Assistant add-on
Inputs: slug (required).
ha_stop_addonB
Stop a running Home Assistant add-on
Inputs: slug (required).
ha_system_infoA
Get Home Assistant system information (core version, OS, supervisor, host info)
Inputs: no named parameters.
ha_uninstall_addonB
Uninstall a Home Assistant add-on
Inputs: slug (required).
ha_update_automationB
Update an existing automation's configuration
Inputs: automation_id (required), config (required).
ha_update_core_configB
Update Home Assistant core configuration (internal_url, external_url, location, etc.)
Inputs: internal_url, external_url.
ha_update_dashboardB
Update an existing Lovelace dashboard's properties (title, icon, etc.)
Inputs: dashboard_id (required), title, icon, require_admin, +1 more.
ha_update_helperB
Update an existing input helper's configuration
Inputs: domain (required), helper_id (required), config (required).
ha_update_sceneC
Update an existing scene's configuration
Inputs: scene_id (required), config (required).
ha_update_scriptC
Update an existing script's configuration
Inputs: object_id (required), config (required).
ha_upload_fileA
Upload a file from the local machine to the Home Assistant server. Remote path is relative to /config/. Restricted to safe directories (www/, custom_components/, blueprints/, themes/).
Inputs: local_path (required), remote_path (required).
ha_upload_file_contentA
Create/overwrite a file on the Home Assistant server with the provided text content. Remote path is relative to /config/. Parent directories are created automatically.
Inputs: content (required), remote_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 66 tools
Every tool clearly targets a distinct resource and action, even within similar domains like files, dashboards, or add-ons. Overlapping concepts such as list/get, event/logbook, and upload_file/upload_file_content are differentiated by their descriptions enough to prevent misselection.
The ha_ prefix and mostly verb_noun pattern are consistent and readable. Minor deviations exist where nouns are used alone (ha_addon_info, ha_system_info, ha_file_exists) and where list vs get is used inconsistently for read operations.
At 66 tools, this far exceeds the 50+ threshold for an extreme count. While Home Assistant is a broad platform, this many tools creates an unwieldy MCP surface that is hard for an agent to navigate efficiently.
The toolset covers CRUD for automations, scripts, scenes, helpers, and dashboards, plus files, add-ons, entities, and system operations. Notable gaps include missing area update/delete, backup restore/delete, device get/update, and get-by-id operations for scripts and scenes, though these are mostly workable.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAn MCP server and Home Assistant add-on that enables AI assistants to manage smart homes by creating automations, designing dashboards, and interacting with entities. It features native access to Home Assistant APIs, built-in Git versioning for safe rollbacks, and full management of HACS integrations.660MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to control Home Assistant via natural language, including device control, automation management, and system configuration.MIT
- AlicenseAqualityCmaintenanceA self-hosted MCP server for Home Assistant that exposes full control over entity states, service calls, history, templates, and areas via local stdio, enabling AI assistants to manage your smart home.9MIT
- AlicenseAqualityAmaintenanceA comprehensive MCP server that enables AI assistants to interact with Home Assistant, control smart home devices, query states, execute services, and manage automations via natural language.7798,673 PyPI8,087MIT