# zigbee2mqtt-mcp [Health: Active]

**Category:** 🏠 Home Automation  
**Repository:** https://github.com/alexpfau/zigbee2mqtt-mcp  
**GitHub Stars:** 38  
**npm Downloads (last month):** 527  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/zigbee2mqtt-mcp

## Description
Administer a Zigbee2MQTT estate: health, mesh diagnostics, OTA, pairing, device management.

## Tools
Capabilities this server exposes over MCP:

- **z2m_connection_status** — Broker reachability, TLS posture and cached message counts — reports instead of throwing, even when nothing is configured yet
- **z2m_bridge_info** — Version, coordinator, channel, PAN ID, permit_join, restart_required, runtime stats
- **z2m_list_devices** — Filter and sort devices by type, availability, link quality, battery, pending update
- **z2m_get_device** — Exposes, settable options, endpoints, bindings, configured reportings, current state
- **z2m_health_report** — Whole-estate audit in one call
- **z2m_network_map** — Mesh topology with parent, depth, link quality, orphan detection
- **z2m_list_groups** — Groups, members and scenes
- **z2m_get_logs** — Bridge logs and lifecycle events, buffered or watched live
- **z2m_coordinator_check** — Routers missing from the coordinator's memory (Texas Instruments adapters only)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "zigbee2mqtt-mcp": {
    "command": "npx",
    "args": ["-y","zigbee2mqtt-mcp"],
    "env": {
      "Z2M_MQTT_URL": "",
      "Z2M_MQTT_USERNAME": "",
      "Z2M_MQTT_PASSWORD": "",
      "Z2M_BASE_TOPIC": "",
      "Z2M_MQTT_CLIENT_ID": "",
      "Z2M_WRITE_MODE": "",
      "Z2M_LOG_LEVEL": "",
      "Z2M_MQTT_REJECT_UNAUTHORIZED": ""
    }
  }
}
```

**Requires environment variables:** `Z2M_MQTT_URL`, `Z2M_MQTT_USERNAME`, `Z2M_MQTT_PASSWORD`, `Z2M_BASE_TOPIC`, `Z2M_MQTT_CLIENT_ID`, `Z2M_WRITE_MODE`, `Z2M_LOG_LEVEL`, `Z2M_MQTT_REJECT_UNAUTHORIZED` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What zigbee2mqtt-mcp MCP server does

The zigbee2mqtt-mcp MCP server gives an MCP client access to the administration layer of a Zigbee2MQTT deployment. It focuses on information and operations that are normally handled through the Zigbee2MQTT frontend, including mesh condition, device availability, link quality, pairing, bindings, reporting configuration, firmware updates, and bridge settings.

Read tools cover broker connectivity, TLS status, bridge metadata, device inventories, individual device details, estate health, network topology, groups, logs, and coordinator checks. Device listings can be filtered and sorted by properties such as type, availability, link quality, battery level, and pending updates. The coordinator check is limited to supported coordinator backup formats and reports an error for unsupported adapters.

## How it works

The server connects directly to the MQTT broker configured for Zigbee2MQTT. Set the broker URL, not the Zigbee2MQTT frontend address. It communicates through the Zigbee2MQTT MQTT bridge API, so it does not require Home Assistant, Node-RED, or openHAB.

Zigbee2MQTT publishes bridge information as retained MQTT messages. The process subscribes to those topics and stores only the latest payload for each topic in memory; it does not use a database. Requests sent to bridge request topics include transaction identifiers, allowing responses to be matched correctly when calls run concurrently. The process uses stdio and starts and stops with the MCP session.

## Setup and configuration

Install with Node.js 22 or later:

```bash
npx zigbee2mqtt-mcp
```

`Z2M_MQTT_URL` is required and accepts `mqtt`, `mqtts`, `ws`, or `wss` URLs. Use `Z2M_MQTT_USERNAME` and `Z2M_MQTT_PASSWORD` when the broker requires credentials. `Z2M_BASE_TOPIC` defaults to `zigbee2mqtt` and must match Zigbee2MQTT's `mqtt.base_topic`.

Optional settings control the MQTT client ID, log level, connection and request timeouts, TLS certificate validation, and thresholds used for weak-link, low-battery, and stale-device checks. TLS deployments can provide CA, certificate, and key paths; certificate verification can be disabled for self-signed TLS with the corresponding setting.

The server defaults to `Z2M_WRITE_MODE=safe`. Set it to `off` for read-only access or `full` to register all write tools. Full mode includes device removal, OTA updates, Touchlink, bridge restart, and bridge option changes. Irreversible operations require `confirm: true`, and some reducing actions in safe mode also require confirmation.

## Tools and capabilities

The read-only tool set includes:

- `z2m_connection_status` and `z2m_bridge_info` for broker and bridge state.
- `z2m_list_devices` and `z2m_get_device` for inventory, configuration, endpoints, bindings, reporting, and current state.
- `z2m_health_report`, `z2m_network_map`, and `z2m_coordinator_check` for estate and mesh diagnostics.
- `z2m_list_groups` for groups, members, and scenes.
- `z2m_get_logs` for buffered or live bridge logs and lifecycle events.

Safe writes can check updates, permit joining, change device options, rename or configure devices, run interviews, set state, manage groups, bind devices, and configure reporting. Full writes add removal, OTA, bridge restart, bridge option changes, and Touchlink.

## Limitations and notes

Some results depend on Zigbee2MQTT configuration or live traffic. Staleness checks require `advanced.last_seen`, and offline detection requires availability to be enabled. Link quality, battery, and update fields are not retained in device state topics; the server may need a short collection period, while the network-map tool provides authoritative link-quality data.

The coordinator check requires an adapter with supported coordinator backups, including Texas Instruments zStack and Silicon Labs EmberZNet. It does not support deCONZ or ZiGate. The server is tested against Zigbee2MQTT 2.x, and several capabilities depend on bridge endpoints introduced in that version.

_Full upstream README: https://allmcps.com/mcp/zigbee2mqtt-mcp/readme_

