- Explore MCP Servers
- mcp-hass
Mcp Hass
What is Mcp Hass
mcp-hass is a Rust-based Model Context Protocol (MCP) server that serves as a bridge between AI assistants and Home Assistant, enabling control of smart home devices.
Use cases
Use cases include controlling lights and switches through voice commands, retrieving the status of smart devices, and automating tasks based on predefined prompts.
How to use
To use mcp-hass, build the server using ‘cargo build --release’, then configure the ‘mcp.json’ file with the Home Assistant endpoint and access token. Start the server to listen for MCP requests.
Key features
Key features include entity management for retrieving status of devices, device control for turning devices on and off, seamless MCP integration for AI assistants, and a flexible prompt system for standardized interactions.
Where to use
mcp-hass can be used in smart home environments where integration between AI assistants and Home Assistant is desired, facilitating automation and control of smart devices.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Mcp Hass
mcp-hass is a Rust-based Model Context Protocol (MCP) server that serves as a bridge between AI assistants and Home Assistant, enabling control of smart home devices.
Use cases
Use cases include controlling lights and switches through voice commands, retrieving the status of smart devices, and automating tasks based on predefined prompts.
How to use
To use mcp-hass, build the server using ‘cargo build --release’, then configure the ‘mcp.json’ file with the Home Assistant endpoint and access token. Start the server to listen for MCP requests.
Key features
Key features include entity management for retrieving status of devices, device control for turning devices on and off, seamless MCP integration for AI assistants, and a flexible prompt system for standardized interactions.
Where to use
mcp-hass can be used in smart home environments where integration between AI assistants and Home Assistant is desired, facilitating automation and control of smart devices.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Home Assistant MCP Integration
A Rust-based Model Context Protocol (MCP) server that integrates with Home Assistant to control smart home devices.
Overview
This project provides a bridge between AI assistants and Home Assistant using the Model Context Protocol (MCP). It allows AI assistants to:
- Retrieve the status of lights, switches, and sensors from Home Assistant
- Control smart home devices (turn lights/switches on and off)
- Use predefined prompts for common interactions
Features
- Entity Management: Get status information for lights, switches, and sensors
- Device Control: Turn devices on and off through simple commands
- MCP Integration: Implements the Model Context Protocol for seamless AI assistant integration
- Prompt System: Includes a flexible prompt template system for standardized interactions
Prerequisites
- Rust (2021 edition or newer)
- Home Assistant instance
- Home Assistant long-lived access token
- Network connectivity between this service and your Home Assistant instance
Usage
Build the server:
cargo build --release
And add the following mcp.json to ~.aws/amazonq/:
{
"mcpServers": {
"hass": {
"command": "<PATH OF THE BINARY IF NOT IN $PATH>",
"args": [],
"env": {
"HASS_ENDPOINT": "<IP ADDRESS OF HASS>",
"HASS_TOKEN": "<LONG LIVED TOKEN?"
}
}
}
}
The server will start and listen for MCP requests. AI assistants that support MCP can then use the following tools:
hass___get_entities: Retrieve all available lights, switches, and sensors with their current stateshass___turn_on_entitity: Turn on a specific entity (e.g., a light)hass___turn_off_entitity: Turn off a specific entity
Prompt System
The project includes a flexible prompt system that allows for templated interactions. Example prompts:
example_prompt: A simple example that takes a message parametercode_review: A prompt for code review that takes language and code parameters
Development
Project Structure
src/main.rs: Entry point that initializes the MCP serversrc/hass.rs: Core functionality for Home Assistant integrationsrc/prompts.rs: Prompt template system implementation
Adding New Features
To add new Home Assistant capabilities:
- Add new tool methods to the
Entitiesstruct inhass.rs - Implement the necessary API calls to Home Assistant
- Register the tools using the
#[tool]attribute
To add new prompts:
- Add prompt definitions to the
PROMPTSlazy static inprompts.rs
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










