
HomeAssistant Light MCP
io.github.Koneisto由 GitHub 账号 Koneisto 发布v0.6.1更新于 Oct 24, 2026
Control Home Assistant lights and scenes. Lights only by design for safety.
概览
让助手查看、调节并管理 Home Assistant 的灯光与场景,包括颜色、亮度和效果。
- 可以做什么
- 连接 Home Assistant 实例,提供灯光与场景控制工具。可列出所有灯及其状态、亮度、RGB 颜色、色温、颜色模式和效果;调节单盏灯;创建、列出、激活、更新和删除场景;并可关闭全部灯光(支持排除指定灯)。还提供诊断与修复工具,包括从本地备份恢复场景,并处理 IKEA Tradfri 的时序问题。
- 适用场景
- 当你希望助手详细查看和控制 Home Assistant 灯光时适用,尤其是官方 Home Assistant MCP 未提供的颜色、色温和效果。也适合保存与恢复灯光场景,以及排查灯光和场景问题。
- 运行要求
- 以 Node.js 本地进程运行,通常通过 npx 或全局 npm 安装。需要环境变量 HA_URL(Home Assistant 地址)和 HA_TOKEN(Home Assistant 长期访问令牌)。需要能访问 Home Assistant 实例的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 HomeAssistant Light MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Home Assistant Light MCP
[npm version] [CI] [License: MIT]
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.
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:
Installation
Or clone and build:
Configuration
Add to your MCP client configuration:
Claude Desktop
Edit config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Option 1: Using npx (recommended, no global install needed)
Option 2: Global install
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
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.json - Multi-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:
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
来源:README.md,提交 aebc65e
工具
0版本历史
1- v0.6.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分