Home Assistant MCP Server
Servidor MCP de Home Assistant
Un servidor de Protocolo de Contexto de Modelo (MCP) para interactuar con Home Assistant. Este servidor proporciona herramientas para controlar y supervisar sus dispositivos Home Assistant mediante aplicaciones compatibles con MCP.
Este proyecto forma parte del ecosistema del Protocolo de Contexto de Modelo de IA (MCP). Para más información y documentación sobre las herramientas MCP, visite www.aimcp.info .
Características
Obtener estados del dispositivo
Estados del dispositivo de control (encendido/apagado)
Automatizaciones de activación
Lista de entidades disponibles
Related MCP server: Hass-MCP
Instalación
Clonar este repositorio:
git clone https://github.com/yourusername/homeassistant-server-mcp.git
cd homeassistant-server-mcpInstalar dependencias:
npm installConstruir el proyecto:
npm run buildConfigure el servidor MCP agregando lo siguiente a su archivo de configuración de MCP (normalmente ubicado en
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonpara 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"
}
}
}
}Reemplace your-homeassistant-url y your-long-lived-access-token con la URL de su instancia de Home Assistant y el token de acceso.
Uso
El servidor proporciona las siguientes herramientas:
1. Obtener el estado del dispositivo
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "get_state",
arguments: {
entity_id: "light.living_room"
}
});2. Alternar estado del dispositivo
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "toggle_entity",
arguments: {
entity_id: "switch.bedroom",
state: "on" // or "off"
}
});3. Automatización de activadores
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "trigger_automation",
arguments: {
automation_id: "automation.morning_routine"
}
});4. Entidades de lista
// Example usage
use_mcp_tool({
server_name: "homeassistant",
tool_name: "list_entities",
arguments: {
domain: "light" // optional, filters by domain
}
});Contribuyendo
¡Agradecemos tus contribuciones! Puedes ayudarnos de la siguiente manera:
Bifurcar el repositorio
Crea tu rama de funciones (
git checkout -b feature/amazing-feature)Confirme sus cambios (
git commit -m 'Add some amazing feature')Empujar a la rama (
git push origin feature/amazing-feature)Abrir una solicitud de extracción
Asegúrese de actualizar las pruebas según corresponda y seguir el estilo del código existente.
Documentación
Para obtener documentación detallada sobre las herramientas MCP y el ecosistema:
Visita www.aimcp.info
Consulte el directorio de herramientas MCP en el sitio web
Lea las guías de integración y las mejores prácticas
Licencia
Este proyecto está licenciado bajo la licencia MIT: consulte a continuación para obtener más detalles:
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.Seguridad
Para utilizar este servidor de forma segura:
Utilice siempre HTTPS para su instancia de Home Assistant
Mantenga sus tokens de acceso seguros y nunca los comprometa con el control de versiones
Gire periódicamente sus tokens de acceso
Utilice variables de entorno para información confidencial
Apoyo
Si tiene algún problema o pregunta, por favor:
Verifique los problemas existentes en el repositorio
Crea un nuevo problema si tu problema no ha sido reportado
Proporcione tanto contexto como sea posible al informar problemas.
Visite www.aimcp.info para obtener recursos de soporte adicionales
Available Tools
4 toolsget_stateC
Get the current state of a Home Assistant entity
Inputs: entity_id (required).
list_entitiesC
List all available entities in Home Assistant
Inputs: domain.
toggle_entityC
Toggle a Home Assistant entity on/off
Inputs: entity_id (required), state (required).
trigger_automationC
Trigger a Home Assistant automation
Inputs: automation_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: get_state retrieves entity status, list_entities enumerates available entities, toggle_entity changes binary states, and trigger_automation initiates automations. The actions (get, list, toggle, trigger) and targets (state, entities, entity, automation) are uniquely paired, eliminating any ambiguity.
All tool names follow a consistent verb_noun pattern using snake_case: get_state, list_entities, toggle_entity, and trigger_automation. The verbs are precise and descriptive, and the naming convention is uniform across all four tools, making them predictable and easy to understand.
With 4 tools, the count is slightly low but reasonable for basic Home Assistant control. It covers core operations like monitoring and toggling entities, and triggering automations, though it lacks advanced actions like setting specific states or managing scenes, which might be expected in a more comprehensive set.
The tool set covers essential read and toggle operations for entities and automations, providing a functional surface for basic interactions. However, there are minor gaps, such as the inability to set specific entity states (e.g., brightness or temperature) or manage other Home Assistant components like scenes or scripts, which could limit more complex agent workflows.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
A Model Context Protocol server for Wix AI tools
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.3MIT
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.29353MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows large language models to control and query Home Assistant smart home systems through natural language interactions.28 npm5MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive Model Context Protocol server providing 60 tools across 9 categories to interact with and manage Home Assistant smart home systems via the REST API.5MIT