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
claude mcp add --transport stdio ganhammar-hass-mcp-server python -m mcp_server_hass \ --env HA_BASE_URL="https://your-home-assistant-url" \ --env OIDC_CLIENT_ID="<your-oidc-client-id>" \ --env OIDC_CLIENT_SECRET="<your-oidc-client-secret>" \ --env OIDC_TOKEN_ENDPOINT="<token-endpoint-url>" \ --env OIDC_AUTHORIZATION_ENDPOINT="<authorization-endpoint-url>"
How to use
This MCP server exposes a HTTP transport-based interface to interact with your Home Assistant instance via the Model Context Protocol. It leverages OAuth 2.0 for authentication, enabling remote access and integration with AI assistants like Claude directly from your browser. Once the MCP server is running, Claude can discover and interact with Home Assistant entities, states, and services through the MCP endpoints.
Available tools include get_state to fetch the current state of an entity, call_service to trigger Home Assistant services (for example turning lights on or off), and list_entities to enumerate entities with optional domain filtering. The server authenticates clients using OAuth 2.0, and Claude uses Dynamic Client Registration (DCR) to register itself automatically, simplifying setup. To use Claude in the browser, connect to your MCP server URL and authorize access when prompted, after Claude registers and obtains the necessary permissions.
How to install
Prerequisites:
- Home Assistant installation with access to install custom components
- hass-oidc-auth integration configured for OIDC
- Internet access for OAuth and API calls
Installation (HACS - Recommended):
- Open HACS in Home Assistant
- Search for "MCP Server"
- Click "Download" to install
- Restart Home Assistant
- Configure the integration in Settings > Devices & Services
Manual Installation:
- Copy the custom component folder to your Home Assistant custom_components directory (e.g., custom_components/mcp_server)
- Restart Home Assistant
- Configure the integration via Settings > Devices & Services
Notes:
- Ensure hass-oidc-auth is installed and properly configured for OIDC authentication
- The MCP server relies on OAuth 2.0 for secure remote access; configure your OIDC endpoints and client credentials accordingly
Additional notes
Tips and common considerations:
- Ensure OIDC is properly configured; misconfigurations can prevent OAuth flows from completing
- Use the provided placeholder env vars to inject your Home Assistant base URL and OAuth endpoints
- If Claude fails to connect, verify that the MCP server URL is reachable from Claude’s environment and that the OAuth client is registered
- The HTTP transport is designed for remote access; ensure you expose only necessary endpoints and secure them behind OAuth
- If you need to reconfigure, update the mcp_config and restart the MCP server integration in Home Assistant
Related MCP Servers
mysql_mcp_server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
Gitingest
mcp server for gitingest
awesome s
A curated list of excellent Model Context Protocol (MCP) servers.
mcp-chatbot
MCP Chatbot powered by Anthropic Claude. Delivering on‐demand literature search and summarisation for academics and engineers
skill-to
Convert AI Skills (Claude Skills format) to MCP server resources - Part of BioContextAI
MCP-Plugin-dotnet
.NET MCP bridge: expose app methods/data as MCP tools, prompts, and resources via an in-app plugin + lightweight server (SignalR; stdio/http).