home / mcp / enhanced home assistant mcp server
Enhanced MCP server for Home Assistant with comprehensive API integration - includes entity discovery, automation management, advanced services, system monitoring, and more
Configuration
View docs{
"mcpServers": {
"gilberth-enhanced-homeassistant-mcp": {
"command": "npx",
"args": [
"@thelord/enhanced-homeassistant-mcp"
],
"env": {
"HOME_ASSISTANT_URL": "http://your-ha-url:8123",
"HOME_ASSISTANT_TOKEN": "your_long_lived_access_token"
}
}
}
}You run a practical MCP server that bridges Home Assistant with AI assistants, letting you query entity states, trigger automations, manage devices, and oversee system health from your preferred client. This guide shows you how to use the Enhanced Home Assistant MCP server, install it, and configure it for reliable operations with your Home Assistant instance.
You use an MCP client to communicate with the Enhanced Home Assistant MCP server. Start the server with the NPX command provided, then connect your MCP client to its runtime. From the client you can check API status, get and set entity states, call services, manage automations, scenes, scripts, and access history and logs. You provide your Home Assistant URL and a long-lived access token to authorize requests. When connected, you can discover entities, monitor system health, and trigger actions across lights, climate, media players, covers, and notifications.
To begin, run the server in your terminal and then use your MCP client to send actions such as querying an entity state, turning on a light with brightness and color, triggering an automation, or activating a scene. The server exposes a broad set of tools organized into categories like Basic Operations, Automation & Control, History & Monitoring, Device Control, and System Administration to help you perform common Home Assistant tasks from your AI-enabled interface.
Prerequisites: Make sure you have Node.js 18 or newer installed on your machine. You also need a Home Assistant instance with API access and a long-lived access token.
# Prerequisites check
node -v
npm -v
# Optional: use a local clone or simply run with NPXStep-by-step installation flow you can follow exactly as shown here:
# Clone the repository
git clone https://github.com/gilberth/enhanced-homeassistant-mcp.git
cd enhanced-homeassistant-mcp
# Install dependencies
npm install
# Copy environment template
cp .env.example .envConfigure your environment by editing the .env file to include your Home Assistant details.
HOME_ASSISTANT_URL=http://homeassistant.local:8123
HOME_ASSISTANT_TOKEN=your_long_lived_access_token_here
DEBUG=false
REQUEST_TIMEOUT=10000Set up your access token in Home Assistant by generating a Long-Lived Access Token from your profile.
Running the server can be done via NPX for a quick start or via a local installation for production use.
# Quick start with NPX
npx @thelord/enhanced-homeassistant-mcp
# With options
npx @thelord/enhanced-homeassistant-mcp --debug start
npx @thelord/enhanced-homeassistant-mcp inspect
npx @thelord/enhanced-homeassistant-mcp healthSecurity and reliability tips: keep your Home Assistant token secure, rotate tokens periodically, and enable debug logging during troubleshooting to capture useful diagnostics. If you plan to run the server in production, consider using a process manager to keep the MCP server running and to restart it on crashes.
Notes on deployment patterns: you can run the MCP server locally via NPX for development or build a dedicated container image for deployment. If you want to run in the cloud, you can use Smithery to provision and manage the MCP server instance with your Home Assistant credentials.
Troubleshooting quick tips: verify the HOME_ASSISTANT_URL and HOME_ASSISTANT_TOKEN are correct, ensure Home Assistant is reachable from your network, and confirm your token has the required permissions for the actions you intend to perform. If a specific action fails, list all available services and entities to confirm you are using valid identifiers.
Typical workflows include querying entity states before issuing a control command, validating the available services, and using history or log events to inform your automation logic. Use the discovery features to find devices by type or domain, then combine multiple tools to create robust automation sequences.
Check API connectivity between MCP server and Home Assistant instance
Retrieve the current state of a specific entity from Home Assistant
List all entities available in Home Assistant, optionally filtered by domain
Invoke a Home Assistant service with domain, service, entity_id, and service_data parameters
List available Home Assistant services, optionally filtered by domain
Fetch Home Assistant configuration details
List automations defined in Home Assistant
Enable or disable a specific automation by entity_id
Trigger a Home Assistant automation by entity_id
List all scenes defined in Home Assistant
Activate a Home Assistant scene by entity_id
List all scripts defined in Home Assistant
Execute a script by entity_id
List all input Boolean helpers in Home Assistant
Toggle the state of an input Boolean by entity_id and action
Retrieve historical data for an entity over a specified time window
Fetch logbook entries for an entity or the system
List event types supported by Home Assistant
Retrieve the error log from Home Assistant
Control lights including brightness, color, and state transitions
Set temperature, HVAC modes, and presets on climate devices
Control media players with actions like play, pause, and volume changes
Open/close covers and set positions for covers or blinds
List devices filtered by domain/type
Send a notification via a specified Home Assistant service
Retrieve system information for the Home Assistant instance
Render a Jinja2 template via Home Assistant
List areas defined in Home Assistant
List all devices managed by Home Assistant
List integrations available in Home Assistant
Restart Home Assistant services with optional confirmation
Get information about the Home Assistant Supervisor
List add-ons installed in Home Assistant
Search entities by text with optional domain filtering