Home Assistant Light MCP
Identifies and diagnoses Bluetooth-connected lighting devices within the Home Assistant environment to verify connectivity and response times.
Provides detailed control over Home Assistant lights, enabling users to manage states, brightness, RGB colors, color temperature, effects, and scenes.
Implements specific logic to handle IKEA Tradfri lighting hardware, addressing known issues with mode switching and command timing to ensure reliable scene activation.
Identifies and diagnoses Zigbee-connected lighting devices within the Home Assistant environment to verify connectivity and response times.
Click on "Deploy 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., "@Home Assistant Light MCP Set the living room lights to warm white at 50% brightness"
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.
Home Assistant Light MCP
A Model Context Protocol (MCP) server for controlling Home Assistant lights and managing scenes. Complements the official Home Assistant MCP by providing detailed light control with colors and scene management.
Like this project? Give it a ⭐ on GitHub and help others discover it!
Design Philosophy: Lights Only
This MCP intentionally controls only lights - not switches, not other entities. This is a deliberate safety decision:
Switches can control critical systems - HVAC, heaters, air conditioning, water pumps
Accidental activation could be dangerous - turning on a heater while away, disabling AC in summer
Lights are safe - worst case is lights turn on/off unexpectedly
If you need to control switches or other entities, use the official Home Assistant MCP or automations with appropriate safeguards.
Related MCP server: hass-mcp-extensions
Features
Show Lights - View all lights with full details:
State, brightness, RGB colors, color temperature
Color mode and supported modes
Available effects (colorloop, etc.)
Color temperature range (min/max Kelvin)
Adjust Light - Control lights (on/off, brightness, RGB color, color temperature, effects)
Create Scene - Save current lighting as a scene with two modes:
exclusive- Turns off other lights when activatedadditive- Only affects lights in the scene
List Scenes - View all saved scenes
Activate Scene - Activate a saved scene (with IKEA Tradfri support)
Update Scene - Update an existing scene with current light states
Delete Scene - Remove a scene
Blackout - Turn off all lights (with optional exclusions)
Why This MCP?
The official Home Assistant MCP is limited - it can't show light colors or provide detailed state information. This MCP fills that gap:
Feature | Official HA MCP | This MCP |
Show light colors | No | Yes |
Show brightness | Limited | Full detail |
Show color modes | No | Yes |
Show effects | No | Yes |
Set RGB colors | No | Yes |
Color temperature | No | Yes |
Set effects | No | Yes |
Create scenes | No | Yes |
IKEA Tradfri fixes | No | Yes |
Installation
npm install -g ha-mcp-serverOr clone and build:
git clone https://github.com/Koneisto/HomeAssistant-Light-MCP.git
cd HomeAssistant-Light-MCP
npm install
npm run buildConfiguration
Add to your MCP client configuration:
Claude Desktop
Edit config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Option 1: Using npx (recommended, no global install needed)
{
"mcpServers": {
"ha-light-scenes": {
"command": "npx",
"args": ["-y", "ha-mcp-server"],
"env": {
"HA_URL": "http://your-home-assistant-ip:8123",
"HA_TOKEN": "your-long-lived-access-token"
}
}
}
}Option 2: Global install
npm install -g ha-mcp-server{
"mcpServers": {
"ha-light-scenes": {
"command": "ha-mcp-server",
"env": {
"HA_URL": "http://your-home-assistant-ip:8123",
"HA_TOKEN": "your-long-lived-access-token"
}
}
}
}Other MCP Clients
The same configuration structure works with any MCP-compatible client.
Get your Home Assistant token
Go to Home Assistant → Profile (bottom left)
Scroll to "Long-Lived Access Tokens"
Click "Create Token"
Copy the token
Usage Examples
Show lights
"Show me all the lights"
"What lights are on?"
Control lights
"Turn on living room light"
"Set bedroom to 50% brightness"
"Make the kitchen light red"
"Set studio lights to warm white"
"Start colorloop on the hallway light"
Create a scene
"Save this as Movie Night"
Activate a scene
"Activate Movie Night"
Update a scene
"Update Evening Lights with current settings"
Blackout
"Turn off all lights"
"Turn off all lights except the balcony"
Tools Reference
Tool | Description |
| Show all lights with state, brightness, colors, effects, color modes |
| Control a light (on/off, brightness, color, effects) |
| Create a new scene from current light states |
| List all scenes |
| Activate a scene |
| Update existing scene with current lights |
| Delete a scene |
| Turn off all lights (supports exclusions) |
| Diagnose lights and scenes, check connectivity |
| Fix scene problems, restore from backup |
| Set Home Assistant URL and token |
Light Properties
scene_show_lights returns:
state- on/offbrightness/brightness_pct- 0-255 / 0-100%rgb_color- [R, G, B] valuescolor_temp_kelvin- Color temperaturecolor_mode- Current mode (xy, color_temp, rgb, hs)supported_color_modes- What the light supportseffect- Active effect (if any)effect_list- Available effectscolor_temp_range- Min/max Kelvin (if supported)
Scene Modes
Exclusive: Turns off all lights not in the scene. Good for room-specific scenes.
Additive: Only affects lights in the scene. Good for accent lighting.
Local Backup & Multi-Instance Support
This MCP maintains a local backup of scenes you create:
Automatic backup: Scenes are saved to
~/.config/ha-mcp-server/scenes-backup.jsonMulti-instance aware: Detects when another MCP instance (or HA UI) modifies scenes
Smart conflict resolution: Merges changes from multiple sources
Restore capability: Can restore scenes if Home Assistant loses them
Diagnostics (scene_diagnose)
Analyzes your lights and scenes to identify problems:
Tests light connectivity and response times
Detects connection types (Zigbee, WiFi, Bluetooth)
Finds scenes with null values or missing lights
Compares Home Assistant state with local backup
Reports new lights not yet in exclusive scenes
Example: "Run diagnostics on my lights"
Fix & Repair (scene_fix)
Four actions to repair scene problems:
Action | Description |
| Auto-fix all scenes: remove null values, add missing lights to exclusive scenes |
| Fix a specific scene by name |
| Activate a scene and report what went wrong |
| Restore scenes from local backup if Home Assistant lost them |
Example: "Fix all my scenes" or "Restore Evening Lights from backup"
IKEA Tradfri Support
IKEA Tradfri lights have a known issue when switching between RGB color mode and color temperature (Kelvin) mode. The bulbs need time to process the mode change before accepting brightness or color values.
Note: Home Assistant's native scenes don't work reliably with Tradfri lights due to these timing issues. This MCP provides a workaround by managing scenes independently with proper delays.
This MCP automatically handles Tradfri lights by:
Detecting Tradfri devices by manufacturer name
Adding a 500ms delay between mode switch and subsequent commands
Properly sequencing color/temperature changes with brightness adjustments
Without these fixes, Tradfri lights often ignore commands or produce incorrect colors when switching modes.
Security
Your Data Stays Local
All communication happens directly between your computer and your Home Assistant instance
No data is sent to external servers or third parties
The MCP server runs locally on your machine via stdio (no open network ports)
No Tracking
We don't care enough to track you
Token Safety
Your Home Assistant token is stored only on your local machine
Use environment variables to avoid storing tokens in files
The token is only sent to your own Home Assistant instance
You can revoke the token anytime from Home Assistant settings
What This Server Can Access
Only lights and scenes in your Home Assistant
Cannot access other Home Assistant entities (sensors, locks, cameras, etc.)
Cannot make changes outside of light control and scene management
Contributing
Found a bug or have an idea? Open an issue or submit a pull request!
License
MIT - Use freely, attribution appreciated but not required.
Author
Built by people with questionable priorities
Available Tools
13 toolsscene_activateA
Activate a scene in Home Assistant. REQUIRES user_confirmed=true - user must explicitly request scene activation.
Inputs: entity_id (required), user_confirmed (required).
scene_adjust_lightA
PREFERRED for controlling lights. Turn on/off, set brightness (0-100%), RGB color, color temperature (Kelvin), or effects. IMPORTANT: This only changes the light's current state - it does NOT save to any scene. REQUIRES user_confirmed=true - user must explicitly request the change.
Inputs: entity_id (required), user_confirmed (required), state, brightness, +4 more.
scene_blackoutA
Turn off ALL lights. Optionally create/update a 'Blackout' scene. REQUIRES user_confirmed=true - user must explicitly request blackout.
Inputs: user_confirmed (required), exclude, create_scene.
scene_configureA
Configure the Home Assistant connection for the Scene MCP server. Required before using other scene_ tools if not already configured via environment variables.
Inputs: url (required), token (required).
scene_createA
Create a NEW scene in Home Assistant. ONLY call when user EXPLICITLY asks to create/save a NEW scene. Before calling: 1) Show current lights with scene_show_lights, 2) Ask user for mode: 'exclusive' or 'additive'. Do NOT call this to update existing scenes - use scene_update for that.
Inputs: name (required), mode (required), entity_ids, icon.
scene_deleteC
Delete a scene from Home Assistant
Inputs: entity_id (required).
scene_diagnoseA
Diagnose lights and scenes. Tests connectivity, response times, identifies problems with scenes (null values, missing lights, etc.), and provides recommendations. If test_connectivity=true, REQUIRES user_confirmed=true because it toggles lights.
Inputs: test_connectivity, user_confirmed.
scene_fixA
Fix problems found by scene_diagnose. Can fix null values, add missing lights to exclusive scenes, restore from backup, or interactively test and fix a specific scene. test_scene action REQUIRES user_confirmed=true because it changes lights.
Inputs: action (required), scene_name, issues, user_confirmed.
scene_historyB
View history of scene changes (snapshots). Shows what the scene looked like before recent updates or deletions. Useful for debugging or understanding what changed.
Inputs: scene_id, limit.
scene_listB
List all scenes from Home Assistant
Inputs: no named parameters.
scene_show_lightsA
SAFE read-only tool. Shows ALL Home Assistant lights with FULL details. Does NOT change anything. Use this to answer questions about light states, colors, brightness. Returns: state (on/off), brightness_pct, color_mode ('color_temp' for white light, 'rgb'/'hs'/'xy' for colored light), color_temp_kelvin (for white mode), rgb_color (for color mode). IMPORTANT: When color_mode is 'color_temp', the light is in WHITE mode - do NOT report RGB values as those are just approximations.
Inputs: filter.
scene_syncA
Sync local backup with Home Assistant. Fetches all scenes from HA and updates local backup to match. Useful for ensuring backup is current before making changes.
Inputs: no named parameters.
scene_updateA
Update an existing scene with current light states. ONLY call this when user EXPLICITLY asks to save/update a scene. Do NOT call automatically after adjusting lights. For exclusive mode: captures ALL lights (on lights with settings, off lights as 'off').
Inputs: entity_id (required), entity_ids, mode.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Every tool has a clearly distinct purpose with no ambiguity. For example, scene_activate activates scenes, scene_adjust_light controls lights, scene_create makes new scenes, and scene_update modifies existing ones. The descriptions explicitly differentiate overlapping concepts, such as scene_adjust_light for temporary changes versus scene_create/scene_update for permanent scene storage.
All tools follow a consistent 'scene_' prefix with descriptive snake_case names, such as scene_list, scene_create, and scene_diagnose. This pattern is maintained across all 13 tools, making them predictable and easy to identify by function, with no deviations in naming style.
With 13 tools, the set is well-scoped for managing Home Assistant scenes and lights, covering operations like listing, creating, updating, deleting, diagnosing, and syncing. Each tool serves a specific role in the workflow, from configuration (scene_configure) to detailed diagnostics (scene_diagnose), without feeling excessive or insufficient.
The tool surface provides complete CRUD and lifecycle coverage for scenes and lights, including creation, listing, updating, deletion, activation, and diagnostics. It also handles edge cases like backups (scene_sync), history (scene_history), and safe read-only operations (scene_show_lights), leaving no obvious gaps for agent interactions in this domain.
Maintenance
Related MCP Connectors
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
MCP server for lightfield documentation, generated by doc2mcp.
Find MCP servers for ESP32, Arduino, 3D printers, Home Assistant, cameras and other hardware.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for full Home Assistant control, enabling AI agents to manage dashboards, automations, files, apps, entities, and more via REST API, WebSocket, and SSH.66151 npmMIT
- AlicenseAqualityBmaintenanceAn MCP server that layers additional Home Assistant tools on top of voska/hass-mcp, enabling Lovelace dashboard management, automation/scene manipulation, SSH file access, and recorder database queries.28MIT
- AlicenseAqualityDmaintenanceMCP server for controlling Elgato Key Lights. Enables turning lights on/off, adjusting brightness and color temperature, applying presets, and triggering effects via Claude.13Apache 2.0
- AlicenseAqualityDmaintenanceMCP server that enables AI agents to control Twinkly lights through natural language, supporting operations like on/off, color, brightness, and effects.1412 npmISC