HomeAssistant MCP
Model Context Protocol Server for Home Assistant
Forked from tevonsb/homeassistant-mcp
A powerful bridge between your Home Assistant instance and Language Learning Models (LLMs), enabling natural language control and monitoring of your smart home devices through the Model Context Protocol (MCP).
Table of Contents
- Key Features
- Prerequisites
- Installation
- Configuration
- Development
- Supported Commands
- Natural Language Integration
- Troubleshooting
- Project Status
- Contributing
- Resources
- License
Key Features
- Smart Device Control š®
- š” Lights: Brightness, color temperature, RGB color
- š”ļø Climate: Temperature, HVAC modes, fan modes, humidity
- šŖ Covers: Position and tilt control
- š Switches: On/off control
- šØ Sensors & Contacts: State monitoring
- Intelligent Organization š
- Area and floor-based device grouping
- State monitoring and querying
- Smart context awareness
- Robust Architecture š ļø
- Comprehensive error handling
- State validation
- Secure API integration
Prerequisites
- Node.js 20.10.0 or higher
- NPM package manager
- Docker Compose for containerization
- Running Home Assistant instance
- Home Assistant long-lived access token (How to get token)
Installation
Basic Setup
Docker Setup
Note: This setup is currently in progress. You can use the
docker
branch to get the latest changes.
- Clone and prepare:Copygit clone -b docker https://github.com/jango-blockchained/homeassistant-mcp.git cd homeassistant-mcp cp .env.example .env
- Configure environment
.env
file:Copy... HASS_TOKEN=your_home_assistant_token ... - Launch with Docker Compose:Copydocker-compose up -d
Configuration
Copy .env.example
to .env
.
Configure environment .env
file:
Development
Supported Commands
Common Entity Controls
Light Control
Climate Control
Cover Control
Media Player Control
Fan Control
Lock Control
Vacuum Control
Scene Control
Script Control
Camera Control
Natural Language Integration
Example Commands
- "Turn on the living room lights"
- "Set bedroom temperature to 22 degrees"
- "Is the front door locked?"
Smart Features
- Context awareness across conversations
- Natural parameter interpretation
- Intelligent error prevention
- Multi-device orchestration
Troubleshooting
Common Issues
- Node.js Version (
toSorted is not a function
)- Solution: Update to Node.js 20.10.0+
- Connection Issues
- Verify Home Assistant is running
- Check
HASS_HOST
accessibility - Validate token permissions
- Entity Control Issues
- Verify
entity_id
exists - Check entity domain matches command
- Ensure parameter values are valid
- Verify
Project Status
ā Complete
- Entity, Floor, and Area access
- Device control (Lights, Climate, Covers, Switches, Contacts)
- Basic state management
- Error handling and validation
- Docker containerization and configuration
- Jest testing setup and TypeScript integration
- Environment variable management
- Home Assistant API integration
- Project documentation and README organization
š§ In Progress
- Custom prompt testing and optimization
- Resource context integration
- Tool organization optimization
- Enhanced macOS integration
- Type safety improvements
- Testing coverage expansion
š Planned
- Multi-platform desktop integration
- Advanced error recovery mechanisms
- Performance optimization
- WebSocket implementation for real-time updates
- Enhanced security features
- API documentation generation
Contributing
- Fork repository
- Create feature branch
- Submit pull request
Resources
License
MIT License - See LICENSE file
Smart Device Control š® š” Lights: Brightness, color, RGB š”ļø Climate: Temperature, HVAC, humidity šŖ Covers: Position and tilt š Switches: On/off šØ Sensors: State monitoring
Intelligent Organization š Grouping with context awareness.
Robust Architecture š ļø Error handling, state validation ...