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
python3 server.pyEnvironment 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
mcpo
Exposes Model Context Protocol (MCP) tools as OpenAPI-compatible HTTP servers.
ha-mcp
Provides AI agents with complete control over Home Assistant via REST and WebSocket APIs, offering a comprehensive suite of tools for smart home management, automation, and debugging.
mcp-openapi-server
A Model Context Protocol (MCP) server that exposes OpenAPI endpoints as MCP tools, along with optional support for MCP prompts and resources, enabling Large Language Models to interact with REST APIs.
metorial-platform
An open source integration platform for agentic AI, connecting AI models to external APIs, data sources, and tools.