Skip to content

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

Notifications You must be signed in to change notification settings

ganhammar/hass-mcp-server

Repository files navigation

MCP Server for Home Assistant (HTTP Transport)

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.

Note: Unlike other Home Assistant MCP servers that use SSE (Server-Sent Events), this implementation uses HTTP transport with OAuth 2.0 authentication, making it suitable for remote access and integration with services like Claude in browser.

Features

  • 🌐 HTTP transport (not SSE) - works remotely, not just locally
  • 🏠 Full Home Assistant API access
  • 🔧 Easy HACS installation
  • 📊 Access to entities, states, and services

Prerequisites

This plugin requires hass-oidc-auth to be installed and configured for OIDC authentication.

Installation

HACS (Recommended)

  1. Open HACS in Home Assistant
  2. Search for "MCP Server"
  3. Click "Download"
  4. Restart Home Assistant
  5. Configure the integration (see Configuration section below)

Manual Installation

  1. Copy the custom_components/mcp_server folder to your Home Assistant custom_components directory
  2. Restart Home Assistant
  3. Configure the integration (see Configuration section below)

Configuration

  1. Go to Settings → Devices & Services
  2. Click "Add Integration"
  3. Search for "MCP Server"
  4. Follow the configuration steps

Usage with Claude in Browser

The MCP server uses OAuth 2.0 Dynamic Client Registration (DCR), which allows Claude to automatically register itself without manual client setup.

  1. In Claude (claude.ai):

    • Open Profile (bottom left corner)
    • Click Settings (gear icon)
    • Navigate to "Connectors"
    • Click "Add custom connector"
    • Enter your MCP server URL: https://your-home-assistant.com/api/mcp
    • Click "Connect"
  2. Claude will automatically:

    • Discover your Home Assistant's OAuth endpoints
    • Register itself as an OAuth client
    • Redirect you to Home Assistant for authentication
    • Request access to your Home Assistant data
  3. In Home Assistant:

    • Log in if not already authenticated
    • Review the permissions requested by Claude
    • Click "Authorize" to grant access

That's it! Claude will now be able to interact with your Home Assistant instance through the MCP server.

Available Tools

  • get_state: Get the current state of any Home Assistant entity
  • call_service: Call any Home Assistant service (turn on lights, etc.)
  • list_entities: List all entities, optionally filtered by domain

License

MIT

About

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

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages