The Philips Hue MCP Server provides an interface for controlling your Philips Hue lighting system through AI assistants like Claude. Using the Model Context Protocol (MCP), it enables natural language control of your smart lights, allowing you to adjust brightness, change colors, manage groups, and create custom scenes.
pip install phue mcp
Download the server file:
hue_server.py
file directlyRun the server for the first time:
python hue_server.py
~/.hue-mcp/config.json
for future useIf you have Claude Desktop installed:
mcp install hue_server.py --name "Philips Hue Controller"
For development and testing:
mcp dev hue_server.py
Once connected, you can start by asking Claude: "I'd like to control my Philips Hue lights. Can you show me which lights I have available?"
hue://lights
- Information about all lightshue://lights/{light_id}
- Detailed information about a specific lighthue://groups
- Information about all light groupshue://groups/{group_id}
- Information about a specific grouphue://scenes
- Information about all scenesget_all_lights
- Get information about all lightsget_light
- Get detailed information about a specific lightturn_on_light
- Turn on a specific lightturn_off_light
- Turn off a specific lightset_brightness
- Adjust light brightness (0-254)set_color_rgb
- Set light color using RGB valuesset_color_temperature
- Set light color temperature (2000-6500K)get_all_groups
- Get information about all light groupsturn_on_group
- Turn on all lights in a groupturn_off_group
- Turn off all lights in a groupset_scene
- Apply a scene to a group# Turn on a light
turn_on_light(1)
# Set a light to 50% brightness
set_brightness(1, 127)
# Change a light color to purple
set_color_rgb(1, 128, 0, 128)
# Set reading mode
set_color_preset(1, "reading")
# Turn off all lights in living room (group 2)
turn_off_group(2)
# Create a new group
create_group("Bedroom", [3, 4, 5])
# Set all kitchen lights to energizing mode
set_group_color_preset(3, "energize")
# Apply an existing scene
set_scene(2, "abc123") # Group 2, scene ID abc123
# Create a quick relaxing scene for the living room
quick_scene("Evening Relaxation", group_id=2, rgb=[255, 147, 41], brightness=120)
Run the server with custom settings:
python hue_server.py --host 0.0.0.0 --port 8888 --log-level debug
If automatic discovery doesn't work:
# Create the config directory
mkdir -p ~/.hue-mcp
# Create a config.json file with your bridge IP
echo '{"bridge_ip": "192.168.1.x"}' > ~/.hue-mcp/config.json
Replace "192.168.1.x" with your actual Hue bridge IP address.
~/.hue-mcp/config.json
and restart the server to re-authenticaterefresh_lights
tool to update the light information cacheTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "hue-lights" '{"command":"python","args":["hue_server.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"hue-lights": {
"command": "python",
"args": [
"hue_server.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"hue-lights": {
"command": "python",
"args": [
"hue_server.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect