hue-go-mcp
An MCP server that controls a Philips Hue light over Zigbee via zigbee2mqtt for setups with no Hue Bridge or Home Assistant available (such as for travel and conference scenarios). It speaks MQTT, so any MCP client can read and drive the lamp.
Tools
| Tool | What it does |
|---|---|
set_power(on) |
Turn the lamp on/off |
set_brightness(level) |
Brightness, 0.0–1.0 |
set_color_rgb(r, g, b) |
Color from RGB, each 0.0–1.0 (zigbee2mqtt does the gamut conversion) |
set_color_name(name) |
Color by name: red, green, blue, yellow, cyan, magenta, orange, purple, pink, white, warm, cool |
set_color_temp(mired) |
White color temperature, 150 (cool) – 500 (warm) |
get_state() |
Read back {power, brightness, rgb, model, color_temp_mired, available, link_quality} |
pulse(count, period, min_level, max_level, color) |
Smooth "breathe" fade; restores brightness + power when done |
How it works
MCP client → hue-go-mcp → MQTT broker → zigbee2mqtt → Zigbee coordinator → Hue lamp
Prerequisites
- A Zigbee coordinator (any zigbee2mqtt-supported USB stick) with your Hue light paired into zigbee2mqtt.
- An MQTT broker zigbee2mqtt publishes to (e.g. Mosquitto).
- Python ≥ 3.10.
Setting up the coordinator + zigbee2mqtt + broker is standard zigbee2mqtt territory — see zigbee2mqtt.io. setup-zigbee2mqtt.md has a concrete walkthrough for a SONOFF Dongle Plus MG24 on Windows.
Install
pip install hue-go-mcp # from PyPI
Or run it without installing, straight from PyPI, with uv: uvx hue-go-mcp. For local development from a checkout: pip install -e . (or just pip install "mcp[cli]" aiomqtt and run hue_go_mcp.py directly).
Configure
Set environment variables (only Z2M_DEVICE is required):
| Var | Default | Notes |
|---|---|---|
Z2M_DEVICE |
— | The lamp's zigbee2mqtt friendly name. Find it with python z2m_list_lights.py |
MQTT_BROKER |
localhost |
MQTT broker host |
MQTT_PORT |
1883 |
MQTT broker port |
MQTT_USERNAME / MQTT_PASSWORD |
— | Only if your broker requires auth |
Z2M_BASE_TOPIC |
zigbee2mqtt |
zigbee2mqtt base topic |
HUE_MODEL |
7602031U7 |
Reported in get_state().model |
MCP_TRANSPORT |
stdio |
stdio / http (streamable-http at /mcp) |
Run
Z2M_DEVICE=hue_go python hue_go_mcp.py # stdio
Z2M_DEVICE=hue_go MCP_TRANSPORT=http python hue_go_mcp.py # serves /mcp
On Windows (PowerShell): $env:Z2M_DEVICE="hue_go"; python hue_go_mcp.py.
Smoke-test with the MCP Inspector: mcp dev hue_go_mcp.py, then call set_power(true), set_color_name("red"), pulse(count=2) and watch the lamp.
Use from an MCP client
The server talks stdio and can run anywhere that can reach the broker; the lamp only needs to be in Zigbee range of the coordinator. It only functions while your MQTT broker and zigbee2mqtt are running (see Prerequisites) — otherwise the tools load but every call fails to reach the lamp.
Claude Code
claude mcp add hue-go --env MQTT_BROKER=localhost --env Z2M_DEVICE=hue_go -- uvx hue-go-mcp
Claude Desktop
Add to claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"hue-go": {
"command": "uvx",
"args": ["hue-go-mcp"],
"env": { "MQTT_BROKER": "localhost", "Z2M_DEVICE": "hue_go" }
}
}
}
Any MCP client
Same shape as above: run uvx hue-go-mcp (or python /absolute/path/to/hue_go_mcp.py from a checkout) with MQTT_BROKER and Z2M_DEVICE in the environment. uvx requires uv; if you installed with pip install hue-go-mcp instead, use the hue-go-mcp console script it puts on your PATH as the command.
Tests
pip install -e ".[test]" && pytest
Tests inject a fake MQTT client and assert the exact /set payloads and state parsing — no broker or hardware required.
Files
hue_go_mcp.py— the MCP server (FastMCP).hue_mqtt.py— zigbee2mqtt transport (MqttLamp) over MQTT.z2m_list_lights.py— list zigbee2mqtt devices to findZ2M_DEVICE.setup-zigbee2mqtt.md— coordinator + broker + pairing walkthrough (Windows / SONOFF MG24).zigbee-plan.md— design rationale.
License
MIT
Metadata
Release files for hue-go-mcp 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hue_go_mcp-0.3.1.tar.gz | 14.9 kB | Without provenance | Details for hue_go_mcp-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hue_go_mcp-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for hue_go_mcp-0.3.1-py3-none-any.whl |
Total release size: 27.0 kB
Release files / hue_go_mcp-0.3.1.tar.gz
| Download URL | hue_go_mcp-0.3.1.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07b880b04b020080be2901171701e90a915b9e64b54f72cd0b2ee45d944a4aa9
|
|
BLAKE2b-256 checksum How to use checksums |
c4ae768159ca0dafeaae5e95c3abde214995d9f92360652d64471ba887725c02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / hue_go_mcp-0.3.1-py3-none-any.whl
| Download URL | hue_go_mcp-0.3.1-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1d6c22fdb6d2a5283d612693313386e0e5e4736fa3adaa10a02f581a6c675fe
|
|
BLAKE2b-256 checksum How to use checksums |
cd9d3560a420fe9cc862e1f8e9e13fb898cfd8ecb4add30f0800c1c1ec063bf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for hue-go-mcp 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.