Retrieves a list of all available devices from Home Assistant
Gets the current state of a specific device
Controls a device by calling a service (turn on/off, set temperature, etc.)
Calls any Home Assistant service with specified domain, service, and data
Subscribes to real-time state change events from Home Assistant
Home Assistant Integration provides a seamless connection between Claude AI and your Home Assistant smart home ecosystem. This integration allows you to control lights, switches, thermostats, media players, and other smart devices directly through Claude's interface. With real-time state updates via Server-Sent Events (SSE), you can monitor device status changes and create powerful automation workflows combining Claude's intelligence with your smart home capabilities.
This MCP server connects Claude to your Home Assistant instance, allowing you to control and monitor your smart home devices through natural language conversations.
Clone the repository:
git clone https://github.com/tevonsb/homeassistant-mcp.git
cd homeassistant-mcp
Install dependencies:
npm install
Create a .env
file based on the example:
NODE_ENV=development
PORT=3000
LOG_LEVEL=info
HASS_HOST=http://your-home-assistant-url:8123
HASS_SOCKET_URL=ws://your-home-assistant-url:8123/api/websocket
HASS_TOKEN=your_long_lived_access_token
Start the server:
npm start
Build the Docker image:
docker build -t homeassistant-mcp .
Run the container:
docker run -p 3000:3000 \
-e HASS_HOST=http://your-home-assistant-url:8123 \
-e HASS_SOCKET_URL=ws://your-home-assistant-url:8123/api/websocket \
-e HASS_TOKEN=your_long_lived_access_token \
homeassistant-mcp
For macOS users, a convenient setup script is provided:
chmod +x claude-desktop-macos-setup.sh
./claude-desktop-macos-setup.sh
This script will guide you through the installation process, including Node.js setup and configuration.
To use this MCP with Claude, you need to add it to your Claude configuration. In Claude Desktop, go to Settings > Model Context Protocol and add the following configuration:
{
"homeassistant": {
"command": "node",
"args": [
"/path/to/homeassistant-mcp/dist/index.js"
],
"env": {
"HASS_HOST": "http://your-home-assistant-url:8123",
"HASS_SOCKET_URL": "ws://your-home-assistant-url:8123/api/websocket",
"HASS_TOKEN": "your_long_lived_access_token"
}
}
}
Once configured, you can interact with your Home Assistant devices through Claude using natural language. Here are some examples:
The integration supports various device types including:
The MCP server supports Server-Sent Events (SSE) for real-time updates from your Home Assistant instance. This allows Claude to receive notifications when device states change without having to poll for updates.
If you encounter issues:
For Docker users, you may need to use the host network mode if your Home Assistant instance is running on the same machine:
docker run --network host \
-e HASS_HOST=http://localhost:8123 \
-e HASS_SOCKET_URL=ws://localhost:8123/api/websocket \
-e HASS_TOKEN=your_long_lived_access_token \
homeassistant-mcp