MCP Home Assistant Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Home Assistant Serverturn on the living room lights"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Home Assistant Server
A Model Context Protocol (MCP) server that allows Large Language Models (LLMs) like Claude to control your Home Assistant devices and smart home setup.
Features
Device Control: Control lights, switches, climate devices, and more
Device Discovery: Get lists of all devices or filter by type
State Monitoring: Check current device states
Docker Containerized: Runs in isolated Docker containers with auto-cleanup
Secure Configuration: All credentials stored in environment variables
Clean Integration: Optimized logging prevents error messages in Claude Desktop
On-Demand Architecture: Containers spawn only when needed, auto-remove when done
Related MCP server: Crestron Home MCP Server
Prerequisites
Docker and Docker Compose installed
Home Assistant instance running (yours is at
192.168.200.111:8123)Long-Lived Access Token from Home Assistant
Setup
1. Get Home Assistant Access Token
Go to your Home Assistant instance:
http://192.168.200.111:8123Navigate to Profile (bottom left menu)
Scroll down to Long-Lived Access Tokens
Click Create Token
Give it a name like "MCP Server"
Copy the generated token
2. Configure Environment Variables
Copy the example environment file:
cp env_example.txt .envEdit the
.envfile and replaceyour_long_lived_access_token_herewith your actual token:HOME_ASSISTANT_TOKEN=your_actual_token_hereVerify other settings:
HOME_ASSISTANT_URLshould already be set to your instanceVERIFY_SSLshould betrueunless you're using self-signed certificates
3. Build the Docker Image
# Build the Docker image
docker-compose build
# Test the image (optional)
echo '{"jsonrpc": "2.0", "method": "initialize", "id": 1}' | docker run --rm -i --env-file .env mcp-homeassistant-mcp-homeassistantNote: You don't need to run containers manually - Claude Desktop will manage them automatically!
Available Tools
The MCP server provides the following tools that LLMs can use:
Device Discovery
get_all_devices: Get a list of all devices and their current statesget_devices_by_type: Get devices of a specific type (light, switch, climate, etc.)get_device_state: Get the current state of a specific device
Device Control
control_light: Control lights (turn on/off, adjust brightness, color temperature)control_switch: Control switches (turn on/off/toggle)control_climate: Control climate devices (temperature, mode)
Usage with Claude
To use this MCP server with Claude Desktop:
Install Claude Desktop from https://claude.ai/download
Configure MCP in Claude Desktop:
Open Claude Desktop settings
Go to the MCP section
Add a new MCP server with these settings:
{ "mcpServers": { "home-assistant": { "command": "docker", "args": [ "run", "--rm", "-i", "--stop-timeout=5", "--env-file", "/path/to/your/MCP-HomeAssistant/.env", "mcp-homeassistant-mcp-homeassistant" ] } } }Replace
/path/to/your/MCP-HomeAssistant/.envwith the full path to your.envfile
Restart Claude Desktop
Test the integration by asking Claude to control your devices:
"Turn on the living room lights"
"What's the current temperature in the bedroom?"
"List all my smart switches"
Example Interactions
Here are some example conversations you can have with Claude:
User: Can you turn on the living room lights?
Claude: I'll help you turn on the living room lights. Let me check what lights are available first.
[Claude uses the get_devices_by_type tool to find lights]
[Claude uses the control_light tool to turn on the lights]
The living room lights have been turned on successfully!User: What's the temperature in my house?
Claude: Let me check your climate devices to see the current temperatures.
[Claude uses the get_devices_by_type tool to find climate devices]
Based on your climate devices, here's the current status:
- Living Room: 72°F
- Bedroom: 70°F
- Kitchen: 74°FTroubleshooting
Connection Issues
Verify your Home Assistant URL is correct:
http://192.168.200.111:8123Check that your access token is valid and not expired
Ensure your Docker container can reach your Home Assistant instance
SSL Issues
If you're using self-signed certificates, set VERIFY_SSL=false in your .env file.
Docker Issues
Make sure Docker is running:
docker --versionTest the image manually:
docker run --rm -i --env-file .env mcp-homeassistant-mcp-homeassistantRebuild if needed:
docker-compose build --no-cache
MCP Integration Issues
Verify the path to your
.envfile in the Claude Desktop configurationRestart Claude Desktop after configuration changes
Check Docker Desktop for running containers (multiple containers during use is normal)
Multiple Container Issue
If you see many containers running:
This is normal behavior - Claude Desktop spawns containers on-demand
Containers auto-remove when conversations end (thanks to
--rmflag)Use the cleanup script if needed:
./cleanup-containers.sh
JSON-RPC Errors
If you see error messages in Claude Desktop:
Make sure you're using the latest version of the Docker image
The logging has been optimized to prevent stdout interference
Restart Claude Desktop to clear any cached issues
Security Notes
Your
.envfile contains sensitive credentials - keep it secureThe MCP server only has access to the Home Assistant API token you provide
Consider restricting the token's permissions in Home Assistant if possible
Never commit the
.envfile to version control
Container Management
Normal Operation
Multiple containers during use is expected - Claude Desktop spawns containers on-demand
Containers auto-cleanup when conversations end (via
--rmflag)No manual management needed - the system handles container lifecycle
Manual Cleanup (if needed)
# Stop all MCP containers
./cleanup-containers.sh
# Or manually:
docker stop $(docker ps -q --filter "ancestor=mcp-homeassistant-mcp-homeassistant")
docker container prune -fViewing Logs
# View logs from running containers
docker logs <container-name>
# Or check the log file inside container
docker exec <container-name> cat /app/mcp_server.logDevelopment
To modify the MCP server:
Edit
mcp_server.pyRebuild the container:
docker-compose buildTest:
docker run --rm -i --env-file .env mcp-homeassistant-mcp-homeassistantRestart Claude Desktop to use the new image
License
This project is open source. Feel free to modify and distribute.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI agents to control and monitor Home Assistant smart home devices through natural language interactions. Supports device control, entity state monitoring, history access, and automation generation with both MCP protocol and standalone HTTP REST API modes.1MIT
- Flicense-qualityDmaintenanceEnables LLMs to discover and control Crestron Home automation systems through natural language, including lights, shades, scenes, thermostats, and sensors with multi-language support and fuzzy device name matching.2
- Alicense-qualityDmaintenanceEnables AI assistants to interact with Home Assistant smart home devices through natural language. Control devices, manage automations, query entity states, and retrieve historical data across your home automation system.1MIT
- Alicense-qualityCmaintenanceEnables AI assistants to interact with Home Assistant to control smart home devices, query entity states, and manage automations using natural language. It provides over 90 tools for comprehensive system management, including dashboard configuration, service execution, and automation debugging.MIT
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolovnet/MCP-HomeAssistant'
If you have feedback or need assistance with the MCP directory API, please join our Discord server