@owine/unifi-network-mcp 2.3.3 → 2.5.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/dist/tools/acl.js CHANGED
@@ -85,9 +85,9 @@ function registerAclTools(server, client, readOnly = false) {
85
85
  .optional()
86
86
  .describe("Rule description"),
87
87
  protocolFilter: zod_1.z
88
- .array(zod_1.z.string())
88
+ .array(zod_1.z.enum(["TCP", "UDP"]))
89
89
  .optional()
90
- .describe("Protocols: TCP, UDP"),
90
+ .describe("Protocols this ACL rule will be applied to (TCP, UDP). When null, applies to all protocols"),
91
91
  dryRun: zod_1.z
92
92
  .boolean()
93
93
  .optional()
@@ -115,18 +115,18 @@ function registerAclTools(server, client, readOnly = false) {
115
115
  inputSchema: {
116
116
  siteId: zod_1.z.string().describe("Site ID"),
117
117
  aclRuleId: zod_1.z.string().describe("ACL rule ID"),
118
- type: zod_1.z.string().describe("ACL rule type"),
118
+ type: zod_1.z.enum(["IPV4", "MAC"]).describe("ACL rule type"),
119
119
  name: zod_1.z.string().describe("ACL rule name"),
120
120
  enabled: zod_1.z.boolean().describe("Whether the rule is enabled"),
121
- action: zod_1.z.string().describe("Rule action (ALLOW, DENY, etc.)"),
121
+ action: zod_1.z.enum(["ALLOW", "BLOCK"]).describe("Rule action"),
122
122
  description: zod_1.z
123
123
  .string()
124
124
  .optional()
125
125
  .describe("Rule description"),
126
126
  protocolFilter: zod_1.z
127
- .record(zod_1.z.string(), zod_1.z.unknown())
127
+ .array(zod_1.z.enum(["TCP", "UDP"]))
128
128
  .optional()
129
- .describe("Protocol filter configuration"),
129
+ .describe("Protocols this ACL rule will be applied to (TCP, UDP). When null, applies to all protocols"),
130
130
  dryRun: zod_1.z
131
131
  .boolean()
132
132
  .optional()
@@ -110,27 +110,15 @@ function registerFirewallTools(server, client, readOnly = false) {
110
110
  siteId: zod_1.z.string().describe("Site ID"),
111
111
  sourceFirewallZoneId: zod_1.z
112
112
  .string()
113
- .optional()
114
113
  .describe("Source firewall zone ID"),
115
114
  destinationFirewallZoneId: zod_1.z
116
115
  .string()
117
- .optional()
118
116
  .describe("Destination firewall zone ID"),
119
117
  },
120
118
  annotations: safety_js_1.READ_ONLY,
121
119
  }, async ({ siteId, sourceFirewallZoneId, destinationFirewallZoneId }) => {
122
120
  try {
123
- let query = "";
124
- const params = new URLSearchParams();
125
- if (sourceFirewallZoneId !== undefined) {
126
- params.set("sourceFirewallZoneId", sourceFirewallZoneId);
127
- }
128
- if (destinationFirewallZoneId !== undefined) {
129
- params.set("destinationFirewallZoneId", destinationFirewallZoneId);
130
- }
131
- const qs = params.toString();
132
- if (qs)
133
- query = `?${qs}`;
121
+ const query = `?sourceFirewallZoneId=${encodeURIComponent(sourceFirewallZoneId)}&destinationFirewallZoneId=${encodeURIComponent(destinationFirewallZoneId)}`;
134
122
  const data = await client.get(`/sites/${siteId}/firewall/policies/ordering${query}`);
135
123
  return (0, responses_js_1.formatSuccess)(data);
136
124
  }
@@ -87,6 +87,12 @@ function registerWifiTools(server, client, readOnly = false) {
87
87
  advertiseDeviceName: zod_1.z
88
88
  .boolean()
89
89
  .describe("Advertise device name in beacon frames"),
90
+ channel2gLockedTo6: zod_1.z
91
+ .boolean()
92
+ .describe("Lock 2.4GHz channel to 6 on all broadcasting devices"),
93
+ dtimPeriod2gLockedTo3: zod_1.z
94
+ .boolean()
95
+ .describe("Lock 2.4GHz DTIM period to 3"),
90
96
  network: zod_1.z
91
97
  .record(zod_1.z.string(), zod_1.z.unknown())
92
98
  .optional()
@@ -131,13 +137,21 @@ function registerWifiTools(server, client, readOnly = false) {
131
137
  .record(zod_1.z.string(), zod_1.z.unknown())
132
138
  .optional()
133
139
  .describe("DTIM period override by frequency"),
140
+ dnsAssistanceConfiguration: zod_1.z
141
+ .record(zod_1.z.string(), zod_1.z.unknown())
142
+ .optional()
143
+ .describe("DNS assistance configuration"),
144
+ handoffSuggestionsConfiguration: zod_1.z
145
+ .record(zod_1.z.string(), zod_1.z.unknown())
146
+ .optional()
147
+ .describe("Handoff suggestions config (band5GHzRssiThreshold, band6GHzRssiThreshold). Null disables"),
134
148
  dryRun: zod_1.z
135
149
  .boolean()
136
150
  .optional()
137
151
  .describe("Preview this action without executing it"),
138
152
  },
139
153
  annotations: safety_js_1.WRITE_NOT_IDEMPOTENT,
140
- }, async ({ siteId, name, enabled, type, broadcastingFrequenciesGHz, securityConfiguration, multicastToUnicastConversionEnabled, clientIsolationEnabled, hideName, uapsdEnabled, arpProxyEnabled, bssTransitionEnabled, advertiseDeviceName, network, broadcastingDeviceFilter, mdnsProxyConfiguration, multicastFilteringPolicy, basicDataRateKbpsByFrequencyGHz, clientFilteringPolicy, blackoutScheduleConfiguration, hotspotConfiguration, mloEnabled, bandSteeringEnabled, dtimPeriodByFrequencyGHzOverride, dryRun, }) => {
154
+ }, async ({ siteId, name, enabled, type, broadcastingFrequenciesGHz, securityConfiguration, multicastToUnicastConversionEnabled, clientIsolationEnabled, hideName, uapsdEnabled, arpProxyEnabled, bssTransitionEnabled, advertiseDeviceName, channel2gLockedTo6, dtimPeriod2gLockedTo3, network, broadcastingDeviceFilter, mdnsProxyConfiguration, multicastFilteringPolicy, basicDataRateKbpsByFrequencyGHz, clientFilteringPolicy, blackoutScheduleConfiguration, hotspotConfiguration, mloEnabled, bandSteeringEnabled, dtimPeriodByFrequencyGHzOverride, dnsAssistanceConfiguration, handoffSuggestionsConfiguration, dryRun, }) => {
141
155
  try {
142
156
  const body = {
143
157
  name,
@@ -152,6 +166,8 @@ function registerWifiTools(server, client, readOnly = false) {
152
166
  arpProxyEnabled,
153
167
  bssTransitionEnabled,
154
168
  advertiseDeviceName,
169
+ channel2gLockedTo6,
170
+ dtimPeriod2gLockedTo3,
155
171
  };
156
172
  if (network !== undefined)
157
173
  body.network = network;
@@ -175,6 +191,10 @@ function registerWifiTools(server, client, readOnly = false) {
175
191
  body.bandSteeringEnabled = bandSteeringEnabled;
176
192
  if (dtimPeriodByFrequencyGHzOverride !== undefined)
177
193
  body.dtimPeriodByFrequencyGHzOverride = dtimPeriodByFrequencyGHzOverride;
194
+ if (dnsAssistanceConfiguration !== undefined)
195
+ body.dnsAssistanceConfiguration = dnsAssistanceConfiguration;
196
+ if (handoffSuggestionsConfiguration !== undefined)
197
+ body.handoffSuggestionsConfiguration = handoffSuggestionsConfiguration;
178
198
  if (dryRun)
179
199
  return (0, safety_js_1.formatDryRun)("POST", `/sites/${siteId}/wifi/broadcasts`, body);
180
200
  const data = await client.post(`/sites/${siteId}/wifi/broadcasts`, body);
@@ -228,6 +248,14 @@ function registerWifiTools(server, client, readOnly = false) {
228
248
  .boolean()
229
249
  .optional()
230
250
  .describe("Advertise device name in beacon frames"),
251
+ channel2gLockedTo6: zod_1.z
252
+ .boolean()
253
+ .optional()
254
+ .describe("Lock 2.4GHz channel to 6 on all broadcasting devices"),
255
+ dtimPeriod2gLockedTo3: zod_1.z
256
+ .boolean()
257
+ .optional()
258
+ .describe("Lock 2.4GHz DTIM period to 3"),
231
259
  network: zod_1.z
232
260
  .record(zod_1.z.string(), zod_1.z.unknown())
233
261
  .optional()
@@ -272,13 +300,21 @@ function registerWifiTools(server, client, readOnly = false) {
272
300
  .record(zod_1.z.string(), zod_1.z.unknown())
273
301
  .optional()
274
302
  .describe("DTIM period override by frequency"),
303
+ dnsAssistanceConfiguration: zod_1.z
304
+ .record(zod_1.z.string(), zod_1.z.unknown())
305
+ .optional()
306
+ .describe("DNS assistance configuration"),
307
+ handoffSuggestionsConfiguration: zod_1.z
308
+ .record(zod_1.z.string(), zod_1.z.unknown())
309
+ .optional()
310
+ .describe("Handoff suggestions config (band5GHzRssiThreshold, band6GHzRssiThreshold). Null disables"),
275
311
  dryRun: zod_1.z
276
312
  .boolean()
277
313
  .optional()
278
314
  .describe("Preview this action without executing it"),
279
315
  },
280
316
  annotations: safety_js_1.WRITE,
281
- }, async ({ siteId, wifiBroadcastId, name, enabled, type, broadcastingFrequenciesGHz, securityConfiguration, multicastToUnicastConversionEnabled, clientIsolationEnabled, hideName, uapsdEnabled, arpProxyEnabled, bssTransitionEnabled, advertiseDeviceName, network, broadcastingDeviceFilter, mdnsProxyConfiguration, multicastFilteringPolicy, basicDataRateKbpsByFrequencyGHz, clientFilteringPolicy, blackoutScheduleConfiguration, hotspotConfiguration, mloEnabled, bandSteeringEnabled, dtimPeriodByFrequencyGHzOverride, dryRun, }) => {
317
+ }, async ({ siteId, wifiBroadcastId, name, enabled, type, broadcastingFrequenciesGHz, securityConfiguration, multicastToUnicastConversionEnabled, clientIsolationEnabled, hideName, uapsdEnabled, arpProxyEnabled, bssTransitionEnabled, advertiseDeviceName, channel2gLockedTo6, dtimPeriod2gLockedTo3, network, broadcastingDeviceFilter, mdnsProxyConfiguration, multicastFilteringPolicy, basicDataRateKbpsByFrequencyGHz, clientFilteringPolicy, blackoutScheduleConfiguration, hotspotConfiguration, mloEnabled, bandSteeringEnabled, dtimPeriodByFrequencyGHzOverride, dnsAssistanceConfiguration, handoffSuggestionsConfiguration, dryRun, }) => {
282
318
  try {
283
319
  const body = {};
284
320
  if (name !== undefined)
@@ -306,6 +342,10 @@ function registerWifiTools(server, client, readOnly = false) {
306
342
  body.bssTransitionEnabled = bssTransitionEnabled;
307
343
  if (advertiseDeviceName !== undefined)
308
344
  body.advertiseDeviceName = advertiseDeviceName;
345
+ if (channel2gLockedTo6 !== undefined)
346
+ body.channel2gLockedTo6 = channel2gLockedTo6;
347
+ if (dtimPeriod2gLockedTo3 !== undefined)
348
+ body.dtimPeriod2gLockedTo3 = dtimPeriod2gLockedTo3;
309
349
  if (network !== undefined)
310
350
  body.network = network;
311
351
  if (broadcastingDeviceFilter !== undefined)
@@ -328,6 +368,10 @@ function registerWifiTools(server, client, readOnly = false) {
328
368
  body.bandSteeringEnabled = bandSteeringEnabled;
329
369
  if (dtimPeriodByFrequencyGHzOverride !== undefined)
330
370
  body.dtimPeriodByFrequencyGHzOverride = dtimPeriodByFrequencyGHzOverride;
371
+ if (dnsAssistanceConfiguration !== undefined)
372
+ body.dnsAssistanceConfiguration = dnsAssistanceConfiguration;
373
+ if (handoffSuggestionsConfiguration !== undefined)
374
+ body.handoffSuggestionsConfiguration = handoffSuggestionsConfiguration;
331
375
  if (dryRun)
332
376
  return (0, safety_js_1.formatDryRun)("PUT", `/sites/${siteId}/wifi/broadcasts/${wifiBroadcastId}`, body);
333
377
  const data = await client.put(`/sites/${siteId}/wifi/broadcasts/${wifiBroadcastId}`, body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owine/unifi-network-mcp",
3
- "version": "2.3.3",
3
+ "version": "2.5.0",
4
4
  "description": "MCP server for the UniFi Network API",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -20,8 +20,9 @@
20
20
  "lint:fix": "eslint . --fix"
21
21
  },
22
22
  "engines": {
23
- "node": "^20.19.0 || ^22.13.0 || >=24"
23
+ "node": "v26.1.0"
24
24
  },
25
+ "packageManager": "pnpm@11.1.1",
25
26
  "repository": {
26
27
  "type": "git",
27
28
  "url": "https://github.com/owine/unifi-network-mcp.git"
@@ -36,16 +37,16 @@
36
37
  "author": "owine",
37
38
  "license": "MIT",
38
39
  "dependencies": {
39
- "@modelcontextprotocol/sdk": "^1.12.1",
40
- "zod": "^4.0.0"
40
+ "@modelcontextprotocol/sdk": "1.29.0",
41
+ "zod": "4.4.3"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@eslint/js": "10.0.1",
44
- "@types/node": "24.12.2",
45
- "@vitest/coverage-v8": "4.1.5",
45
+ "@types/node": "24.12.4",
46
+ "@vitest/coverage-v8": "4.1.6",
46
47
  "eslint": "10.3.0",
47
48
  "typescript": "6.0.3",
48
- "typescript-eslint": "8.59.2",
49
- "vitest": "4.1.5"
49
+ "typescript-eslint": "8.59.3",
50
+ "vitest": "4.1.6"
50
51
  }
51
52
  }