@usex/mikrotik-mcp 6.0.0 → 6.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
  <img src="assets/logo.svg" alt="@usex/mikrotik-mcp" width="440" />
3
- <p><strong>Drive one or more MikroTik routers in plain language — 924 risk-annotated tools your AI can call, over SSH.</strong><br/>
3
+ <p><strong>Drive one or more MikroTik routers in plain language — 950 risk-annotated tools your AI can call, over SSH.</strong><br/>
4
4
  Firewall · routing · DHCP/DNS · wireless · QoS · a complete VPN suite · transactional Safe Mode · live attack detection · and an observability dashboard that watches every call.</p>
5
5
 
6
6
  <p>
@@ -236,9 +236,9 @@ mikrotik-mcp devices # site-a (default) · site-b
236
236
  #### Docker: one writable `devices.json` for all MCP settings
237
237
 
238
238
  Use the published **[alimaster/mikrotik-mcp](https://hub.docker.com/r/alimaster/mikrotik-mcp)**
239
- image (`5.22.0`, or the moving `latest` tag). Docker selects `linux/amd64` or
239
+ image (`6.0.0`, or the moving `latest` tag). Docker selects `linux/amd64` or
240
240
  `linux/arm64` automatically; no local build is needed. Compose defaults to
241
- `5.22.0`; set `MIKROTIK_IMAGE_TAG` explicitly to select a different release.
241
+ `6.0.0`; set `MIKROTIK_IMAGE_TAG` explicitly to select a different release.
242
242
 
243
243
  **Not ARM-only:** the same image runs on x86-64 and ARM64 Linux hosts (including
244
244
  Ubuntu), and on Windows/macOS through Docker Desktop's **Linux containers**.
@@ -275,13 +275,13 @@ Create a real JSON file on the host (no comments or trailing commas). For exampl
275
275
  ```
276
276
 
277
277
  ```bash
278
- docker pull alimaster/mikrotik-mcp:5.22.0
278
+ docker pull alimaster/mikrotik-mcp:6.0.0
279
279
  docker run -d --name mikrotik-mcp --restart unless-stopped \
280
280
  -p 127.0.0.1:8000:8000 -p 127.0.0.1:9090:9090 \
281
281
  --mount type=volume,src=mikrotik-state,dst=/home/bun/.mikrotik-mcp \
282
282
  --mount type=bind,src=/absolute/path/devices.json,dst=/home/bun/.mikrotik-mcp/devices.json \
283
283
  --mount type=bind,src=/absolute/path/mikrotik_ed25519,dst=/run/secrets/mikrotik_key,readonly \
284
- alimaster/mikrotik-mcp:5.22.0
284
+ alimaster/mikrotik-mcp:6.0.0
285
285
  ```
286
286
 
287
287
  Dashboard: **http://localhost:9090** · MCP: **http://localhost:8000/mcp**.
package/dist/cli.js CHANGED
@@ -21892,13 +21892,13 @@ async function undoMigration(id, confirm, selected) {
21892
21892
  throw new Error("Undo lost Safe Mode or exceeded its time budget.");
21893
21893
  await checkedRead(item.undo, createContext(undefined, device));
21894
21894
  }
21895
- const beforeTarget = (await import("./shared/cli-q0pxwaea.js")).openSnapshotStore;
21896
- const db = await beforeTarget((await import("./shared/cli-s4ppty58.js")).DEFAULT_SNAPSHOT_DB);
21895
+ const beforeTarget = (await import("./shared/cli-y746q0cw.js")).openSnapshotStore;
21896
+ const db = await beforeTarget((await import("./shared/cli-ncmy3wt1.js")).DEFAULT_SNAPSHOT_DB);
21897
21897
  try {
21898
21898
  const original = db.get(p.snapshots.target);
21899
21899
  if (!original)
21900
21900
  throw new Error("Original target snapshot unavailable.");
21901
- const { normalizeExport } = await import("./shared/cli-hp8hfqak.js");
21901
+ const { normalizeExport } = await import("./shared/cli-8h5ye8pv.js");
21902
21902
  if (normalizeExport((await migrationInventory(device)).export) !== normalizeExport(original.body))
21903
21903
  throw new Error("Target differs from its backup. Undo verification failed.");
21904
21904
  } finally {
@@ -34158,8 +34158,29 @@ function orMatch(field, values, op = "~") {
34158
34158
  return `(${terms.join(" or ")})`;
34159
34159
  }
34160
34160
  // src/utils/redact-secrets.ts
34161
- var SENSITIVE_KEYS = ["password", "shared-secret", "secret"];
34162
- var REDACT_RE = new RegExp(`(?<![\\w-])(${SENSITIVE_KEYS.join("|")})="[^"]*"`, "g");
34161
+ var SENSITIVE_KEYS = [
34162
+ "password",
34163
+ "shared-secret",
34164
+ "secret",
34165
+ "passphrase",
34166
+ "wpa-pre-shared-key",
34167
+ "wpa2-pre-shared-key",
34168
+ "private-pre-shared-key",
34169
+ "management-protection-key",
34170
+ "nv2-preshared-key",
34171
+ "mschapv2-password",
34172
+ "static-key-0",
34173
+ "static-key-1",
34174
+ "static-key-2",
34175
+ "static-key-3",
34176
+ "eap-password",
34177
+ "ft-rrb-key",
34178
+ "key0",
34179
+ "key1",
34180
+ "key2",
34181
+ "key3"
34182
+ ];
34183
+ var REDACT_RE = new RegExp(`(?<![\\w-])(${SENSITIVE_KEYS.join("|")})=(?:"(?:\\\\[\\s\\S]|[^"\\\\])*"|[^\\s"]+)`, "g");
34163
34184
  function redactSecrets(text) {
34164
34185
  return text.replace(REDACT_RE, '$1="***"');
34165
34186
  }
