Home Assistant MCP Server
A server that enables interaction with Home Assistant devices and automations through the Model Context Protocol, allowing users to monitor device states, control devices, trigger automations, and list entities.
hekmon8
Tools
get_state
Get the current state of a Home Assistant entity
toggle_entity
Toggle a Home Assistant entity on/off
trigger_automation
Trigger a Home Assistant automation
list_entities
List all available entities in Home Assistant
README
Home Assistant MCP Server
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.
<a href="https://glama.ai/mcp/servers/io8m0yc5wq"> <img width="380" height="200" src="https://glama.ai/mcp/servers/io8m0yc5wq/badge" alt="Home Assistant Server MCP server" /> </a>
This project is part of the AI Model Context Protocol (MCP) ecosystem. For more information and documentation about MCP tools, visit www.aimcp.info.
Features
- Get device states
- Control device states (on/off)
- Trigger automations
- List available entities
Installation
- Clone this 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 (typically located at
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
for VSCode):
{
"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 your-homeassistant-url
and your-long-lived-access-token
with your Home Assistant instance URL and access token.
Usage
The server provides the following tools:
1. Get Device State
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "get_state",
arguments: {
entity_id: "light.living_room"
}
});
2. Toggle Device State
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "toggle_entity",
arguments: {
entity_id: "switch.bedroom",
state: "on" // or "off"
}
});
3. Trigger Automation
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "trigger_automation",
arguments: {
automation_id: "automation.morning_routine"
}
});
4. List Entities
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "list_entities",
arguments: {
domain: "light" // optional, filters by domain
}
});
Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Please make sure to update tests as appropriate and follow the existing code style.
Documentation
For detailed documentation about MCP tools and the ecosystem:
- Visit www.aimcp.info
- Check the MCP tools directory on the website
- Read the integration guides and best practices
License
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2024 homeassistant-mcp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Security
To securely use this server:
- Always use HTTPS for your Home Assistant instance
- Keep your access tokens secure and never commit them to version control
- Regularly rotate your access tokens
- Use environment variables for sensitive information
Support
If you encounter any issues or have questions, please:
- Check the existing issues in the repository
- Create a new issue if your problem hasn't been reported
- Provide as much context as possible when reporting issues
- Visit www.aimcp.info for additional support resources
Recommended Servers
ThingsPanel MCP
An integration server that connects AI models with ThingsPanel IoT platform, allowing AI assistants to interact with IoT devices through natural language for device control, data retrieval, and management operations.

MCP Personal Assistant Agent
A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.

Tesla MCP Server
A Model Context Protocol server that connects to the Tesla Fleet API, allowing AI assistants like Claude to control Tesla vehicles and access vehicle information through natural language commands.
MCP2Serial
A bridge that connects physical hardware devices with AI large language models via serial communication, allowing users to control hardware using natural language commands.

OpenHue MCP Server
Enables control of Philips Hue lights through Claude and other LLM interfaces using the OpenHue CLI.
Home Assistant MCP
Expose all Home Assistant voice intents through a Model Context Protocol Server allowing home control.

Tuya MCP Server
A cli tool to control Tuya devices based on tinytuya - cabra-lat/tuyactl
Govee MCP Server
Enables users to control Govee LED devices using the Govee API, with features for turning devices on/off, setting colors, and adjusting brightness through a CLI or MCP clients.

mcp2mqtt
Links IoT devices to AI large models using the MCP and MQTT protocols, enabling natural language control, real-time AI responses, and complex instruction execution for interconnected IoT devices.
SwitchBot MCP Server
Enables AI assistants to control SwitchBot devices, providing functionalities like device management, scene execution, and sensor information monitoring through the SwitchBot API.