Zigbee2MQTT-MCP
Provides tools for listing and inspecting Zigbee devices, reading and changing their state, and managing the Zigbee2MQTT bridge through its frontend websocket API.
Click on "Install 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., "@Zigbee2MQTT-MCPturn off the bedroom lamp"
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.
Zigbee2MQTT-MCP
An MCP server for Zigbee2MQTT. It lets an LLM (or any MCP client) list and inspect your Zigbee devices, read and change their state, and manage the bridge — all through the Zigbee2MQTT frontend websocket API, so it needs no direct access to your MQTT broker.
Why the frontend API?
Zigbee2MQTT's frontend exposes a websocket at /api that proxies MQTT traffic
as JSON {"topic": ..., "payload": ...} messages (base topic already stripped).
Talking to it instead of the MQTT broker means:
No broker dependency — works even if you don't expose MQTT on the network.
One HTTPS endpoint — reuses your existing reverse proxy / TLS.
Auth-ready — supports the frontend
auth_tokenwhen you enable it.
Requests that change the bridge (bridge/request/*) are correlated to their
bridge/response/* reply via a transaction id, with per-call timeouts. The
retained device snapshot is cached on connect, so reads are instant and the
connection auto-reconnects (re-priming the cache) if it drops.
Related MCP server: mcp2mqtt
Tools
Read
Tool | Description |
| Websocket health + cache readiness |
| All devices (compact summary or |
| Search by name / model / vendor / address |
| Full definition/metadata for one device |
| Current cached state (+ optional |
| All groups and their members |
| Version, coordinator, config, permit-join state |
| Bridge online state / health metrics |
| Scan and return the Zigbee mesh map |
Control
Tool | Description |
| Set state — |
| Check for a firmware update |
| Allow/deny new devices joining |
| Rename a device |
| Unpair a device |
| Per-device options / re-configure |
| Perform a firmware update |
| Group management |
* Protected: disabled unless Z2M_ALLOW_DESTRUCTIVE=true. Reads and
set_device_state are always available.
Configuration
All configuration is via environment variables (see .env.example):
Variable | Default | Description |
|
| Base URL of the Zigbee2MQTT frontend. |
| (empty) | Frontend |
|
| Skip TLS verification for |
|
| Seconds to wait for a |
|
| Seconds to wait for the initial snapshot at startup |
|
| Enable the protected management tools |
|
|
|
|
| HTTP bind + path |
|
| DNS-rebind Host/Origin protection: |
|
| Host allowlist (used when protection is on) |
|
| Log level |
Running
Docker (recommended)
docker run -d --name zigbee2mqtt-mcp -p 8080:8080 \
-e Z2M_FRONTEND_URL=https://zigbee2mqtt.example.com \
ghcr.io/loryanstrant/zigbee2mqtt-mcp:latestThe MCP endpoint is then at http://<host>:8080/mcp.
Or with Compose — copy .env.example to .env, edit it, and:
docker compose up -dLocal (Python 3.11+)
pip install .
Z2M_FRONTEND_URL=https://zigbee2mqtt.example.com python -m zigbee2mqtt_mcpstdio (local MCP client, e.g. Claude Desktop)
{
"mcpServers": {
"zigbee2mqtt": {
"command": "python",
"args": ["-m", "zigbee2mqtt_mcp"],
"env": {
"MCP_TRANSPORT": "stdio",
"Z2M_FRONTEND_URL": "https://zigbee2mqtt.example.com"
}
}
}
}Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytestSecurity
This server exposes control of your Zigbee network. Bind it to a trusted
network (LAN/VPN) or an authenticating proxy, keep Z2M_ALLOW_DESTRUCTIVE=false
unless you need management tools, and never commit a populated .env. See
SECURITY.md.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/loryanstrant/Zigbee2MQTT-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server