@owine/unifi-network-mcp 2.0.1 → 2.0.2
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 +107 -79
- package/dist/tools/clients.js +75 -59
- package/dist/tools/devices.js +95 -63
- package/dist/tools/dns-policies.js +77 -57
- package/dist/tools/firewall.js +200 -148
- package/dist/tools/hotspot.js +123 -103
- package/dist/tools/networks.js +106 -82
- package/dist/tools/sites.js +23 -19
- package/dist/tools/supporting.js +185 -153
- package/dist/tools/system.js +5 -1
- package/dist/tools/traffic-matching.js +83 -63
- package/dist/tools/wifi.js +84 -64
- package/package.json +4 -4
package/dist/tools/wifi.js
CHANGED
|
@@ -6,26 +6,30 @@ const responses_js_1 = require("../utils/responses.js");
|
|
|
6
6
|
const query_js_1 = require("../utils/query.js");
|
|
7
7
|
const safety_js_1 = require("../utils/safety.js");
|
|
8
8
|
function registerWifiTools(server, client, readOnly = false) {
|
|
9
|
-
server.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
server.registerTool("unifi_list_wifi", {
|
|
10
|
+
description: "List all WiFi broadcasts (SSIDs) at a site",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
13
|
+
offset: zod_1.z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.nonnegative()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Number of records to skip (default: 0)"),
|
|
19
|
+
limit: zod_1.z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(200)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
26
|
+
filter: zod_1.z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Filter expression"),
|
|
30
|
+
},
|
|
31
|
+
annotations: safety_js_1.READ_ONLY,
|
|
32
|
+
}, async ({ siteId, offset, limit, filter }) => {
|
|
29
33
|
try {
|
|
30
34
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
31
35
|
const data = await client.get(`/sites/${siteId}/wifi/broadcasts${query}`);
|
|
@@ -35,10 +39,14 @@ function registerWifiTools(server, client, readOnly = false) {
|
|
|
35
39
|
return (0, responses_js_1.formatError)(err);
|
|
36
40
|
}
|
|
37
41
|
});
|
|
38
|
-
server.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
server.registerTool("unifi_get_wifi", {
|
|
43
|
+
description: "Get a specific WiFi network by ID",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
46
|
+
wifiBroadcastId: zod_1.z.string().describe("WiFi Broadcast ID"),
|
|
47
|
+
},
|
|
48
|
+
annotations: safety_js_1.READ_ONLY,
|
|
49
|
+
}, async ({ siteId, wifiBroadcastId }) => {
|
|
42
50
|
try {
|
|
43
51
|
const data = await client.get(`/sites/${siteId}/wifi/broadcasts/${wifiBroadcastId}`);
|
|
44
52
|
return (0, responses_js_1.formatSuccess)(data);
|
|
@@ -49,19 +57,23 @@ function registerWifiTools(server, client, readOnly = false) {
|
|
|
49
57
|
});
|
|
50
58
|
if (readOnly)
|
|
51
59
|
return;
|
|
52
|
-
server.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
server.registerTool("unifi_create_wifi", {
|
|
61
|
+
description: "Create a new WiFi network (SSID)",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
64
|
+
name: zod_1.z.string().describe("SSID name"),
|
|
65
|
+
enabled: zod_1.z.boolean().describe("Enable the WiFi network"),
|
|
66
|
+
type: zod_1.z.enum(["STANDARD"]).describe("WiFi type"),
|
|
67
|
+
broadcastingFrequenciesGHz: zod_1.z
|
|
68
|
+
.array(zod_1.z.string())
|
|
69
|
+
.describe("Frequencies: 2.4, 5, 6"),
|
|
70
|
+
dryRun: zod_1.z
|
|
71
|
+
.boolean()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Preview this action without executing it"),
|
|
74
|
+
},
|
|
75
|
+
annotations: safety_js_1.WRITE_NOT_IDEMPOTENT,
|
|
76
|
+
}, async ({ siteId, name, enabled, type, broadcastingFrequenciesGHz, dryRun, }) => {
|
|
65
77
|
try {
|
|
66
78
|
const body = {
|
|
67
79
|
name,
|
|
@@ -78,16 +90,20 @@ function registerWifiTools(server, client, readOnly = false) {
|
|
|
78
90
|
return (0, responses_js_1.formatError)(err);
|
|
79
91
|
}
|
|
80
92
|
});
|
|
81
|
-
server.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.boolean()
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
server.registerTool("unifi_update_wifi", {
|
|
94
|
+
description: "Update an existing WiFi network",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
97
|
+
wifiBroadcastId: zod_1.z.string().describe("WiFi Broadcast ID"),
|
|
98
|
+
name: zod_1.z.string().optional().describe("SSID name"),
|
|
99
|
+
enabled: zod_1.z.boolean().optional().describe("Enable the WiFi network"),
|
|
100
|
+
dryRun: zod_1.z
|
|
101
|
+
.boolean()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe("Preview this action without executing it"),
|
|
104
|
+
},
|
|
105
|
+
annotations: safety_js_1.WRITE,
|
|
106
|
+
}, async ({ siteId, wifiBroadcastId, name, enabled, dryRun }) => {
|
|
91
107
|
try {
|
|
92
108
|
const body = {};
|
|
93
109
|
if (name !== undefined)
|
|
@@ -103,23 +119,27 @@ function registerWifiTools(server, client, readOnly = false) {
|
|
|
103
119
|
return (0, responses_js_1.formatError)(err);
|
|
104
120
|
}
|
|
105
121
|
});
|
|
106
|
-
server.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.
|
|
111
|
-
.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
.
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
server.registerTool("unifi_delete_wifi", {
|
|
123
|
+
description: "DESTRUCTIVE: Delete a WiFi network — all clients on this SSID will be disconnected",
|
|
124
|
+
inputSchema: {
|
|
125
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
126
|
+
wifiBroadcastId: zod_1.z.string().describe("WiFi Broadcast ID"),
|
|
127
|
+
force: zod_1.z
|
|
128
|
+
.boolean()
|
|
129
|
+
.optional()
|
|
130
|
+
.default(false)
|
|
131
|
+
.describe("Force delete (default: false)"),
|
|
132
|
+
confirm: zod_1.z
|
|
133
|
+
.boolean()
|
|
134
|
+
.optional()
|
|
135
|
+
.describe("Must be true to execute this destructive action"),
|
|
136
|
+
dryRun: zod_1.z
|
|
137
|
+
.boolean()
|
|
138
|
+
.optional()
|
|
139
|
+
.describe("Preview this action without executing it"),
|
|
140
|
+
},
|
|
141
|
+
annotations: safety_js_1.DESTRUCTIVE,
|
|
142
|
+
}, async ({ siteId, wifiBroadcastId, force, confirm, dryRun }) => {
|
|
123
143
|
const guard = (0, safety_js_1.requireConfirmation)(confirm, "This will delete the WiFi network and disconnect all clients on this SSID");
|
|
124
144
|
if (guard)
|
|
125
145
|
return guard;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owine/unifi-network-mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "MCP server for the UniFi Network API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@eslint/js": "10.0.1",
|
|
44
|
-
"@types/node": "24.
|
|
44
|
+
"@types/node": "24.12.0",
|
|
45
45
|
"@vitest/coverage-v8": "4.0.18",
|
|
46
|
-
"eslint": "10.0.
|
|
46
|
+
"eslint": "10.0.3",
|
|
47
47
|
"typescript": "5.9.3",
|
|
48
|
-
"typescript-eslint": "8.56.
|
|
48
|
+
"typescript-eslint": "8.56.1",
|
|
49
49
|
"vitest": "4.0.18"
|
|
50
50
|
}
|
|
51
51
|
}
|