Home Assistant

Provides an MCP interface to Home Assistant actions including entity queries, service calls, and automation management.
  • python

0

GitHub Stars

python

Language

6 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mjrestivo16-mcp-homeassistant": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "HA_URL": "http://YOUR_HA_URL:8123",
        "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN"
      }
    }
  }
}

You run a lightweight MCP server that connects Claude to your Home Assistant instance, letting you query states, call services, and manage automations through a standardized, AI-friendly interface. This server runs locally and securely, enabling powerful home automation interactions via simple prompts.

How to use

You use a client that speaks MCP via stdio to the server. Start Claude with the MCP integration configured to point to your local MCP server. Once connected, you can ask Claude to query the state of any entity, turn devices on or off, run automations, or fetch historical data. The server translates your requests into Home Assistant API calls and returns structured results suitable for display in the chat.

How to install

Prerequisites: you need Python 3.10 or higher, a Home Assistant instance (local or remote), and a Long-Lived Access Token for Home Assistant.

  1. Clone the MCP Home Assistant server repository.

  2. Create and activate a virtual environment.

  3. Install dependencies.

  4. Configure environment variables.

  5. Run the server to test the connection.

Configuration and runtime details

Environment variables you set to connect to Home Assistant are required for runtime. The server expects the following values to establish a session with Home Assistant.

HA_URL should point to your Home Assistant HTTP API endpoint, including the port. HA_TOKEN is the Long-Lived Access Token you generated in Home Assistant.

Security and best practices

Keep your tokens secure. Do not commit the .env file or tokens to version control. Use a dedicated, restricted token for MCP access and rotate tokens periodically. Restrict network access to the MCP server where possible.

Troubleshooting

If the server won’t start, verify you’re using Python 3.10+, activate your virtual environment, and install dependencies. If authentication errors occur, double-check the HA URL and token, and regenerate the token if necessary.

Available tools

get_state

Query the current state and attributes of any Home Assistant entity.

list_entities

List entities with optional domain filtering.

call_service

Execute any Home Assistant service to control devices.

trigger_automation

Manually trigger an automation.

get_history

Retrieve historical state changes for an entity.

create_automation

Create a new automation from a full configuration.

update_automation

Update an existing automation configuration.

delete_automation

Remove an automation by its ID.

get_automation_config

View the full YAML configuration of an automation.

list_automation_configs

List all automation configurations with IDs and aliases.

reload_automations

Reload all automations after changes.

enable_automation

Enable a disabled automation.

disable_automation

Disable an active automation.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational