hue_mcp
Controls Philips Hue lights via natural language commands, including room-based and individual light control, light discovery, and bridge integration.
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., "@hue_mcpturn 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.
Hue MCP Server
A production-ready Model Context Protocol (MCP) server that enables Claude to control Philips Hue lights through natural language commands. Built with FastMCP framework and designed for seamless integration with Claude Desktop.
Features
🏠 Room-based Control: Control current Hue rooms, zones, and groups by name or ID
💡 Individual Light Control: Control any light ID returned by the bridge
🔍 Light Discovery: List all lights and get their current states
🌉 Bridge Integration: Discover and test connectivity to Hue bridge
⚡ High Performance: Async operations with connection pooling and rate limiting
🛡️ Error Handling: Comprehensive error handling with retry logic
📊 Production Ready: Full test coverage, logging, and monitoring
Related MCP server: IntelliGlow
Available MCP Tools
Tool | Description | Parameters |
| Control individual light by ID |
|
| Control all lights in a room |
|
| Get current state of a light |
|
| List all lights and states | None |
| List current bridge rooms, zones, and groups with membership | None |
| Test bridge connectivity | None |
Rooms and Lights
The bridge is the source of truth. No light IDs, room names, or memberships are configured in code, and inventory is fetched on each request.
Call
hue_list_lightsfor current light IDs and states.Call
hue_list_roomsfor current rooms, zones, and groups with IDs and membership.Pass a group ID or name to
hue_control_room. Names are case-insensitive; underscores can replace spaces (for example,living_room).If multiple groups share a name, use the group ID to select one explicitly.
allor0targets every light currently on the bridge.Positive light IDs are checked by the bridge, including IDs above 17. Missing lights return the bridge's error.
New lights and Hue app room edits take effect on the next request without a restart. Room names from older local mappings must now match an actual bridge group.
Supported Actions
on- Turn lights onoff- Turn lights offtoggle- Toggle light state
Installation
Prerequisites
Python 3.10 or higher
Philips Hue Bridge on local network
Bridge username (already configured for IP 192.168.1.64)
Install Dependencies
# Install the package
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"Environment Configuration
Copy the environment template:
cp .env.example .envEdit
.envfile if needed (default values work for the configured setup):HUE_BRIDGE_IP=192.168.1.64 HUE_USERNAME=cJdzxhKlxr2h92jwDkTv-DvpOxglPxn147UEg1Gp LOG_LEVEL=INFO
Usage
Running the MCP Server
# Run directly
python -m hue_mcp
# Or using the console script
hue-mcpClaude Desktop Integration
Add this configuration to your Claude Desktop MCP settings:
{
"mcpServers": {
"hue-control": {
"command": "python",
"args": ["-m", "hue_mcp"],
"cwd": "/path/to/hue-mcp-server"
}
}
}Natural Language Examples
Once integrated with Claude Desktop, you can use natural language commands:
"Turn on the kitchen lights" → Turns on the bridge's current kitchen members
"Set office light to 50% brightness" → Dims office light (ID 7) to ~127 brightness
"Turn off all lights" → Turns off all lights using group control
"What lights are currently on?" → Lists all lights with their current states
"Toggle the bedroom lights" → Toggles lights 1 and 4
Testing
Run Unit Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=src --cov-report=term-missing
# Run specific test file
pytest tests/test_hue_client.py -vTest Bridge Connectivity
# Test basic connectivity
python -c "
import asyncio
from src.hue_mcp.hue_client import AsyncHueClient
async def test():
async with AsyncHueClient() as client:
success = await client.test_connection()
print(f'Bridge connection: {\"SUCCESS\" if success else \"FAILED\"}')
asyncio.run(test())
"Development
Code Quality
# Linting and formatting
ruff check src/ --fix
ruff format src/
# Type checking
mypy src/
# Run all quality checks
ruff check . --fix && mypy src/ && ruff format .Project Structure
hue-mcp-server/
├── src/hue_mcp/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # CLI entry point
│ ├── server.py # Main MCP server
│ ├── hue_client.py # Async HTTP client with rate limiting
│ ├── light_manager.py # Business logic and room mappings
│ ├── config.py # Configuration management
│ └── tools/ # MCP tool implementations
│ ├── light_control.py # Individual light control
│ ├── room_control.py # Room-based control
│ └── discovery.py # Light discovery and bridge testing
├── tests/ # Comprehensive test suite
├── pyproject.toml # Project configuration
├── README.md # This file
└── .env.example # Environment templatePerformance
Light Operations: Under 1 second response time
Room Operations: Under 3 seconds for multiple lights
Rate Limiting: 10 light operations/second, 1 group operation/second
Connection Pooling: Optimized HTTP connections with keepalive
Concurrent Operations: Up to 5 concurrent light operations per room
Error Handling
The server includes comprehensive error handling for:
Network Issues: Connection timeouts, DNS failures
Bridge Errors: Invalid light IDs, bridge unavailable
Rate Limiting: Automatic retry with exponential backoff
Validation Errors: Invalid parameters, out-of-range values
Configuration
Environment Variables
Variable | Default | Description |
|
| IP address of Hue bridge |
| (configured) | Bridge authentication username |
|
| Logging level (DEBUG, INFO, WARNING, ERROR) |
|
| Connection timeout (seconds) |
|
| Read timeout (seconds) |
|
| Maximum HTTP connections |
|
| Light operations per second |
|
| Group operations per second |
Troubleshooting
Common Issues
Bridge Not Found
Error: Failed to connect to Hue bridge at 192.168.1.64
Solution: Verify bridge IP and network connectivityAuthentication Failed
Error: Invalid username/authentication
Solution: Verify HUE_USERNAME in .env fileRate Limiting
Warning: Rate limited, retrying...
Solution: Normal behavior, requests will retry automaticallyDebugging
Enable debug logging:
export LOG_LEVEL=DEBUG
python -m hue_mcpBridge Information
IP Address: 192.168.1.64
Username: cJdzxhKlxr2h92jwDkTv-DvpOxglPxn147UEg1Gp
Light IDs: Discovered from the bridge
Rooms and Groups: Discovered from the bridge
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make changes with tests
Run quality checks:
ruff check . --fix && mypy src/ && pytestSubmit a pull request
Built with ❤️ using FastMCP and designed for seamless Claude integration.
FastMCP is pinned to the version verified by the test suite and live deployment. Upgrade it deliberately with the MCP integration tests.
Deployment on dev.local
The active service is hue-mcp in ~/nosuch/mcp-gateway/docker-compose.yml,
built from this repository. Rebuild only that service after pulling changes:
cd ~/nosuch/mcp-gateway
docker compose up -d --build --no-deps hue-mcpDo not run the standalone Compose service alongside it: both bind host port 8000.
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol interface that enables AI assistants like Claude to control Philips Hue smart lighting systems through natural language commands.28MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that allows AI assistants like Claude to control real smart bulbs via UDP network communication, featuring voice commands, AI reasoning, and direct hardware control.1MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to control Philips Hue smart lighting systems through natural language commands.3MIT
- AlicenseNot gradedqualityDmaintenanceA Model Control Protocol (MCP) server that allows Claude to communicate with locally running LLM models via LM Studio.MIT