e46b72b9142803c167d96fa01bf61b74ed20bcca
- Introduced `claude_desktop_setup.sh` to automate the installation and configuration of MCP integration for Claude Desktop, including Node.js installation via nvm and Brave Search MCP setup. - Updated README.md to reflect new setup instructions, key features, and quick start guide for using the MCP with Home Assistant and Claude Desktop. - Enhanced configuration management by detailing environment variable setup and providing examples for user configurations.
Model Context Protocol Server for Home Assistant
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).
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: 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
Quick Start
Prerequisites
- Node.js 20.10.0+ (for Array.prototype.toSorted())
- NPM
- Running Home Assistant instance
- Home Assistant long-lived access token
Basic Installation
git clone https://github.com/jango-blockchained/homeassistant-mcp.git
cd homeassistant-mcp
npm install
npm run build
Docker Setup (Recommended)
- Clone and prepare:
git clone https://github.com/jango-blockchained/homeassistant-mcp.git
cd homeassistant-mcp
- Configure environment:
NODE_ENV=production
HASS_HOST=your_home_assistant_url
HASS_TOKEN=your_home_assistant_token
- Launch:
docker-compose up -d
Usage Guide
Device Discovery
{
"tool": "list_devices"
}
Basic Controls
// Light control
{
"tool": "control",
"command": "turn_on",
"entity_id": "light.living_room",
"brightness": 128
}
// Climate control
{
"tool": "control",
"command": "set_temperature",
"entity_id": "climate.bedroom",
"temperature": 22
}
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
Development
npm run dev # Development mode
npm run build # Build project
npm test # Run tests
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
Project Status
✅ Complete
- Entity, Floor, and Area access
- Device control (Lights, Climate, Covers, Switches)
- Basic state management
🚧 In Progress
- Custom prompt testing
- Resource context integration
- Tool organization optimization
Resources
Contributing
- Fork repository
- Create feature branch
- Submit pull request
License
MIT License - See LICENSE file
Description
Languages
TypeScript
92.2%
Shell
3.4%
Python
2.3%
JavaScript
1.7%
Dockerfile
0.4%