Provides comprehensive control of Home Assistant smart home devices, automations, scenes, scripts, and system management. Includes tools for controlling lights, climate devices, media players, covers, accessing entity states and history, managing automations and scenes, sending notifications, and system administration tasks.
Enhanced Home Assistant MCP
A comprehensive MCP (Model Context Protocol) server that provides extensive integration with Home Assistant, enabling AI assistants to interact with smart home devices, automations, and system management.
๐ Quick Start with NPX
No installation required! Run directly with npx:
๐ Complete NPX Usage Guide โ
๐ง Smithery Deployment Status: Currently optimizing tool loading to prevent timeout during Smithery's tool scanning. See TIMEOUT_RESOLUTION.md for details.
๐ Features
๐ Basic Operations
โ API status verification
๐ฑ Entity state management
๐ Service calls with advanced parameters
๐ Entity discovery and listing
๐ ๏ธ Configuration information
๐ค Automation & Control
๐ Automation management (enable/disable/trigger)
๐ฌ Scene activation
๐ Script execution
๐ Input boolean controls
๐ Scheduled automation insights
๐ History & Monitoring
๐ Entity history tracking
๐ Logbook entries
โ ๏ธ Error log monitoring
๐ก System events
๐ Configuration validation
๐ Device Control
๐ก Lights: Brightness, color, temperature control
๐ก๏ธ Climate: Temperature, HVAC modes, presets
๐บ Media Players: Play/pause, volume, media selection
๐ Covers: Open/close, position control
๐ข Notifications: Multi-service messaging
๐ Device Discovery: Filter by type/domain
โ๏ธ System Administration
๐ System information and health
๐ท๏ธ Template rendering (Jinja2)
๐ Area and device management
๐ Integration monitoring
๐ System restart capabilities
๐ฑ Supervisor and add-on management
๐ Entity search and discovery
๐ Quick Start
Prerequisites
Node.js 18+
Home Assistant instance with API access
Long-lived access token from Home Assistant
Installation
Configuration
Edit the .env file with your Home Assistant details:
Getting Your Access Token
Open Home Assistant in your browser
Go to your Profile (click on your username in the sidebar)
Scroll down to "Long-Lived Access Tokens"
Click "Create Token"
Give it a name and copy the generated token
Running the Server
Option 1: NPX (Recommended - No installation)
Option 2: Local Installation
๐ณ Docker Deployment (Recomendado)
Para un despliegue fรกcil y seguro usando Docker:
๐ Guรญa completa de Docker: Ver DOCKER.md para instrucciones detalladas.
โ๏ธ Smithery Deployment (Cloud)
Para usar el servidor desplegado en la nube a travรฉs de Smithery:
Visita: Smithery.ai
Busca:
@gilberth/enhanced-homeassistant-mcpConfigura tu instancia con:
Home Assistant URL
Long-lived access token
Opciones opcionales (debug, timeout)
๐ฏ Ventajas de Smithery: Sin configuraciรณn de infraestructura, escalado automรกtico, y acceso global.
๐ ๏ธ Available Tools
Basic Tools
Tool | Description | Parameters |
| Check API connectivity | None |
| Get entity state |
|
| List all entities |
(optional) |
| Call HA service |
,
,
,
|
| List available services |
(optional) |
| Get HA configuration | None |
Automation Tools
Tool | Description | Parameters |
| List all automations | None |
| Enable/disable automation |
,
|
| Trigger automation |
|
| List all scenes | None |
| Activate scene |
|
| List all scripts | None |
| Run script |
|
| List input booleans | None |
| Toggle input boolean |
,
|
History Tools
Tool | Description | Parameters |
| Get entity history |
,
,
,
|
| Get logbook entries |
,
,
|
| List event types | None |
| Get error log | None |
| Validate configuration | None |
Device Control Tools
Tool | Description | Parameters |
| Control lights |
,
,
,
,
, etc. |
| Control climate devices |
,
,
,
, etc. |
| Control media players |
,
,
,
, etc. |
| Control covers/blinds |
,
,
|
| List devices by domain |
|
| Send notifications |
,
,
,
|
System Tools
Tool | Description | Parameters |
| Get system information | None |
| Render Jinja2 template |
|
| List all areas | None |
| List all devices | None |
| List integrations | None |
| Restart Home Assistant |
|
| Get Supervisor info | None |
| List add-ons | None |
| Search entities |
,
|
๐ Usage Examples
Basic Entity Control
Automation Management
Climate Control
System Information
๐ฎ Client Examples
Ready-to-use client examples are available in the examples/ directory:
๐ Available Examples
simple-client.js- Basic connection and tool usagesmithery-client.js- Full-featured demonstrationsecure-client.js- Environment-based secure configuration
๐ Quick Start with Examples
๐ Using with Smithery: The examples are ready for use with servers deployed on Smithery.ai
๐ Detailed Guide: See examples/README.md for complete setup instructions
๐ง Development
Project Structure
Adding New Tools
Create a new function in the appropriate tool file
Register it with the server using
server.tool()Follow the existing patterns for error handling and response formatting
Add documentation to the README
Testing
๐ Troubleshooting
Common Issues
Connection Failed
Verify HOME_ASSISTANT_URL is correct and accessible
Check that Home Assistant is running
Ensure no firewall blocking the connection
Authentication Failed
Verify your long-lived access token is correct
Check token hasn't expired or been revoked
Ensure token has necessary permissions
Entity Not Found
Use
homeassistant_list_all_entitiesto find correct entity IDsCheck entity exists and is enabled in Home Assistant
Verify correct domain prefix (e.g.,
light.,sensor.)
Service Call Failed
Use
homeassistant_list_servicesto verify service availabilityCheck service parameters are correct for your device
Some services require specific entity types or states
Debug Mode
Enable debug logging in your .env:
๐ค Contributing
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureCommit changes:
git commit -m 'Add amazing feature'Push to branch:
git push origin feature/amazing-featureOpen a Pull Request
Development Guidelines
Follow existing code style and patterns
Add proper TypeScript types
Include error handling for all API calls
Update documentation for new features
Test with real Home Assistant instance
๐ API Reference
This MCP server uses the Home Assistant REST API. Key endpoints:
/api/- API information/api/states- Entity states/api/services- Available services/api/config- Configuration/api/history- Historical data/api/logbook- Logbook entries
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
Home Assistant - The amazing smart home platform
Model Context Protocol - Protocol specification
TypeScript - Language and tooling
๐ Support
If you encounter issues or have questions:
Check the troubleshooting section
Search existing GitHub issues
Create a new issue with:
Home Assistant version
MCP server logs
Steps to reproduce
Expected vs actual behavior
Made with โค๏ธ for the Home Assistant community
This server cannot be installed