zigbee2mqtt-mcp 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/config.js +12 -5
- package/dist/index.js +23 -2
- package/dist/tools.js +126 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# zigbee2mqtt-mcp
|
|
2
2
|
|
|
3
|
+
[](https://github.com/alexpfau/zigbee2mqtt-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/zigbee2mqtt-mcp)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://glama.ai/mcp/servers/alexpfau/zigbee2mqtt-mcp)
|
|
7
|
+
|
|
3
8
|
A [Model Context Protocol](https://modelcontextprotocol.io) server for **administering** a Zigbee2MQTT estate.
|
|
4
9
|
|
|
5
10
|
Most Zigbee integrations already let an assistant turn a light on. This one is for the layer underneath: mesh health, weak links, devices that keep rejoining, stale batteries, firmware updates, pairing, binding, reporting intervals and device options — the things you normally open the Zigbee2MQTT frontend for.
|
|
@@ -95,6 +100,15 @@ Tools above the active tier are not registered at all, so a model cannot reach f
|
|
|
95
100
|
|
|
96
101
|
Irreversible tools (`z2m_remove_device`, `z2m_ota_update`, `z2m_touchlink`, `z2m_restart_bridge`, `z2m_set_bridge_options`) additionally require `confirm: true` on every call.
|
|
97
102
|
|
|
103
|
+
Every tool also advertises MCP [tool annotations](https://modelcontextprotocol.io/specification/server/tools) so a client can decide what may run without prompting:
|
|
104
|
+
|
|
105
|
+
| Annotation | Meaning here |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `readOnlyHint: true` | The seven read tools. They never change the network. |
|
|
108
|
+
| `destructiveHint: true` | `z2m_remove_device`, `z2m_ota_update`, `z2m_touchlink`, `z2m_restart_bridge`, `z2m_set_bridge_options` |
|
|
109
|
+
| `idempotentHint` | True where repeating the call has no additional effect |
|
|
110
|
+
| `openWorldHint: true` | Always — every tool reaches a live Zigbee network |
|
|
111
|
+
|
|
98
112
|
Opt in to the destructive tier only when you want it:
|
|
99
113
|
|
|
100
114
|
```jsonc
|
package/dist/config.js
CHANGED
|
@@ -36,14 +36,21 @@ function oneOf(name, allowed, fallback) {
|
|
|
36
36
|
}
|
|
37
37
|
return value;
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export const MISSING_MQTT_URL = "Z2M_MQTT_URL is not set, e.g. mqtt://192.168.1.10:1883 " +
|
|
40
|
+
"(mqtt://, mqtts://, ws:// and wss:// are supported). " +
|
|
41
|
+
"Point it at the MQTT broker Zigbee2MQTT uses, not the Zigbee2MQTT frontend port.";
|
|
42
|
+
/**
|
|
43
|
+
* `requireMqttUrl: false` lets the server start unconfigured so clients and
|
|
44
|
+
* directory scanners can still enumerate tools; calls then fail with a clear
|
|
45
|
+
* message rather than the process refusing to start.
|
|
46
|
+
*/
|
|
47
|
+
export function loadConfig({ requireMqttUrl = true } = {}) {
|
|
40
48
|
const mqttUrl = process.env.Z2M_MQTT_URL;
|
|
41
|
-
if (!mqttUrl) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
"(mqtt://, mqtts://, ws:// and wss:// are supported).");
|
|
49
|
+
if (!mqttUrl && requireMqttUrl) {
|
|
50
|
+
throw new Error(MISSING_MQTT_URL);
|
|
44
51
|
}
|
|
45
52
|
return {
|
|
46
|
-
mqttUrl,
|
|
53
|
+
mqttUrl: mqttUrl || "mqtt://unconfigured.invalid:1883",
|
|
47
54
|
username: process.env.Z2M_MQTT_USERNAME || undefined,
|
|
48
55
|
password: process.env.Z2M_MQTT_PASSWORD || undefined,
|
|
49
56
|
baseTopic: (process.env.Z2M_BASE_TOPIC || "zigbee2mqtt").replace(/\/+$/, ""),
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,18 @@ import { createLogger, loadConfig } from "./config.js";
|
|
|
8
8
|
import { selectTools } from "./tools.js";
|
|
9
9
|
const { version } = createRequire(import.meta.url)("../package.json");
|
|
10
10
|
async function main() {
|
|
11
|
-
|
|
11
|
+
let config;
|
|
12
|
+
let configError;
|
|
13
|
+
try {
|
|
14
|
+
config = loadConfig();
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
configError = error.message;
|
|
18
|
+
config = loadConfig({ requireMqttUrl: false });
|
|
19
|
+
}
|
|
12
20
|
const log = createLogger(config.logLevel);
|
|
21
|
+
if (configError)
|
|
22
|
+
log.error(configError);
|
|
13
23
|
const client = new Z2MClient(config, log);
|
|
14
24
|
const ctx = { client, config };
|
|
15
25
|
const tools = selectTools(config.writeMode);
|
|
@@ -18,9 +28,20 @@ async function main() {
|
|
|
18
28
|
`${config.mqttUrl} (base topic '${config.baseTopic}')`);
|
|
19
29
|
const server = new Server({ name: "zigbee2mqtt-mcp", version }, { capabilities: { tools: {} } });
|
|
20
30
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
21
|
-
tools: tools.map(({ name, description, inputSchema }) => ({
|
|
31
|
+
tools: tools.map(({ name, description, inputSchema, annotations }) => ({
|
|
32
|
+
name,
|
|
33
|
+
description,
|
|
34
|
+
inputSchema,
|
|
35
|
+
annotations,
|
|
36
|
+
})),
|
|
22
37
|
}));
|
|
23
38
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
39
|
+
if (configError) {
|
|
40
|
+
return {
|
|
41
|
+
isError: true,
|
|
42
|
+
content: [{ type: "text", text: configError }],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
24
45
|
const tool = byName.get(request.params.name);
|
|
25
46
|
if (!tool) {
|
|
26
47
|
const known = [...byName.keys()].join(", ");
|
package/dist/tools.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { buildHealthReport, detectCapabilities, isCoordinator, normalize, } from "./devices.js";
|
|
2
|
+
/** Every tool reaches a live Zigbee network, so openWorldHint is always true. */
|
|
3
|
+
const readOnly = (title) => ({
|
|
4
|
+
title,
|
|
5
|
+
readOnlyHint: true,
|
|
6
|
+
destructiveHint: false,
|
|
7
|
+
idempotentHint: true,
|
|
8
|
+
openWorldHint: true,
|
|
9
|
+
});
|
|
10
|
+
const mutating = (title, { destructive = false, idempotent = false } = {}) => ({
|
|
11
|
+
title,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
destructiveHint: destructive,
|
|
14
|
+
idempotentHint: idempotent,
|
|
15
|
+
openWorldHint: true,
|
|
16
|
+
});
|
|
2
17
|
const EMPTY = { type: "object", properties: {} };
|
|
3
18
|
const DEVICE_ID = {
|
|
4
19
|
type: "string",
|
|
@@ -65,9 +80,12 @@ const readTools = [
|
|
|
65
80
|
{
|
|
66
81
|
name: "z2m_bridge_info",
|
|
67
82
|
tier: "read",
|
|
83
|
+
annotations: readOnly("Get bridge status"),
|
|
68
84
|
description: "Get Zigbee2MQTT bridge status: version, coordinator type and firmware, Zigbee channel and PAN ID, " +
|
|
69
|
-
"permit_join state, log level, whether a restart is required, and host OS/memory. " +
|
|
70
|
-
"Start here to understand the estate
|
|
85
|
+
"permit_join state, log level, whether a restart is required, and host OS/memory. Read-only. " +
|
|
86
|
+
"Start here to understand the estate, then use z2m_health_report for problems or z2m_list_devices " +
|
|
87
|
+
"for individual devices. Returns a JSON object; set include_config only if you need the full " +
|
|
88
|
+
"Zigbee2MQTT configuration, which is large.",
|
|
71
89
|
inputSchema: {
|
|
72
90
|
type: "object",
|
|
73
91
|
properties: {
|
|
@@ -123,9 +141,13 @@ const readTools = [
|
|
|
123
141
|
{
|
|
124
142
|
name: "z2m_list_devices",
|
|
125
143
|
tier: "read",
|
|
144
|
+
annotations: readOnly("List devices"),
|
|
126
145
|
description: "List Zigbee devices with administrative detail: type, model, vendor, power source, link quality, " +
|
|
127
|
-
"battery, availability, last_seen, interview state and pending OTA updates.
|
|
128
|
-
"
|
|
146
|
+
"battery, availability, last_seen, interview state and pending OTA updates. Read-only, though " +
|
|
147
|
+
"collect_seconds will wait before answering. Use this to answer 'which devices are offline' or " +
|
|
148
|
+
"'which have the weakest signal'. Prefer z2m_health_report for a prioritised summary of everything " +
|
|
149
|
+
"wrong at once, and z2m_get_device when you need one device's exposes, options or bindings. " +
|
|
150
|
+
"Returns {total, returned, capabilities, devices[]}.",
|
|
129
151
|
inputSchema: {
|
|
130
152
|
type: "object",
|
|
131
153
|
properties: {
|
|
@@ -194,8 +216,11 @@ const readTools = [
|
|
|
194
216
|
{
|
|
195
217
|
name: "z2m_get_device",
|
|
196
218
|
tier: "read",
|
|
219
|
+
annotations: readOnly("Get device detail"),
|
|
197
220
|
description: "Get full detail for one device: current state, exposed properties, configurable device options with " +
|
|
198
|
-
"their schema, endpoints, bindings and configured reportings.
|
|
221
|
+
"their schema, endpoints, bindings and configured reportings. Read-only. Call this before " +
|
|
222
|
+
"z2m_set_device_options, z2m_bind or z2m_configure_reporting to discover valid values. " +
|
|
223
|
+
"Use z2m_list_devices instead when you want many devices or do not know the exact name.",
|
|
199
224
|
inputSchema: {
|
|
200
225
|
type: "object",
|
|
201
226
|
properties: {
|
|
@@ -237,10 +262,14 @@ const readTools = [
|
|
|
237
262
|
{
|
|
238
263
|
name: "z2m_health_report",
|
|
239
264
|
tier: "read",
|
|
265
|
+
annotations: readOnly("Audit estate health"),
|
|
240
266
|
description: "Audit the whole Zigbee estate in one call and return everything that needs attention: offline devices, " +
|
|
241
267
|
"weak links, stale devices, low batteries, failed or pending interviews, unsupported devices, disabled " +
|
|
242
268
|
"devices, pending OTA updates, and devices that keep rejoining or changing network address. " +
|
|
243
|
-
"
|
|
269
|
+
"Read-only and generates no Zigbee traffic, so prefer it over z2m_check_updates and z2m_network_map " +
|
|
270
|
+
"for routine checks. Use this to answer 'is my Zigbee network healthy?'. " +
|
|
271
|
+
"Returns {bridge, totals, capabilities, issues, hints}; an empty issues object means nothing is wrong. " +
|
|
272
|
+
"Note that collect_seconds makes the call wait for that many seconds before answering.",
|
|
244
273
|
inputSchema: {
|
|
245
274
|
type: "object",
|
|
246
275
|
properties: { collect_seconds: COLLECT_SECONDS },
|
|
@@ -253,9 +282,12 @@ const readTools = [
|
|
|
253
282
|
{
|
|
254
283
|
name: "z2m_network_map",
|
|
255
284
|
tier: "read",
|
|
285
|
+
annotations: readOnly("Scan mesh topology"),
|
|
256
286
|
description: "Scan the Zigbee mesh topology and return per-device parent, depth, link quality and route count, plus " +
|
|
257
287
|
"orphaned or weakly-attached devices. WARNING: the scan makes the network less responsive and can take " +
|
|
258
|
-
"10 seconds to several minutes depending on estate size. Run it deliberately, not routinely
|
|
288
|
+
"10 seconds to several minutes depending on estate size. Run it deliberately, not routinely, and prefer " +
|
|
289
|
+
"z2m_health_report or z2m_list_devices when you only need per-device link quality. " +
|
|
290
|
+
"Returns {node_count, link_count, orphans, weak, nodes[]} unless raw is set.",
|
|
259
291
|
inputSchema: {
|
|
260
292
|
type: "object",
|
|
261
293
|
properties: {
|
|
@@ -299,7 +331,10 @@ const readTools = [
|
|
|
299
331
|
{
|
|
300
332
|
name: "z2m_list_groups",
|
|
301
333
|
tier: "read",
|
|
302
|
-
|
|
334
|
+
annotations: readOnly("List groups"),
|
|
335
|
+
description: "List Zigbee groups with their members and scenes. Read-only. " +
|
|
336
|
+
"Use z2m_manage_group to change groups, and z2m_list_devices for individual devices. " +
|
|
337
|
+
"Returns {total, groups[]}; an empty list means no groups are defined.",
|
|
303
338
|
inputSchema: EMPTY,
|
|
304
339
|
handler: async (_args, ctx) => {
|
|
305
340
|
const snap = await ctx.client.snapshot();
|
|
@@ -309,9 +344,12 @@ const readTools = [
|
|
|
309
344
|
{
|
|
310
345
|
name: "z2m_get_logs",
|
|
311
346
|
tier: "read",
|
|
347
|
+
annotations: readOnly("Read bridge logs"),
|
|
312
348
|
description: "Read Zigbee2MQTT bridge logs and lifecycle events (device_joined, device_interview, device_leave, " +
|
|
313
|
-
"device_announce). Returns buffered history by default
|
|
314
|
-
"
|
|
349
|
+
"device_announce). Read-only. Returns buffered history by default; watch_seconds instead blocks for " +
|
|
350
|
+
"that many seconds collecting new lines. Logs are only captured while this server is connected, so " +
|
|
351
|
+
"history may be empty on a fresh start — use watch_seconds then. Use to diagnose pairing failures and " +
|
|
352
|
+
"rejoin loops; prefer z2m_health_report to find which devices are affected in the first place.",
|
|
315
353
|
inputSchema: {
|
|
316
354
|
type: "object",
|
|
317
355
|
properties: {
|
|
@@ -356,9 +394,11 @@ const safeTools = [
|
|
|
356
394
|
{
|
|
357
395
|
name: "z2m_check_updates",
|
|
358
396
|
tier: "safe",
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
"
|
|
397
|
+
annotations: mutating("Check for firmware updates", { idempotent: true }),
|
|
398
|
+
description: "Actively query devices for available OTA firmware updates. Changes no configuration, but it does put " +
|
|
399
|
+
"real traffic on the Zigbee network and can take a minute per device. Without arguments it checks every " +
|
|
400
|
+
"mains-powered router. Prefer z2m_health_report for a passive answer at no network cost, and use this " +
|
|
401
|
+
"only when you need a fresh check. Follow with z2m_ota_update to actually flash.",
|
|
362
402
|
inputSchema: {
|
|
363
403
|
type: "object",
|
|
364
404
|
properties: {
|
|
@@ -388,8 +428,11 @@ const safeTools = [
|
|
|
388
428
|
{
|
|
389
429
|
name: "z2m_permit_join",
|
|
390
430
|
tier: "safe",
|
|
391
|
-
|
|
392
|
-
|
|
431
|
+
annotations: mutating("Open or close pairing", { idempotent: true }),
|
|
432
|
+
description: "Open or close the network for new devices to join. While open, any nearby Zigbee device may join, so " +
|
|
433
|
+
"keep the window short and close it with time=0 when finished. Optionally scope joining to a single " +
|
|
434
|
+
"router, which is the recommended way to pair a device into a specific part of the mesh. " +
|
|
435
|
+
"Use z2m_bridge_info to see whether joining is currently open.",
|
|
393
436
|
inputSchema: {
|
|
394
437
|
type: "object",
|
|
395
438
|
properties: {
|
|
@@ -414,9 +457,12 @@ const safeTools = [
|
|
|
414
457
|
{
|
|
415
458
|
name: "z2m_set_device_options",
|
|
416
459
|
tier: "safe",
|
|
460
|
+
annotations: mutating("Set device options", { idempotent: true }),
|
|
417
461
|
description: "Change Zigbee2MQTT device options such as transition, retain, debounce, temperature_precision or " +
|
|
418
|
-
"calibration offsets.
|
|
419
|
-
"
|
|
462
|
+
"calibration offsets. Options are merged, not replaced, and persist in the Zigbee2MQTT configuration. " +
|
|
463
|
+
"Call z2m_get_device first to see settable_options for that device. Use z2m_set_state to change what a " +
|
|
464
|
+
"device is doing, and z2m_set_bridge_options for bridge-wide settings. The response reports whether a " +
|
|
465
|
+
"bridge restart is required.",
|
|
420
466
|
inputSchema: {
|
|
421
467
|
type: "object",
|
|
422
468
|
properties: {
|
|
@@ -434,9 +480,11 @@ const safeTools = [
|
|
|
434
480
|
{
|
|
435
481
|
name: "z2m_rename_device",
|
|
436
482
|
tier: "safe",
|
|
483
|
+
annotations: mutating("Rename device"),
|
|
437
484
|
description: "Rename a device's friendly_name. Renaming changes its MQTT topic, so anything referencing the old " +
|
|
438
|
-
"name (automations, dashboards, scripts)
|
|
439
|
-
"Home Assistant entity."
|
|
485
|
+
"name (automations, dashboards, scripts) breaks until updated — this is reversible only by renaming " +
|
|
486
|
+
"back. Set homeassistant_rename to also rename the Home Assistant entity. " +
|
|
487
|
+
"Use z2m_set_device_options for behaviour changes that do not affect the topic.",
|
|
440
488
|
inputSchema: {
|
|
441
489
|
type: "object",
|
|
442
490
|
properties: {
|
|
@@ -462,8 +510,11 @@ const safeTools = [
|
|
|
462
510
|
{
|
|
463
511
|
name: "z2m_configure_device",
|
|
464
512
|
tier: "safe",
|
|
513
|
+
annotations: mutating("Reconfigure device", { idempotent: true }),
|
|
465
514
|
description: "Re-run a device's configuration routine (bindings and attribute reporting). Use when a device stopped " +
|
|
466
|
-
"reporting values. Battery devices must be woken immediately before calling this
|
|
515
|
+
"reporting values. Battery devices must be woken immediately before calling this, or it fails after a " +
|
|
516
|
+
"timeout. Use z2m_interview_device instead when Zigbee2MQTT does not know the device's capabilities at " +
|
|
517
|
+
"all, and z2m_configure_reporting to change one specific attribute rather than re-running everything.",
|
|
467
518
|
inputSchema: { type: "object", properties: { device: DEVICE_ID }, required: ["device"] },
|
|
468
519
|
handler: async (args, ctx) => {
|
|
469
520
|
const { raw } = await loadDevices(ctx);
|
|
@@ -474,8 +525,12 @@ const safeTools = [
|
|
|
474
525
|
{
|
|
475
526
|
name: "z2m_interview_device",
|
|
476
527
|
tier: "safe",
|
|
477
|
-
|
|
478
|
-
|
|
528
|
+
annotations: mutating("Re-interview device", { idempotent: true }),
|
|
529
|
+
description: "Re-interview a device so Zigbee2MQTT re-reads its endpoints, clusters and basic attributes. The device " +
|
|
530
|
+
"may be briefly unavailable while this runs, and battery devices must be awake. Useful after a firmware " +
|
|
531
|
+
"upgrade adds functionality, or to recover a device stuck in a failed interview — check interview_state " +
|
|
532
|
+
"via z2m_get_device first. Use z2m_configure_device instead when the interview succeeded but reporting " +
|
|
533
|
+
"stopped working.",
|
|
479
534
|
inputSchema: { type: "object", properties: { device: DEVICE_ID }, required: ["device"] },
|
|
480
535
|
handler: async (args, ctx) => {
|
|
481
536
|
const { raw } = await loadDevices(ctx);
|
|
@@ -486,8 +541,12 @@ const safeTools = [
|
|
|
486
541
|
{
|
|
487
542
|
name: "z2m_set_state",
|
|
488
543
|
tier: "safe",
|
|
544
|
+
annotations: mutating("Set or read device state"),
|
|
489
545
|
description: "Send a state command to a device or group, e.g. {\"state\":\"ON\"} or {\"brightness\":128}. " +
|
|
490
|
-
"
|
|
546
|
+
"Physically changes what the device is doing, and is reversible by sending the opposite command. " +
|
|
547
|
+
"mode='get' instead requests a value without changing anything. The command is published without " +
|
|
548
|
+
"waiting for the device, so success here means the message was sent, not that the device acted — read " +
|
|
549
|
+
"z2m_get_device afterwards to confirm. Consult z2m_get_device exposes for valid properties.",
|
|
491
550
|
inputSchema: {
|
|
492
551
|
type: "object",
|
|
493
552
|
properties: {
|
|
@@ -513,8 +572,12 @@ const safeTools = [
|
|
|
513
572
|
{
|
|
514
573
|
name: "z2m_manage_group",
|
|
515
574
|
tier: "safe",
|
|
575
|
+
annotations: mutating("Manage groups"),
|
|
516
576
|
description: "Create or remove groups, rename them, and add or remove device members. Groups let a single Zigbee " +
|
|
517
|
-
"multicast control many devices, which is far more responsive than commanding each device in turn."
|
|
577
|
+
"multicast control many devices, which is far more responsive than commanding each device in turn. " +
|
|
578
|
+
"Removing a group does not affect the devices themselves, but fails if a member is unreachable unless " +
|
|
579
|
+
"force is set — with force the device keeps the group membership internally. Use z2m_list_groups to " +
|
|
580
|
+
"inspect groups first, and z2m_set_state to control a group once created.",
|
|
518
581
|
inputSchema: {
|
|
519
582
|
type: "object",
|
|
520
583
|
properties: {
|
|
@@ -562,9 +625,12 @@ const safeTools = [
|
|
|
562
625
|
{
|
|
563
626
|
name: "z2m_bind",
|
|
564
627
|
tier: "safe",
|
|
628
|
+
annotations: mutating("Bind or unbind clusters"),
|
|
565
629
|
description: "Bind or unbind clusters between two devices, or between a device and a group. Binding lets a remote " +
|
|
566
630
|
"control a light directly over Zigbee without a round trip through the coordinator, so it keeps working " +
|
|
567
|
-
"even if the bridge is down.
|
|
631
|
+
"even if the bridge is down. Reversible with action='unbind'; action='clear' removes all binds from the " +
|
|
632
|
+
"source device at once. Append /ENDPOINT to target a specific endpoint, e.g. 'my_remote/left' — check " +
|
|
633
|
+
"z2m_get_device endpoints first. Both devices must be awake.",
|
|
568
634
|
inputSchema: {
|
|
569
635
|
type: "object",
|
|
570
636
|
properties: {
|
|
@@ -594,9 +660,12 @@ const safeTools = [
|
|
|
594
660
|
{
|
|
595
661
|
name: "z2m_configure_reporting",
|
|
596
662
|
tier: "safe",
|
|
663
|
+
annotations: mutating("Configure attribute reporting", { idempotent: true }),
|
|
597
664
|
description: "Configure how often a device reports an attribute. Tightening intervals improves responsiveness; " +
|
|
598
665
|
"loosening them saves battery. Set maximum_report_interval to 65535 to disable reporting. " +
|
|
599
|
-
"Battery devices must be woken immediately before calling this
|
|
666
|
+
"Battery devices must be woken immediately before calling this, and not all devices support the " +
|
|
667
|
+
"command. Use z2m_get_device to see existing configured_reportings, and z2m_configure_device to " +
|
|
668
|
+
"re-run the whole default configuration instead of one attribute.",
|
|
600
669
|
inputSchema: {
|
|
601
670
|
type: "object",
|
|
602
671
|
properties: {
|
|
@@ -630,9 +699,12 @@ const fullTools = [
|
|
|
630
699
|
{
|
|
631
700
|
name: "z2m_remove_device",
|
|
632
701
|
tier: "full",
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
"
|
|
702
|
+
annotations: mutating("Remove device from network", { destructive: true }),
|
|
703
|
+
description: "Remove a device from the Zigbee network. IRREVERSIBLE: the device must be re-paired afterwards, and " +
|
|
704
|
+
"its automations and history references break. The coordinator can only ask a device to leave, so " +
|
|
705
|
+
"sleeping battery devices often fail unless woken. force=true deletes it from the database only, " +
|
|
706
|
+
"leaving it holding the network key until factory reset. Requires confirm=true. " +
|
|
707
|
+
"Prefer disabling a device in Zigbee2MQTT if you only want it to stop reporting.",
|
|
636
708
|
inputSchema: {
|
|
637
709
|
type: "object",
|
|
638
710
|
properties: {
|
|
@@ -659,8 +731,11 @@ const fullTools = [
|
|
|
659
731
|
{
|
|
660
732
|
name: "z2m_ota_update",
|
|
661
733
|
tier: "full",
|
|
662
|
-
|
|
663
|
-
|
|
734
|
+
annotations: mutating("Flash device firmware", { destructive: true }),
|
|
735
|
+
description: "Flash a device's firmware over the air. IRREVERSIBLE and high risk: it can take many minutes, must not " +
|
|
736
|
+
"be interrupted, and can brick the device if it loses power. Run z2m_check_updates first to confirm an " +
|
|
737
|
+
"update exists. Use action='schedule' to defer the flash until the device next checks in, which is " +
|
|
738
|
+
"safer for battery devices, and action='abort' to stop one in progress. Requires confirm=true.",
|
|
664
739
|
inputSchema: {
|
|
665
740
|
type: "object",
|
|
666
741
|
properties: {
|
|
@@ -693,8 +768,10 @@ const fullTools = [
|
|
|
693
768
|
{
|
|
694
769
|
name: "z2m_restart_bridge",
|
|
695
770
|
tier: "full",
|
|
696
|
-
|
|
697
|
-
|
|
771
|
+
annotations: mutating("Restart Zigbee2MQTT", { destructive: true, idempotent: true }),
|
|
772
|
+
description: "Restart Zigbee2MQTT. Briefly interrupts all Zigbee control and drops in-flight commands; the mesh " +
|
|
773
|
+
"itself is unaffected and devices reconnect automatically. Needed after changing options that report " +
|
|
774
|
+
"restart_required=true, which z2m_bridge_info also shows. Requires confirm=true.",
|
|
698
775
|
inputSchema: {
|
|
699
776
|
type: "object",
|
|
700
777
|
properties: { confirm: { type: "boolean", description: "Must be true to proceed." } },
|
|
@@ -708,8 +785,12 @@ const fullTools = [
|
|
|
708
785
|
{
|
|
709
786
|
name: "z2m_set_bridge_options",
|
|
710
787
|
tier: "full",
|
|
711
|
-
|
|
712
|
-
|
|
788
|
+
annotations: mutating("Change bridge configuration", { destructive: true, idempotent: true }),
|
|
789
|
+
description: "Change Zigbee2MQTT configuration at runtime, e.g. log level, availability or last_seen. Changes are " +
|
|
790
|
+
"written to the Zigbee2MQTT configuration and persist across restarts, so a bad value can affect the " +
|
|
791
|
+
"whole installation. Options are merged into the existing config. The config schema is available via " +
|
|
792
|
+
"z2m_bridge_info with include_config=true. Some changes report restart_required, which needs " +
|
|
793
|
+
"z2m_restart_bridge. Use z2m_set_device_options for a single device instead. Requires confirm=true.",
|
|
713
794
|
inputSchema: {
|
|
714
795
|
type: "object",
|
|
715
796
|
properties: {
|
|
@@ -729,17 +810,23 @@ const fullTools = [
|
|
|
729
810
|
{
|
|
730
811
|
name: "z2m_coordinator_check",
|
|
731
812
|
tier: "full",
|
|
813
|
+
annotations: mutating("Check coordinator memory", { idempotent: true }),
|
|
732
814
|
description: "Check whether any routers are missing from the coordinator's memory, which causes pairing failures and " +
|
|
733
|
-
"devices dropping off.
|
|
734
|
-
"
|
|
815
|
+
"devices dropping off. Changes nothing, but queries the coordinator directly. Only supported on Texas " +
|
|
816
|
+
"Instruments adapters (CC2652/CC1352); other adapters return an error — z2m_bridge_info reports whether " +
|
|
817
|
+
"yours qualifies under capabilities.coordinator_check. Returns {missing_routers[]}; an empty list is " +
|
|
818
|
+
"healthy. Use z2m_network_map for a topology view on any adapter.",
|
|
735
819
|
inputSchema: EMPTY,
|
|
736
820
|
handler: async (_args, ctx) => ctx.client.request("coordinator_check", {}, 60_000),
|
|
737
821
|
},
|
|
738
822
|
{
|
|
739
823
|
name: "z2m_touchlink",
|
|
740
824
|
tier: "full",
|
|
741
|
-
|
|
742
|
-
|
|
825
|
+
annotations: mutating("Touchlink scan, identify or reset", { destructive: true }),
|
|
826
|
+
description: "Touchlink scan, identify or factory reset. action='scan' and 'identify' are harmless; " +
|
|
827
|
+
"action='factory_reset' is IRREVERSIBLE and, without ieee_address and channel, affects the physically " +
|
|
828
|
+
"nearest Touchlink device, which may not be the one you intend — run 'scan' first and pass an explicit " +
|
|
829
|
+
"target. Use z2m_remove_device to remove a device already paired to this network. Requires confirm=true.",
|
|
743
830
|
inputSchema: {
|
|
744
831
|
type: "object",
|
|
745
832
|
properties: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zigbee2mqtt-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"mcpName": "io.github.alexpfau/zigbee2mqtt-mcp",
|
|
5
5
|
"description": "Model Context Protocol server for administering a Zigbee2MQTT estate: health reporting, network diagnostics, OTA updates, pairing and device management over the MQTT bridge API.",
|
|
6
6
|
"keywords": [
|