kungfusheep/hue
If you are the rightful owner of hue and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server and CLI for Philips Hue v2 API, enabling native lighting effects and comprehensive control for both AI agents and command-line users.
list_lights
Discover all available lights
light_on/off
Control individual lights
light_brightness
Set brightness (0-100%)
light_color
Set color (hex or name)
light_effect
Apply native effects (candle, fire, sparkle, etc.)
Philips Hue MCP Server & CLI
A Model Context Protocol (MCP) server and CLI for Philips Hue v2 API, enabling native lighting effects and comprehensive control for both AI agents and command-line users.
Features
Core Lighting Control
- ā Native v2 Effects: Candle, fire, sparkle, cosmos, prism, opal, glisten, and more!
- ā Comprehensive Light Control: On/off, brightness, color, effects
- ā Group Management: Control entire rooms at once
- ā Scene Support: Activate and manage scenes
- ā Device Discovery: Automatic detection of all Hue devices
Advanced Features (New!)
- š Non-blocking Operations: All commands execute asynchronously by default
- š Pre-built Effects: Flash, pulse, color loop, strobe, and alert patterns
- šØ Custom Sequences: Build complex lighting choreography with precise timing
- š¾ Scene Caching: Save complex lighting setups for instant recall - perfect for RPGs!
- š Real-time Event Streaming: Subscribe to motion, button, and light state changes
- š¦ Batch Commands: Execute multiple commands with timing control
- š® Entertainment Areas: Support for gaming and media sync (DTLS foundation ready)
- š CRUD Operations: Full create, read, update, delete for all resources
Prerequisites
- Go 1.21 or later
- Philips Hue Bridge with v2 API support
- Hue Bridge API username (see setup below)
Setup
1. Get Your Hue Bridge IP and Username
Find your bridge IP:
curl https://discovery.meethue.com/
Get an API username:
# Press the link button on your Hue Bridge, then run:
curl -X POST http://<BRIDGE_IP>/api -H "Content-Type: application/json" -d '{"devicetype":"hue#claude"}'
2. Build the MCP Server
# Clone the repository
git clone https://github.com/kungfusheep/hue.git
cd hue
# Build the binary
go build -o hue
3. Set Environment Variables
export HUE_BRIDGE_IP="192.168.1.100" # Your bridge IP
export HUE_USERNAME="your-api-username-here"
4. Configure Claude Desktop (example)
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"hue": {
"command": "/absolute/path/to/hue",
"env": {
"HUE_BRIDGE_IP": "YOUR_BRIDGE_IP",
"HUE_USERNAME": "YOUR_API_USERNAME"
}
}
}
}
5. Restart Claude Desktop
Quit and restart Claude Desktop to load the new configuration.
CLI Usage
The hue
binary functions as both an MCP server and a standalone CLI tool:
# Run as MCP server (for Claude Desktop)
./hue
# Run CLI commands directly
./hue <command>
# Examples:
./hue lights list
./hue lights on "Office Lamp"
./hue lights color "Office Lamp" blue
./hue lights brightness "Office Lamp" 50
# Group control
./hue groups list
./hue groups on "Living Room"
./hue groups color "Kitchen" warm
./hue groups rooms # List all rooms
# Effects
./hue effects flash "Office Lamp" --color red --count 3
./hue effects pulse "Bedroom Light" --min 10 --max 90
./hue effects stop <sequence-id>
# Native Hue scenes
./hue hue-scenes list
./hue hue-scenes activate "Relax"
# Cached scenes (from MCP)
./hue scenes list
./hue scenes recall "alien_artifact_discovery"
# Sensors
./hue sensors motion # List motion sensors
./hue sensors temperature # List temperature sensors
./hue sensors light # List light level sensors
# Real-time event streaming
./hue stream # Stream all events
./hue stream -f motion # Stream only motion events
./hue stream -f "motion,temperature" # Multiple event types
./hue stream -r # Show raw JSON events
# Batch commands
./hue batch -f commands.json
The CLI supports friendly names for all lights and rooms - no need to use UUIDs!
MCP Usage Examples
Once configured, you can ask Claude to:
Basic Control
- "Turn on all office lights"
- "Set the living room to candle effect"
- "Dim bedroom lights to 20%"
- "Make the kitchen lights blue"
Effects & Sequences
- "Flash the office lights red when my timer goes off"
- "Make the lamp pulse like a heartbeat"
- "Start a rainbow color loop on the kids' room lights"
- "Create a sunrise simulation in the bedroom"
- "Alert me with the desk lamp" (rapid attention-getting flashes)
Advanced Control
- "Create a custom sequence that fades from red to blue over 10 seconds"
- "Run a party mode with strobe effects"
- "Show me all running light effects"
- "Stop all light animations"
Sensors & Automation
- "Subscribe to motion sensor events"
- "List all temperature sensors"
- "Show me when someone presses the Hue button"
Available Tools
Basic Light Control
list_lights
- Discover all available lightslight_on/off
- Control individual lightslight_brightness
- Set brightness (0-100%)light_color
- Set color (hex or name)light_effect
- Apply native effects (candle, fire, sparkle, etc.)identify_light
- Make a light breathe for identification
Group & Room Control
list_groups
- Discover all groups/roomsgroup_on/off
- Control entire groupsgroup_brightness
- Set group brightnessgroup_color
- Set group colorgroup_effect
- Apply effects to groupslist_rooms
- Discover all rooms with devices
Scenes & Automation
list_scenes
- List available scenesactivate_scene
- Activate a scenebatch_commands
- Execute multiple commands with timing (async by default! + scene caching!)
Pre-built Effects š
flash_effect
- Attention-getting flashes (notifications, alerts)pulse_effect
- Smooth breathing effect (meditation, ambiance)color_loop
- Continuous color cycling (parties, mood lighting)strobe_effect
- Rapid disco strobe (ā ļø use responsibly!)alert_effect
- Pre-programmed alert pattern
Advanced Sequencing šØ
custom_sequence
- Build complex multi-step lighting choreographylist_sequences
- View all running effectsstop_sequence
- Stop one or more running effects (supports batch stopping)
Scene Caching š¾
recall_scene
- Instantly recall a cached lighting atmospherelist_cached_scenes
- View all saved scenes with usage statsclear_cached_scene
- Remove a cached sceneexport_scene
- Export scene as JSON for sharing/backup
Sensors & Events
list_motion_sensors
- Get motion sensor stateslist_temperature_sensors
- Get temperature readingsstart_event_stream
- Subscribe to real-time eventsstop_event_stream
- Stop event subscription
Entertainment & CRUD
list_entertainment
- View entertainment areascreate_resource
- Create new resources (lights, groups, etc.)update_resource
- Modify existing resourcesdelete_resource
- Remove resources
Key Features Explained
š Non-blocking Operations
All lighting commands execute asynchronously by default. This means:
- Claude responds immediately while lights change in the background
- You can stack multiple effects on different lights
- Complex sequences won't freeze the conversation
- Use
async: false
in batch commands if you need to wait
š Effects System
The MCP includes a powerful effects engine:
- Pre-built effects for common scenarios (alerts, ambiance, parties)
- Custom sequences for precise choreography
- Parallel execution - run multiple effects simultaneously
- Loop support - effects can repeat indefinitely
- See for detailed examples
š¾ Scene Caching for RPGs
Perfect for game masters who need instant atmosphere changes:
First time - Create and cache:
"Set up mysterious alien artifact discovery lighting"
ā Claude creates complex 15-command sequence with purple/blue colors, pulsing, flickering
ā Automatically caches as "alien_artifact_discovery"
Later in the game - Instant recall:
"Recall the alien artifact scene"
ā Instantly recreates the exact same atmosphere
Features:
- Cache complex multi-command scenes with
cache_name
in batch_commands - Instant recall with
recall_scene
- Track usage with
list_cached_scenes
- Export scenes for sharing with other GMs
- Scenes persist throughout your Claude session
š Real-time Events
Subscribe to live updates from your Hue system:
- Motion sensor triggers
- Button presses
- Light state changes
- Temperature updates
Troubleshooting
-
"Failed to connect to Hue bridge"
- Verify your bridge IP is correct
- Ensure your API username is valid
- Check you're on the same network as the bridge
-
"Light/group not found"
- Use
list_lights
orlist_groups
to see available IDs - Light names are case-sensitive
- Use
-
Effects not working
- Not all lights support all effects
- Use dynamic effect discovery to see supported effects
Development
Run tests:
go test ./...
Run comprehensive test suite:
# Set environment variables first
go run test_comprehensive.go
Development Status
This MCP server provides comprehensive coverage of the Philips Hue v2 API (90%+):
- ā Complete light, group, scene, and room control
- ā Full sensor integration
- ā Real-time event streaming
- ā Advanced effects and sequencing
- ā Non-blocking asynchronous operations
- š§ Entertainment streaming (DTLS foundation implemented, full streaming in progress)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
Apache 2.0 Licence