ha-mcp-server
Verified Safeby DawidSu
Overview
Provides a Model Context Protocol (MCP) server for Claude AI to securely and efficiently interact with Home Assistant configuration files, offering both Docker-based server deployment and Linux desktop integration tools.
Installation
docker-compose up -dEnvironment Variables
- HA_CONFIG_PATH
- LOG_LEVEL
- BACKUP_BEFORE_CHANGE
- MAX_BACKUPS
- USE_GIT
- MONITOR_INTERVAL
- DASHBOARD_PORT
- FRONTEND_PORT
- NODE_ENV
- MCP_SERVER_URL
- CACHE_ENABLED
- CACHE_DEFAULT_TTL
- CACHE_MAX_SIZE
- RATE_LIMIT_ENABLED
- RATE_LIMIT_MAX
- RATE_LIMIT_WINDOW
- CB_FAILURE_THRESHOLD
- CB_RECOVERY_TIMEOUT
- CB_SUCCESS_THRESHOLD
- HC_DISK_WARNING_THRESHOLD
- HC_MEMORY_WARNING_THRESHOLD
Security Notes
The project demonstrates significant effort in security, implementing input validation, file access control (path traversal, extension/size limits, suspicious patterns), and rate limiting via `security-utils.sh`. It uses non-root Docker users and includes extensive security documentation. However, the `cache-manager.sh` script uses `eval "$command"`, allowing arbitrary command execution. While this is currently used for internal commands, its presence in a script callable by the Node.js API server (via `child_process.exec`) poses a critical remote code execution (RCE) vulnerability if an injection vector were to be discovered or introduced. Similarly, the `claude-mcp-widget.py` uses `subprocess.Popen` with f-strings for SSH commands, which, if not properly sanitized or if user input is maliciously crafted, could lead to command injection, though SSH clients typically offer some protection. Users must ensure strict control over all inputs and environments.
Similar 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.
advanced-homeassistant-mcp
A powerful, secure, and extensible Model Context Protocol (MCP) server that enables AI assistants like Claude, GPT, and Cursor to seamlessly interact with Home Assistant. Control your lights, climate, automations, and more through natural language commands.
mcps.nix
Provides a curated library of pre-configured Model Context Protocol (MCP) server presets for Claude Code, integrating seamlessly with Nix-based system configurations like devenv and Home Manager.
openhab-mcp
This project provides an MCP (Model Context Protocol) server to enable AI assistants like Claude and Cline to interact with and manage a real openHAB smart home system via its REST API.