Back to Home
agarib icon

homeassistant-mcp-server

by agarib

Overview

Exposing comprehensive Home Assistant control as a FastAPI/OpenAPI REST and WebSocket API, including AI vision, real-time events, and code execution for AI assistants, automation platforms, and custom integrations.

Installation

Run Command
python3 server.py

Environment Variables

  • PORT
  • LOG_LEVEL
  • HA_URL
  • HA_TOKEN
  • SUPERVISOR_TOKEN
  • HA_CONFIG_PATH
  • VLM_API_KEY_FOR_CAMERA_ANALYSIS

Security Notes

The `ha_execute_python` endpoint allows executing arbitrary Python code using `exec()`. While `safe_globals` attempts to sandbox the environment by providing access only to specified libraries (pandas, numpy, matplotlib, json, datetime, re), `exec()` is an extremely high-risk function. A sophisticated attacker or an LLM with unexpected behavior could potentially bypass the sandbox or leverage vulnerabilities in the exposed libraries to gain unauthorized access or execute arbitrary commands on the host system. This is a critical vulnerability if the endpoint is not perfectly secured and the sandbox is not rigorously tested against advanced exploits. Direct file write operations are also present (`ha_write_file`).

Similar Servers

Stats

Interest Score30
Security Score3
Cost ClassHigh
Avg Tokens1500
Stars1
Forks0
Last Update2025-12-12

Tags

Home AssistantAPIRESTWebSocketAI AssistantSmart HomeAutomationDevice ControlDiagnosticsFile ManagementOpenAPIFastAPIPythonMCPVLMReal-time EventsCode ExecutionData AnalysisSecurity MonitoringLovelace