Homeassistant
A Model Context Protocol (MCP) server for interacting with Home Assistant. This server provides tools to control and monitor your Home Assistant devices through MCP-enabled applications.
claude mcp add --transport stdio hekmon8-homeassistant-server-mcp node /path/to/homeassistant-mcp/homeassistant-server/build/index.js \ --env HA_URL="http://your-homeassistant-url:8123" \ --env HA_TOKEN="your-long-lived-access-token"
How to use
This MCP server exposes tools to interact with your Home Assistant instance via the MCP framework. You can query device states, toggle devices on or off, trigger automations, and list entities. The tools are designed to integrate with MCP-enabled applications and clients, allowing you to manage Home Assistant devices programmatically through the MCP bridge. Typical workflows include reading the current state of an entity, turning lights on or off, kicking off automations, and retrieving a filtered list of entities by domain such as lights or switches. Example tool calls demonstrate how to pass entity identifiers, automation IDs, and optional filters to tailor results to your setup.
How to install
Prerequisites:
- Node.js and npm installed on your system
- Access to the repository (clone or download)
- A running Home Assistant instance with a long-lived access token
Installation steps:
- Clone the repository:
git clone https://github.com/yourusername/homeassistant-server-mcp.git
cd homeassistant-server-mcp
- Install dependencies:
npm install
- Build the project:
npm run build
- Configure the MCP server by adding the following to your MCP settings file (example path provided; adjust to your environment):
{
"mcpServers": {
"homeassistant": {
"command": "node",
"args": ["/path/to/homeassistant-mcp/homeassistant-server/build/index.js"],
"env": {
"HA_URL": "http://your-homeassistant-url:8123",
"HA_TOKEN": "your-long-lived-access-token"
}
}
}
}
Replace the URL and token with your Home Assistant instance and a valid long-lived access token.
Optional alternative: If you prefer running via Smithery, you can install automatically with:
npx -y @smithery/cli install @hekmon8/Homeassistant-server-mcp --client claude
Additional notes
Tips and common considerations:
- Ensure HA_URL uses http(s):// and the correct host/port for your Home Assistant instance.
- Use a long-lived access token for stable MCP connections; protect this token and rotate periodically.
- If the MCP server cannot reach Home Assistant, double-check network access and token permissions.
- The configuration sample path in the README is specific to a VSCode/Claude setup; adapt the path to your MCP runner configuration if needed.
- When running behind a reverse proxy or in a container, ensure environment variables are correctly passed to the Node process.
- For security, prefer HTTPS and limit token exposure; consider placing tokens in a secure secrets store when deploying.
- The tools exposed by this server include: get_state (read entity state), toggle_entity (turn on/off), trigger_automation (start an automation), and list_entities (enumerate entities, with optional domain filtering).
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.