@@ -34637,7 +34658,7 @@ var cache3 = null;
34637
34658
  async function gateway() {
34638
34659
  if (cache3)
34639
34660
  return cache3;
34640
- const { moduleCatalog } = await import("./shared/cli-ym8ckwzg.js");
34661
+ const { moduleCatalog } = await import("./shared/cli-92qtg8n3.js");
34641
34662
  const forIndex = [];
34642
34663
  const byName = new Map;
34643
34664
  for (const mod of moduleCatalog) {
@@ -57545,7 +57566,7 @@ var riskByTool = null;
57545
57566
  async function riskIndex() {
57546
57567
  if (riskByTool)
57547
57568
  return riskByTool;
57548
- const { moduleCatalog } = await import("./shared/cli-ym8ckwzg.js");
57569
+ const { moduleCatalog } = await import("./shared/cli-92qtg8n3.js");
57549
57570
  const index = new Map;
57550
57571
  for (const mod of moduleCatalog) {
57551
57572
  for (const tool of mod.tools)
@@ -65703,10 +65724,6 @@ ${doomed}`;
65703
65724
 
65704
65725
  // src/tools/wireless.ts
65705
65726
  var V7_WIFI = ["/interface wifi", "/interface wifiwave2"];
65706
- function commandUnsupported2(result) {
65707
- const t = result.toLowerCase();
65708
- return t.includes("bad command name") || t.includes("failure:") || t.includes("no such command prefix") || t.includes("invalid command name");
65709
- }
65710
65727
  async function detectWirelessInterfaceType(ctx) {
65711
65728
  ctx.info("Detecting wireless interface type");
65712
65729
  const interfaceTypes = [
@@ -65715,15 +65732,22 @@ async function detectWirelessInterfaceType(ctx) {
65715
65732
  "/interface wireless",
65716
65733
  "/interface wlan"
65717
65734
  ];
65735
+ let supportedPath = null;
65718
65736
  for (const interfaceType of interfaceTypes) {
65719
65737
  const result = await executeMikrotikCommand(`${interfaceType} print count-only`, ctx);
65720
- if (result && !commandUnsupported2(result)) {
65738
+ if (commandUnsupported(result))
65739
+ continue;
65740
+ if (!/^\d+$/.test(result.trim())) {
65741
+ throw new Error(`Failed to detect wireless support: ${redactSecrets(result) || "empty response"}`);
65742
+ }
65743
+ supportedPath ??= interfaceType;
65744
+ if (Number(result.trim()) > 0) {
65721
65745
  ctx.info(`Detected wireless interface type: ${interfaceType}`);
65722
65746
  return interfaceType;
65723
65747
  }
65724
65748
  }
65725
65749
  ctx.info("No wireless interface type detected");
65726
- return null;
65750
+ return supportedPath;
65727
65751
  }
65728
65752
  var wirelessTools = [
65729
65753
  defineTool({
@@ -65807,7 +65831,7 @@ ${details}`;
65807
65831
  name: "list_wireless_interfaces",
65808
65832
  title: "List Wireless Interfaces",
65809
65833
  annotations: READ,
65810
- description: "Lists all wireless interfaces (`/interface wifi`, `/interface wifiwave2`, `/interface wireless`, `/interface wlan`) \u2014 probes every supported command path and aggregates results. " + "Filters by name_filter (substring match), disabled_only, or running_only. " + "For full property detail on a single interface use get_wireless_interface; to see currently connected clients use get_wireless_registration_table. " + "Falls back to `/interface print` with debugging info when no wireless interfaces match, to help identify the correct path on the device.",
65834
+ description: "Lists all wireless interfaces (`/interface wifi`, `/interface wifiwave2`, `/interface wireless`, `/interface wlan`) \u2014 probes every supported command path and aggregates results. " + "Returns detail including SSID, security/authentication types and configured channel settings, with secrets redacted. " + "Filters by name_filter (RouterOS regular expression), disabled_only, or running_only. " + "Configured frequencies are NOT proof of the current operating channel; use get_wireless_interface_status. " + "For full property detail on a single interface use get_wireless_interface; to see currently connected clients use get_wireless_registration_table. " + "Falls back to `/interface print` with debugging info when no wireless interfaces match, to help identify the correct path on the device.",
65811
65835
  inputSchema: {
65812
65836
  name_filter: string2().optional(),
65813
65837
  disabled_only: boolean2().default(false),
@@ -65826,19 +65850,23 @@ ${details}`;
65826
65850
  for (const interfaceType of interfaceTypesToTry) {
65827
65851
  const filters = [];
65828
65852
  if (a.name_filter)
65829
- filters.push(`name~"${a.name_filter}"`);
65853
+ filters.push(`name~${quoteValue(a.name_filter)}`);
65830
65854
  if (a.disabled_only)
65831
65855
  filters.push("disabled=yes");
65832
65856
  if (a.running_only)
65833
65857
  filters.push("running=yes");
65834
- let cmd = `${interfaceType} print`;
65858
+ const cmd = new Cmd(`${interfaceType} print detail`);
65835
65859
  if (filters.length)
65836
- cmd += ` where ${filters.join(" and ")}`;
65837
- const result = await executeMikrotikCommand(cmd, ctx);
65838
- if (result && result.trim() !== "" && !commandUnsupported2(result)) {
65860
+ cmd.raw(`where ${filters.join(" and ")}`);
65861
+ const result = await executeMikrotikCommand(cmd.build(), ctx);
65862
+ if (commandUnsupported(result))
65863
+ continue;
65864
+ if (looksLikeError(result))
65865
+ return `Failed to list wireless interfaces: ${redactSecrets(result)}`;
65866
+ if (!isEmpty(result)) {
65839
65867
  workingTypes.push(interfaceType);
65840
65868
  allResults.push(`=== ${interfaceType.toUpperCase()} ===
65841
- ${result}`);
65869
+ ${redactSecrets(result)}`);
65842
65870
  }
65843
65871
  }
65844
65872
  if (allResults.length) {
@@ -65864,19 +65892,54 @@ NOTE: If you see wireless interfaces above, they might be using a different comm
65864
65892
  name: "get_wireless_interface",
65865
65893
  title: "Get Wireless Interface Details",
65866
65894
  annotations: READ,
65867
- description: "Retrieves the full detail of one named wireless interface (`<auto-detected path> print detail where name=...`), " + "probing `/interface wifi`, `/interface wifiwave2`, `/interface wireless`, and `/interface wlan` in order. " + "Use when you need all properties of a single interface; for a summary of all interfaces use list_wireless_interfaces. " + "Returns the complete property set for the named interface, or an error if not found.",
65868
- inputSchema: { name: string2() },
65895
+ description: "Retrieves the full detail of one named wireless interface (`<auto-detected path> print detail where name=...`), " + "probing `/interface wifi`, `/interface wifiwave2`, `/interface wireless`, and `/interface wlan` in order. " + "Use to inspect SSID, security.authentication-types (allowed WPA2/WPA3 methods), profile references, country and channel settings. " + "On modern Wi-Fi since RouterOS 7.15 print detail includes inherited values; on older releases also read actual-configuration. " + "Allowed authentication types do not prove which method a client negotiated; missing values do not prove an open network. " + "For the ACTUAL operating channel use get_wireless_interface_status, not the configured frequency list. Secrets are redacted.",
65896
+ inputSchema: { name: string2().trim().min(1) },
65869
65897
  async handler(a, ctx) {
65870
65898
  ctx.info(`Getting wireless interface details: name=${a.name}`);
65871
65899
  const interfaceType = await detectWirelessInterfaceType(ctx);
65872
65900
  if (!interfaceType)
65873
65901
  return "Error: No wireless interface support detected on this device.";
65874
- const result = await executeMikrotikCommand(`${interfaceType} print detail where name="${a.name}"`, ctx);
65902
+ const result = await executeMikrotikCommand(new Cmd(`${interfaceType} print detail`).raw("where").set("name", a.name).build(), ctx);
65903
+ if (looksLikeError(result))
65904
+ return `Failed to read wireless interface: ${redactSecrets(result)}`;
65875
65905
  if (isEmpty(result))
65876
65906
  return `Wireless interface '${a.name}' not found.`;
65907
+ let details = redactSecrets(result);
65908
+ if (V7_WIFI.includes(interfaceType)) {
65909
+ const inherited = await executeMikrotikCommand(new Cmd(`${interfaceType} actual-configuration print detail`).raw("where").set("name", a.name).build(), ctx);
65910
+ if (!commandUnsupported(inherited)) {
65911
+ if (looksLikeError(inherited))
65912
+ return `Failed to read effective Wi-Fi configuration: ${redactSecrets(inherited)}`;
65913
+ if (!isEmpty(inherited))
65914
+ details += `
65915
+
65916
+ ACTUAL CONFIGURATION (older RouterOS):
65917
+ ${redactSecrets(inherited)}`;
65918
+ }
65919
+ }
65877
65920
  return `WIRELESS INTERFACE DETAILS:
65878
65921
 
65879
- ${result}`;
65922
+ ${details}
65923
+
65924
+ Configured frequencies are allowed choices, not the actual operating channel. Use get_wireless_interface_status for runtime evidence.`;
65925
+ }
65926
+ }),
65927
+ defineTool({
65928
+ name: "get_wireless_interface_status",
65929
+ title: "Get Actual Wi-Fi Channel and Runtime Status",
65930
+ annotations: READ,
65931
+ description: "Reads one non-disruptive runtime snapshot (`<auto-detected Wi-Fi path> monitor <interface> once`). " + "Supports modern /interface wifi, older wifiwave2 and legacy wireless. Returns actual channel/frequency/width, " + "state and radio statistics when reported by the driver; disabled/inactive radios may not have a current channel. " + "Does NOT scan, disconnect clients or change settings. Pair with get_wireless_interface and get_wireless_security_profile " + "for SSID and configured WPA2/WPA3 security; never invent unavailable runtime fields.",
65932
+ inputSchema: { interface: string2().trim().min(1) },
65933
+ async handler(a, ctx) {
65934
+ const path = await detectWirelessInterfaceType(ctx);
65935
+ if (!path)
65936
+ return "Error: No wireless interface support detected on this device.";
65937
+ const result = await executeMikrotikCommand(new Cmd(`${path} monitor`).raw(quoteValue(a.interface)).raw("once").build(), ctx);
65938
+ if (looksLikeError(result) || isEmpty(result))
65939
+ return `Failed to read Wi-Fi runtime status: ${redactSecrets(result) || "empty response"}`;
65940
+ return `WI-FI RUNTIME STATUS (${path}):
65941
+
65942
+ ${redactSecrets(result)}`;
65880
65943
  }
65881
65944
  }),
65882
65945
  defineTool({
@@ -65936,23 +65999,50 @@ ${result}`;
65936
65999
  defineTool({
65937
66000
  name: "scan_wireless_networks",
65938
66001
  title: "Scan for Nearby Wireless Networks",
65939
- annotations: READ,
65940
- description: "Scans for visible nearby wireless networks/SSIDs/APs in range (`<auto-detected path> scan <interface> duration=<n>`). " + "Use to discover external networks \u2014 not to list connected clients. " + "For currently associated client stations use get_wireless_registration_table instead. " + "`interface` is the local wireless interface name to scan from (e.g. `wlan1`); `duration` is scan time in seconds (default 5). " + "Returns raw scan output from the device.",
66002
+ annotations: WRITE,
66003
+ description: "Scans for visible nearby wireless networks/SSIDs/APs in range (`<auto-detected path> scan <interface> duration=<n>`). " + "DISRUPTIVE: scanning can temporarily disconnect clients. Requires explicit user approval (confirm=true). " + "Use to discover external networks \u2014 not to list connected clients or read the actual channel without disruption. " + "For non-disruptive current-channel evidence use get_wireless_interface_status; for modern RF channel load use scan_wifi_channels. " + "For currently associated client stations use get_wireless_registration_table instead. " + "`interface` is the local wireless interface name to scan from (e.g. `wlan1`); `duration` is scan time in seconds (default 5). " + "Returns raw scan output from the device.",
65941
66004
  inputSchema: {
65942
- interface: string2(),
65943
- duration: number2().int().default(5)
66005
+ interface: string2().trim().min(1),
66006
+ duration: number2().int().min(1).max(30).default(5),
66007
+ confirm: boolean2().default(false).describe("Explicit user approval for a scan that can disconnect Wi-Fi clients.")
65944
66008
  },
65945
66009
  async handler(a, ctx) {
66010
+ if (!a.confirm)
66011
+ return "Error: Wireless scan can disconnect clients. Obtain explicit user approval and set confirm=true; use get_wireless_interface_status for a non-disruptive read.";
65946
66012
  ctx.info(`Scanning wireless networks on interface: ${a.interface}`);
65947
66013
  const interfaceType = await detectWirelessInterfaceType(ctx);
65948
66014
  if (!interfaceType)
65949
66015
  return "Error: No wireless interface support detected on this device.";
65950
- const scanCmd = new Cmd(`${interfaceType} scan`).raw(quoteValue(a.interface)).set("duration", a.duration).build();
66016
+ const scanCmd = new Cmd(`${interfaceType} scan`).raw(quoteValue(a.interface)).set("duration", `${a.duration}s`).build();
65951
66017
  const result = await executeMikrotikCommand(scanCmd, ctx);
65952
66018
  if (looksLikeError(result))
65953
66019
  return `Failed to scan wireless networks: ${result}`;
65954
66020
  return `WIRELESS NETWORK SCAN RESULTS:
65955
66021
 
66022
+ ${result}`;
66023
+ }
66024
+ }),
66025
+ defineTool({
66026
+ name: "scan_wifi_channels",
66027
+ title: "Survey Modern Wi-Fi Channel Load (Disruptive)",
66028
+ annotations: WRITE,
66029
+ description: "Runs a bounded /interface wifi (or wifiwave2) frequency-scan to measure channel load, networks, noise floor and signal levels. " + "Modern Wi-Fi equivalent of a legacy frequency survey, NOT /interface wireless frequency-monitor. " + "DISCONNECTS associated clients/station during the scan; obtain explicit user approval and set confirm=true. " + "Never use during a strictly read-only/non-disruptive audit; get_wireless_interface_status reads the current channel safely. " + "Does not auto-tune or modify configuration; frequency-scan availability depends on RouterOS/driver.",
66030
+ inputSchema: {
66031
+ interface: string2().trim().min(1),
66032
+ duration: number2().int().min(1).max(30).default(5),
66033
+ confirm: boolean2().default(false).describe("Explicit user approval to temporarily disconnect Wi-Fi clients.")
66034
+ },
66035
+ async handler(a, ctx) {
66036
+ if (!a.confirm)
66037
+ return "Error: Frequency scan disconnects clients. Obtain explicit user approval and set confirm=true.";
66038
+ const path = await detectWirelessInterfaceType(ctx);
66039
+ if (!path || !V7_WIFI.includes(path))
66040
+ return "Error: Modern Wi-Fi frequency-scan is unavailable; this tool requires /interface wifi or /interface wifiwave2.";
66041
+ const result = await executeMikrotikCommand(new Cmd(`${path} frequency-scan`).raw(quoteValue(a.interface)).set("duration", `${a.duration}s`).build(), ctx);
66042
+ if (looksLikeError(result) || isEmpty(result))
66043
+ return `Failed to survey Wi-Fi channels: ${result || "empty response"}`;
66044
+ return `WI-FI CHANNEL SURVEY (${path}):
66045
+
65956
66046
  ${result}`;
65957
66047
  }
65958
66048
  }),
@@ -65969,15 +66059,17 @@ ${result}`;
65969
66059
  const interfaceType = await detectWirelessInterfaceType(ctx);
65970
66060
  if (!interfaceType)
65971
66061
  return "Error: No wireless interface support detected on this device.";
65972
- let cmd = `${interfaceType} registration-table print`;
66062
+ const cmd = new Cmd(`${interfaceType} registration-table print detail`);
65973
66063
  if (a.interface)
65974
- cmd += ` where interface="${a.interface}"`;
65975
- const result = await executeMikrotikCommand(cmd, ctx);
66064
+ cmd.raw("where").set("interface", a.interface);
66065
+ const result = await executeMikrotikCommand(cmd.build(), ctx);
66066
+ if (looksLikeError(result))
66067
+ return `Failed to read wireless clients: ${redactSecrets(result)}`;
65976
66068
  if (isEmpty(result))
65977
66069
  return "No wireless clients registered.";
65978
66070
  return `WIRELESS REGISTRATION TABLE:
65979
66071
 
65980
- ${result}`;
66072
+ ${redactSecrets(result)}`;
65981
66073
  }
65982
66074
  }),
65983
66075
  defineTool({
@@ -66005,9 +66097,9 @@ ${interfaceResult}
66005
66097
  Detected Wireless Interface Type: ${wirelessType || "None detected"}
66006
66098
 
66007
66099
  Compatibility Notes:
66008
- - RouterOS v7.x uses '/interface wifi' (newest system)
66009
- - RouterOS v7.x also supports '/interface wifiwave2' (alternative)
66010
- - RouterOS v6.x uses '/interface wireless' (legacy system)
66100
+ - RouterOS v7.13+ modern drivers use '/interface wifi'
66101
+ - Earlier modern drivers use '/interface wifiwave2'
66102
+ - Legacy drivers use '/interface wireless' on RouterOS v6 OR v7
66011
66103
  - Older versions may use '/interface wlan'
66012
66104
 
66013
66105
  USAGE EXAMPLES:
@@ -66021,74 +66113,76 @@ For legacy systems:
66021
66113
  }),
66022
66114
  defineTool({
66023
66115
  name: "create_wireless_security_profile",
66024
- title: "Create Wireless Security Profile (Legacy v6 Only \u2014 Not Implemented)",
66116
+ title: "Create Wireless Security Profile (Not Implemented)",
66025
66117
  annotations: WRITE,
66026
- description: "Stub for creating a `/interface wireless security-profiles` entry \u2014 a RouterOS v6 concept that does not exist in v7. " + "On RouterOS v7 devices (`/interface wifi` or `/interface wifiwave2`) always returns a not-supported message; security is configured directly on the interface. " + "On v6 this is also not implemented and returns an error. " + "For v6 interface creation with a security profile use create_wireless_interface (security_profile arg); for v7, security is configured directly on the interface but is not exposed by this server's wireless tools.",
66118
+ description: "Not implemented: creating modern wifi/wifiwave2 security or legacy wireless security-profiles presets. " + "For read-only security inspection use list_wireless_security_profiles, get_wireless_security_profile and get_wireless_interface.",
66027
66119
  inputSchema: { name: string2() },
66028
- async handler(_a, ctx) {
66029
- const interfaceType = await detectWirelessInterfaceType(ctx);
66030
- if (interfaceType && V7_WIFI.includes(interfaceType)) {
66031
- return "Security profiles are not used in RouterOS v7.x. Configure security directly on the wireless interface.";
66032
- }
66033
- return "Legacy security profile creation not implemented in this version.";
66120
+ async handler() {
66121
+ return "Error: Security profile creation is not implemented. Use list_wireless_security_profiles or get_wireless_security_profile for read-only inspection.";
66034
66122
  }
66035
66123
  }),
66036
66124
  defineTool({
66037
66125
  name: "list_wireless_security_profiles",
66038
- title: "List Wireless Security Profiles (Legacy v6 Only \u2014 Not Implemented)",
66126
+ title: "List Wi-Fi Security Profiles (Modern and Legacy)",
66039
66127
  annotations: READ,
66040
- description: "Stub for listing `/interface wireless security-profiles` entries \u2014 a RouterOS v6 concept that does not exist in v7. " + "On RouterOS v7 devices always returns a not-supported message; on v6 also not implemented. " + "To inspect current wireless interface configuration (including security) use list_wireless_interfaces or get_wireless_interface instead.",
66128
+ description: "Reads modern /interface wifi security (or wifiwave2 security) and legacy /interface wireless security-profiles, auto-detected. " + "Returns authentication-types (allowed WPA2/WPA3 methods), ciphers, management protection, WPS and EAP settings where available. " + "Passwords, passphrases and pre-shared keys are redacted. Profiles are presets, not proof of effective interface settings; " + "pair with get_wireless_interface to see assigned profiles and overrides. Does not modify the router.",
66041
66129
  async handler(_a, ctx) {
66042
66130
  const interfaceType = await detectWirelessInterfaceType(ctx);
66043
- if (interfaceType && V7_WIFI.includes(interfaceType)) {
66044
- return "Security profiles are not used in RouterOS v7.x. Security is configured directly on wireless interfaces.";
66045
- }
66046
- return "Legacy security profile listing not implemented in this version.";
66131
+ if (!interfaceType)
66132
+ return "Error: No wireless interface support detected on this device.";
66133
+ const menu = V7_WIFI.includes(interfaceType) ? "security" : "security-profiles";
66134
+ const result = await executeMikrotikCommand(new Cmd(`${interfaceType} ${menu} print detail`).build(), ctx);
66135
+ if (looksLikeError(result))
66136
+ return `Failed to list Wi-Fi security profiles: ${redactSecrets(result)}`;
66137
+ if (isEmpty(result))
66138
+ return "No Wi-Fi security profiles configured. Security may be set directly on an interface.";
66139
+ return `WI-FI SECURITY PROFILES (${interfaceType}):
66140
+
66141
+ ${redactSecrets(result)}`;
66047
66142
  }
66048
66143
  }),
66049
66144
  defineTool({
66050
66145
  name: "get_wireless_security_profile",
66051
- title: "Get Wireless Security Profile (Legacy v6 Only \u2014 Not Implemented)",
66146
+ title: "Get Wi-Fi Security Profile (Modern and Legacy)",
66052
66147
  annotations: READ,
66053
- description: "Stub for retrieving a named `/interface wireless security-profiles` entry \u2014 a RouterOS v6 concept that does not exist in v7. " + "On RouterOS v7 devices always returns a not-supported message; on v6 also not implemented. " + "Use get_wireless_interface to inspect the security settings on a v7 wireless interface instead.",
66054
- inputSchema: { name: string2() },
66055
- async handler(_a, ctx) {
66148
+ description: "Reads one named modern wifi/wifiwave2 security profile or legacy wireless security-profiles entry. " + "Shows configured WPA2/WPA3 authentication methods, encryption, WPS and management protection where available; secrets are redacted. " + "Use the profile name returned by list_wireless_security_profiles or get_wireless_interface. " + "An interface override takes precedence over a profile; missing authentication fields do not prove an open network.",
66149
+ inputSchema: { name: string2().trim().min(1) },
66150
+ async handler(a, ctx) {
66056
66151
  const interfaceType = await detectWirelessInterfaceType(ctx);
66057
- if (interfaceType && V7_WIFI.includes(interfaceType)) {
66058
- return "Security profiles are not used in RouterOS v7.x. Check security configuration on wireless interfaces directly.";
66059
- }
66060
- return "Legacy security profile details not implemented in this version.";
66152
+ if (!interfaceType)
66153
+ return "Error: No wireless interface support detected on this device.";
66154
+ const menu = V7_WIFI.includes(interfaceType) ? "security" : "security-profiles";
66155
+ const result = await executeMikrotikCommand(new Cmd(`${interfaceType} ${menu} print detail`).raw("where").set("name", a.name).build(), ctx);
66156
+ if (looksLikeError(result))
66157
+ return `Failed to read Wi-Fi security profile: ${redactSecrets(result)}`;
66158
+ if (isEmpty(result))
66159
+ return `Wi-Fi security profile '${a.name}' not found.`;
66160
+ return `WI-FI SECURITY PROFILE (${interfaceType}):
66161
+
66162
+ ${redactSecrets(result)}`;
66061
66163
  }
66062
66164
  }),
66063
66165
  defineTool({
66064
66166
  name: "remove_wireless_security_profile",
66065
- title: "Remove Wireless Security Profile (Legacy v6 Only \u2014 Not Implemented)",
66167
+ title: "Remove Wireless Security Profile (Not Implemented)",
66066
66168
  annotations: DESTRUCTIVE,
66067
- description: "Stub for deleting a named `/interface wireless security-profiles` entry \u2014 a RouterOS v6 concept that does not exist in v7. " + "On RouterOS v7 devices always returns a not-supported message; on v6 also not implemented. " + "To delete a wireless interface entirely use remove_wireless_interface; to change security settings use update_wireless_interface.",
66169
+ description: "Not implemented: deleting modern wifi/wifiwave2 security or legacy wireless security-profiles presets. " + "Use list_wireless_security_profiles or get_wireless_security_profile for read-only inspection.",
66068
66170
  inputSchema: { name: string2() },
66069
- async handler(_a, ctx) {
66070
- const interfaceType = await detectWirelessInterfaceType(ctx);
66071
- if (interfaceType && V7_WIFI.includes(interfaceType)) {
66072
- return "Security profiles are not used in RouterOS v7.x. Security is configured directly on wireless interfaces.";
66073
- }
66074
- return "Legacy security profile removal not implemented in this version.";
66171
+ async handler() {
66172
+ return "Error: Security profile removal is not implemented. Use get_wireless_security_profile for read-only inspection.";
66075
66173
  }
66076
66174
  }),
66077
66175
  defineTool({
66078
66176
  name: "set_wireless_security_profile",
66079
- title: "Assign Security Profile to Wireless Interface (Legacy v6 Only \u2014 Not Implemented)",
66177
+ title: "Assign Security Profile to Wireless Interface (Not Implemented)",
66080
66178
  annotations: WRITE,
66081
- description: "Stub for assigning a named security profile to a v6 `/interface wireless` interface \u2014 a RouterOS v6 concept that does not exist in v7. " + "On RouterOS v7 devices always returns a not-supported message because security is set directly on the interface. " + "On v6 also not implemented. " + "To update a wireless interface's settings on supported versions use update_wireless_interface.",
66179
+ description: "Not implemented: assigning a modern wifi/wifiwave2 security profile. " + "For legacy wireless only, update_wireless_interface supports security_profile. " + "Use get_wireless_interface and get_wireless_security_profile to inspect settings without changes.",
66082
66180
  inputSchema: {
66083
66181
  interface_name: string2(),
66084
66182
  security_profile: string2()
66085
66183
  },
66086
- async handler(_a, ctx) {
66087
- const interfaceType = await detectWirelessInterfaceType(ctx);
66088
- if (interfaceType && V7_WIFI.includes(interfaceType)) {
66089
- return "Security profiles are not used in RouterOS v7.x. Configure security directly on the wireless interface.";
66090
- }
66091
- return "Legacy security profile setting not implemented in this version.";
66184
+ async handler() {
66185
+ return "Error: Security profile assignment is not implemented here. Legacy wireless supports update_wireless_interface(security_profile=...); modern security is read-only in these tools.";
66092
66186
  }
66093
66187
  }),
66094
66188
  defineTool({
@@ -66203,7 +66297,7 @@ ${details}`;
66203
66297
  const filter = a.search ? ` where name~${quoteValue(a.search)}` : "";
66204
66298
  for (const path of countryPaths) {
66205
66299
  const result = await executeMikrotikCommand(`${path} country print${filter}`, ctx);
66206
- if (result && !commandUnsupported2(result) && !looksLikeError(result)) {
66300
+ if (result && !commandUnsupported(result) && !looksLikeError(result)) {
66207
66301
  if (isEmpty(result))
66208
66302
  continue;
66209
66303
  return `WI-FI REGULATORY COUNTRIES:
@@ -66235,7 +66329,7 @@ var wifiOptimizerTools = [
66235
66329
  name: "tune_wifi_channel",
66236
66330
  title: "Survey & Tune Wi-Fi Channel",
66237
66331
  annotations: WRITE,
66238
- description: "Runs an RF survey on a wireless radio (`/interface wireless frequency-monitor`, blocking for " + "`duration`), finds the least-congested channel, and reports a before/after. DEFAULTS TO A DRY " + "RUN (`apply=false`) \u2014 it surveys and recommends; set `apply=true` to set the radio to the best " + "frequency (`/interface wireless set`). Targets the LEGACY wireless stack; for wifiwave2 " + "(`/interface wifi`) tune via those tools. Returns the per-channel usage finding and the chosen " + "frequency.",
66332
+ description: "Runs an RF survey on a wireless radio (`/interface wireless frequency-monitor`, blocking for " + "`duration`), finds the least-congested channel, and reports a before/after. DEFAULTS TO A DRY " + "RUN (`apply=false`) \u2014 it surveys and recommends; set `apply=true` to set the radio to the best " + "frequency (`/interface wireless set`). Targets ONLY the LEGACY wireless stack, including legacy drivers on v7; " + "for modern wifi/wifiwave2 use get_wireless_interface_status for a non-disruptive current-channel read or " + "scan_wifi_channels for an explicitly approved, disruptive channel-load survey (no auto-tuning). Returns the per-channel usage finding and the chosen " + "frequency.",
66239
66333
  inputSchema: {
66240
66334
  interface: string2().describe("Wireless interface, e.g. 'wlan1'"),
66241
66335
  duration: string2().default("5").describe("Survey duration in seconds"),
@@ -67635,7 +67729,7 @@ var moduleCatalog2 = [
67635
67729
  label: "Wireless",
67636
67730
  slug: "wireless",
67637
67731
  group: "Interfaces",
67638
- description: "Wireless interfaces, security profiles and access lists (legacy + wifiwave2).",
67732
+ description: "Wi-Fi SSID/security profiles, non-disruptive runtime channel monitoring and approved RF surveys (wifi, wifiwave2 and legacy wireless). Legacy access-list tools are stubs.",
67639
67733
  tools: wirelessTools
67640
67734
  },
67641
67735
  {
package/dist/index.js CHANGED
@@ -70,7 +70,7 @@ import {
70
70
  updateSummaryLine,
71
71
  allToolModules2,
72
72
  selectToolModules2
73
- } from "./shared/library-fyaw9mjm.js";
73
+ } from "./shared/library-qt6rx1ht.js";
74
74
 
75
75
  // node_modules/ajv/dist/compile/codegen/code.js
76
76
  var require_code = __commonJS(function(exports) {
@@ -4,7 +4,7 @@ import {
4
4
  normalizeExport2,
5
5
  contentSha2,
6
6
  countLines2
7
- } from "./library-fyaw9mjm.js";
7
+ } from "./library-qt6rx1ht.js";
8
8
  export {
9
9
  contentSha2 as contentSha,
10
10
  countLines2 as countLines,
@@ -11,7 +11,7 @@ import {
11
11
  MikrotikConfigSchema2,
12
12
  getConfigSource2,
13
13
  loadConfig2
14
- } from "./library-fyaw9mjm.js";
14
+ } from "./library-qt6rx1ht.js";
15
15
  export {
16
16
  DEFAULT_BACKUP_DIR2 as DEFAULT_BACKUP_DIR,
17
17
  DEFAULT_DASHBOARD_DB2 as DEFAULT_DASHBOARD_DB,
@@ -3,7 +3,7 @@ import {
3
3
  moduleCatalog2,
4
4
  allToolModules2,
5
5
  selectToolModules2
6
- } from "./library-fyaw9mjm.js";
6
+ } from "./library-qt6rx1ht.js";
7
7
  export {
8
8
  allToolModules2 as allToolModules,
9
9
  moduleCatalog2 as moduleCatalog,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  openSnapshotStore2
4
- } from "./library-fyaw9mjm.js";
4
+ } from "./library-qt6rx1ht.js";
5
5
  export {
6
6
  openSnapshotStore2 as openSnapshotStore
7
7
  };