mcp -home-assistant
A Model Context Protocol Server for Home Assistant
claude mcp add --transport stdio allenporter-mcp-server-home-assistant uv --directory /Users/allen/Development/mcp-server-home-assistant run mcp-server-home-assistant -v -v \ --env HOME_ASSISTANT_API_TOKEN="<your-token-here>" \ --env HOME_ASSISTANT_WEB_SOCKET_URL="http://localhost:8123/api/websocket"
How to use
This MCP server provides a Model Context Protocol interface for Home Assistant, allowing Claude-based tools to query and interact with Home Assistant through a standardized context protocol. The server is started via the uv tool, pointing it at the local repository of the mcp-server-home-assistant project. Once running, Claude Desktop can engage with Home Assistant using the configured web socket and API token. When using Claude’s Home Assistant integration, ensure your Home Assistant instance is accessible at the provided websocket URL and that you’ve generated a Long-Lived Access Token for authentication. The included environment variables supply the required connection details so Claude can request context, push actions, and retrieve updates from Home Assistant.
How to install
Prerequisites:
- Python 3.x installed on your system
- Git for cloning the repository
- The uv tool (as shown in the README usage) installed and available in your PATH
- A running Home Assistant instance with a Long-Lived Access Token
Installation steps:
-
Install Python and Git if not already installed.
-
Clone the MCP server repository to your desired path:
git clone https://github.com/allenporter/mcp-server-home-assistant.git cd mcp-server-home-assistant
-
Install the uv tool if you don’t already have it (depends on your environment; example with pipx):
python3 -m pip install --user pipx python3 -m pipx ensurepath pipx install uvx # or the specific uv package used by your setup
-
Ensure you have a running Home Assistant instance and generate a Long-Lived Access Token from your user profile.
-
Create or modify the Claude Desktop configuration to reference the Home Assistant MCP server, using the example in the README (adjust paths and tokens as needed).
-
Run Claude Desktop and verify logs for connection success. Logs can help diagnose authentication or connectivity issues.
Additional notes
Tips and common issues:
- Ensure the Home Assistant websocket URL and API token are correct and have the necessary permissions.
- If you change the repository path, update the --directory value in the mcp_config accordingly.
- The verbose flags (-v -v) in the example help with troubleshooting by increasing log output from the MCP server.
- Check Claude’s logs (as mentioned in the README) for connection problems or token authentication failures.
- If you encounter SSL or certificate issues connecting to Home Assistant, ensure network access and proper TLS configuration are in place.
- If you’re deploying in a different environment (e.g., Docker or a virtual environment), adapt the command and environment variables to fit that setup.
Related MCP Servers
Gitingest
mcp server for gitingest
hass
A Home Assistant Custom Component that provides an MCP (Model Context Protocol) server using HTTP transport, allowing AI assistants like Claude to interact with your Home Assistant instance over HTTP
skill-to
Convert AI Skills (Claude Skills format) to MCP server resources - Part of BioContextAI
home-assistant-model-context-protocol
A Home Assistant Model Context Protocol Custom Component
scraper
Context-optimized MCP server for web scraping. Reduces LLM token usage by 70-90% through server-side CSS filtering and HTML-to-markdown conversion.
ros2_medkit_mcp
MCP server for ros2_medkit. Bridge LLM agents to the SOVD REST API for ROS 2 diagnostics and remote operations.