# ha-mcp [Health: Active]

**Category:** 🏠 Home Automation  
**Repository:** https://github.com/homeassistant-ai/ha-mcp.git  
**GitHub Stars:** 8070  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ha-mcp

## Description
Comprehensive Model Context Protocol server for managing Home Assistant through AI assistants.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "ha-mcp": {
    "command": "uvx",
    "args": ["ha-mcp@latest"],
    "env": {
      "HOMEASSISTANT_URL": "",
      "HOMEASSISTANT_TOKEN": ""
    }
  }
}
```

**Requires environment variables:** `HOMEASSISTANT_URL`, `HOMEASSISTANT_TOKEN` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What ha-mcp does

ha-mcp exposes Home Assistant functionality to MCP-compatible AI assistants. Its tool set covers common home-automation tasks such as reading entity states, controlling smart-home devices, calling Home Assistant services, and working with automations. The project advertises 87 tools and can run with Home Assistant installations using OS, Supervised, Container, or Core deployment types.

Optional file and YAML editing tools are available through feature flags and are disabled by default. The `ha_config_set_yaml` tool is classified as beta. A separate **HA-MCP File & YAML Tools** entry is used when these opt-in capabilities are enabled.

## How it works

The preferred architecture is an HA-MCP custom component running inside Home Assistant. After installation, the integration provides a connection URL from its Configure screen. Remote clients can use a Home Assistant webhook URL through Nabu Casa or an existing reverse proxy. Clients on the same network can instead use the direct local endpoint exposed on port 9584.

The component supports remote access through a secret URL or Home Assistant sign-in, as well as direct local-network access. These connection modes are disabled initially, so an administrator must enable the mode needed by the client. The server can also run as a Home Assistant app, an external Docker HTTP server, or a local stdio process.

Only one deployment should be configured for a given client. Running the custom component, app, Docker or PyPI server, and local stdio server together can result in duplicate entries and connection hangs.

## Setup and configuration

For the recommended installation, add the repository to HACS, install the HA-MCP Custom Component, restart Home Assistant, and add the **HA-MCP Server** integration. Setup accepts either a long-lived Home Assistant access token or credentials for a dedicated administrator account, which the integration can use to create a token. The Configure screen then supplies the client connection URL.

A manual installation is also available by copying `custom_components/ha_mcp_tools/` into the Home Assistant `config/custom_components/` directory before restarting. The Home Assistant app is available for OS and Supervised installations and supplies its MCP URL in the app logs without requiring token setup.

External Docker or PyPI deployments use the Home Assistant URL and a long-lived access token. The integration includes an administrator-only HA-MCP sidebar panel for managing tools, feature flags, backups, and themes.

## Tools and capabilities

- Query Home Assistant entity states.
- Control smart-home devices.
- Execute Home Assistant services.
- Manage automations.
- Enable optional file and YAML editing tools.
- Connect through webhook, local HTTP, or stdio transports depending on deployment.

## Limitations and notes

The custom component, app, Docker, PyPI, and stdio methods are separate installations; select one per client. File and YAML editing requires explicit opt-in configuration. The app deployment is intended for Home Assistant OS and Supervised systems, while external deployments are useful for Container, Core, or separate-host setups. Remote clients require an enabled remote access mode and an appropriate connection URL.

_Full upstream README: https://allmcps.com/mcp/ha-mcp/readme_

