@usex/mikrotik-mcp 3.47.0 → 3.48.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/cli.js CHANGED
@@ -89,7 +89,7 @@ import {
89
89
  toggleAaaEntity,
90
90
  updateAaaEntity,
91
91
  writeBackup
92
- } from "./shared/cli-b6nehpgn.js";
92
+ } from "./shared/cli-rcs47w19.js";
93
93
 
94
94
  // src/cli.ts
95
95
  import { existsSync as existsSync2 } from "fs";
@@ -1143,7 +1143,7 @@ function computeStats(events, opts) {
1143
1143
  // package.json
1144
1144
  var package_default = {
1145
1145
  name: "@usex/mikrotik-mcp",
1146
- version: "3.47.0",
1146
+ version: "3.48.0",
1147
1147
  description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
1148
1148
  keywords: [
1149
1149
  "ai",
@@ -2491,6 +2491,19 @@ interfaces, IP addressing, DHCP, DNS, firewall (filter + NAT), routing, VLANs,
2491
2491
  wireless, WireGuard, queues/QoS, users, logs, backups, PoE, system, network
2492
2492
  tools, bridges, address-lists, scheduler/scripts and certificates.
2493
2493
 
2494
+ Tool discovery \u2014 MANDATORY workflow:
2495
+ This server has several hundred dedicated tools, but the host only surfaces a
2496
+ small subset at a time. You MUST follow this order:
2497
+ 1. ALWAYS call \`find_tools\` FIRST \u2014 describe what you want to do and it
2498
+ searches the full catalog for the best-matching dedicated tool.
2499
+ 2. (Optional) Call \`describe_tool\` to get the exact parameter schema.
2500
+ 3. Call the tool directly if it is listed, or via \`invoke_tool\` if not.
2501
+ 4. ONLY if \`find_tools\` returned ZERO results, fall back to
2502
+ \`run_routeros_command\` as a last resort.
2503
+ Dedicated tools have schema validation, structured output, and correct risk
2504
+ annotations \u2014 \`run_routeros_command\` has none of these. Always prefer the
2505
+ dedicated tool path.
2506
+
2494
2507
  Safety model \u2014 tools are annotated by risk:
2495
2508
  \u2022 readOnlyHint \u2192 inspection only, no changes
2496
2509
  \u2022 destructiveHint \u2192 removes or replaces configuration
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  resolveDeviceName,
22
22
  selectToolModules,
23
23
  setConfig
24
- } from "./shared/library-wppv8kdx.js";
24
+ } from "./shared/library-esjkmrg2.js";
25
25
  // src/server.ts
26
26
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
27
27
  import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
@@ -131,7 +131,7 @@ function registerPrompts(server) {
131
131
  // package.json
132
132
  var package_default = {
133
133
  name: "@usex/mikrotik-mcp",
134
- version: "3.47.0",
134
+ version: "3.48.0",
135
135
  description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
136
136
  keywords: [
137
137
  "ai",
@@ -280,6 +280,19 @@ interfaces, IP addressing, DHCP, DNS, firewall (filter + NAT), routing, VLANs,
280
280
  wireless, WireGuard, queues/QoS, users, logs, backups, PoE, system, network
281
281
  tools, bridges, address-lists, scheduler/scripts and certificates.
282
282
 
283
+ Tool discovery \u2014 MANDATORY workflow:
284
+ This server has several hundred dedicated tools, but the host only surfaces a
285
+ small subset at a time. You MUST follow this order:
286
+ 1. ALWAYS call \`find_tools\` FIRST \u2014 describe what you want to do and it
287
+ searches the full catalog for the best-matching dedicated tool.
288
+ 2. (Optional) Call \`describe_tool\` to get the exact parameter schema.
289
+ 3. Call the tool directly if it is listed, or via \`invoke_tool\` if not.
290
+ 4. ONLY if \`find_tools\` returned ZERO results, fall back to
291
+ \`run_routeros_command\` as a last resort.
292
+ Dedicated tools have schema validation, structured output, and correct risk
293
+ annotations \u2014 \`run_routeros_command\` has none of these. Always prefer the
294
+ dedicated tool path.
295
+
283
296
  Safety model \u2014 tools are annotated by risk:
284
297
  \u2022 readOnlyHint \u2192 inspection only, no changes
285
298
  \u2022 destructiveHint \u2192 removes or replaces configuration
@@ -4,7 +4,7 @@ import {
4
4
  allToolModules,
5
5
  moduleCatalog,
6
6
  selectToolModules
7
- } from "./cli-b6nehpgn.js";
7
+ } from "./cli-rcs47w19.js";
8
8
  export {
9
9
  selectToolModules,
10
10
  moduleCatalog,
@@ -6188,7 +6188,9 @@ var rawCommandTools = [
6188
6188
  name: "run_routeros_command",
6189
6189
  title: "Run a RouterOS Command (raw CLI)",
6190
6190
  annotations: WRITE,
6191
- description: "Execute ANY single RouterOS / MikroTik CLI command on the device and return its console output \u2014 the " + "universal primitive to read or change anything when no dedicated tool fits, for uncommon or bulk " + "operations, or simply when you can't quickly find the specific tool among the catalog. " + "Pass the command EXACTLY as typed in the RouterOS terminal, e.g. " + "`/system identity set name=Router1`, " + "`/ip dns set servers=1.1.1.1,8.8.8.8 allow-remote-requests=yes`, " + "`/ip address print`, `/ip firewall filter print`, `/interface print`, `/ip service print`, " + "`/system resource print`. " + "Works for reads (`\u2026 print`) and writes (`\u2026 set` / `add` / `remove`). Runs one command per call \u2014 " + "call again with a `\u2026 print` to verify a change. Prefer a dedicated tool when you know its name " + "(better validation and structured output); use this whenever discovery is the bottleneck. " + "WARNING: the command is run as-is and is NOT validated \u2014 it can be destructive (e.g. " + "`/system reset-configuration`, removing the management address), so review it before running. " + "For a stored multi-command script use add_script then run_script.",
6191
+ description: "\u26A0\uFE0F LAST RESORT \u2014 do NOT call this tool directly. ALWAYS call `find_tools` first to locate the " + "dedicated tool for your task, then run it via `invoke_tool`. Dedicated tools provide schema " + "validation, structured output, and accurate risk annotations that this raw command lacks. " + "Only use this tool when `find_tools` returned zero results for your query AND you are certain " + `no dedicated tool exists.
6192
+
6193
+ ` + "When you do use it: pass one RouterOS CLI command exactly as typed in the terminal. " + "The command is executed as-is with NO validation \u2014 it can be destructive, so review carefully. " + "Runs one command per call; call again with `\u2026 print` to verify a change. " + "For multi-command scripts use add_script + run_script instead.",
6192
6194
  inputSchema: {
6193
6195
  command: z17.string().describe("Full RouterOS CLI command exactly as typed, e.g. '/ip address print'")
6194
6196
  },
@@ -6319,7 +6321,7 @@ var cache = null;
6319
6321
  async function gateway() {
6320
6322
  if (cache)
6321
6323
  return cache;
6322
- const { moduleCatalog } = await import("./cli-je6h62bk.js");
6324
+ const { moduleCatalog } = await import("./cli-frtfsqcq.js");
6323
6325
  const forIndex = [];
6324
6326
  const byName = new Map;
6325
6327
  for (const mod of moduleCatalog) {
@@ -6357,7 +6359,9 @@ var toolGatewayTools = [
6357
6359
  name: "find_tools",
6358
6360
  title: "Find Tools (catalog search)",
6359
6361
  annotations: READ,
6360
- description: "Search the FULL MikroTik tool catalog by intent and get back the tools that best match \u2014 " + "use this FIRST whenever you can't immediately see the specific tool you need among the listed tools (the host only surfaces a subset of the several-hundred-tool catalog). Describe the task in natural language or keywords, e.g. 'block a LAN client by MAC', 'add an IPv4 firewall filter rule', 'import a TLS certificate', 'list DHCP leases', 'create a WireGuard peer'. Returns each match's exact tool name, what it does, and its " + "parameter names \u2014 then call it directly if it's already available, or run it via " + "`invoke_tool`. For IPv4 vs IPv6, say which: 'ipv4'/'ipv6' disambiguates the result.",
6362
+ description: "\uD83D\uDD0D START HERE \u2014 this is the PRIMARY entry point for ANY MikroTik / RouterOS task. " + "ALWAYS call this tool FIRST before attempting any other tool. This server has several hundred dedicated tools with full validation and structured output, but the host only surfaces a small " + `subset \u2014 this tool searches the FULL catalog and finds the best match for your intent.
6363
+
6364
+ ` + "Describe what you want to do in natural language or keywords, e.g. 'block a LAN client by MAC', 'add an IPv4 firewall filter rule', 'import a TLS certificate', 'list DHCP leases', " + "'create a WireGuard peer'. Returns each match's exact tool name, description, and parameters \u2014 " + "then call it directly if available, or via `invoke_tool`.\n\n" + "Workflow: find_tools \u2192 (optional) describe_tool \u2192 invoke_tool. " + "Only fall back to run_routeros_command if this search returns zero results. For IPv4 vs IPv6, include 'ipv4' or 'ipv6' to disambiguate.",
6361
6365
  inputSchema: {
6362
6366
  query: z18.string().min(1).describe("What you want to do, in words or keywords (e.g. 'add ipv4 nat masquerade rule')."),
6363
6367
  limit: z18.coerce.number().int().min(1).max(25).optional().describe("Max results to return (default 8).")
@@ -24778,7 +24782,7 @@ ${result}`;
24778
24782
  const interfaceType = await detectWirelessInterfaceType(ctx);
24779
24783
  if (!interfaceType)
24780
24784
  return "Error: No wireless interface support detected on this device.";
24781
- const scanCmd = new Cmd(`${interfaceType} scan`).raw(a.interface).set("duration", a.duration).build();
24785
+ const scanCmd = new Cmd(`${interfaceType} scan`).raw(quoteValue(a.interface)).set("duration", a.duration).build();
24782
24786
  const result = await executeMikrotikCommand(scanCmd, ctx);
24783
24787
  if (looksLikeError(result))
24784
24788
  return `Failed to scan wireless networks: ${result}`;
@@ -6129,7 +6129,9 @@ var rawCommandTools = [
6129
6129
  name: "run_routeros_command",
6130
6130
  title: "Run a RouterOS Command (raw CLI)",
6131
6131
  annotations: WRITE,
6132
- description: "Execute ANY single RouterOS / MikroTik CLI command on the device and return its console output \u2014 the " + "universal primitive to read or change anything when no dedicated tool fits, for uncommon or bulk " + "operations, or simply when you can't quickly find the specific tool among the catalog. " + "Pass the command EXACTLY as typed in the RouterOS terminal, e.g. " + "`/system identity set name=Router1`, " + "`/ip dns set servers=1.1.1.1,8.8.8.8 allow-remote-requests=yes`, " + "`/ip address print`, `/ip firewall filter print`, `/interface print`, `/ip service print`, " + "`/system resource print`. " + "Works for reads (`\u2026 print`) and writes (`\u2026 set` / `add` / `remove`). Runs one command per call \u2014 " + "call again with a `\u2026 print` to verify a change. Prefer a dedicated tool when you know its name " + "(better validation and structured output); use this whenever discovery is the bottleneck. " + "WARNING: the command is run as-is and is NOT validated \u2014 it can be destructive (e.g. " + "`/system reset-configuration`, removing the management address), so review it before running. " + "For a stored multi-command script use add_script then run_script.",
6132
+ description: "\u26A0\uFE0F LAST RESORT \u2014 do NOT call this tool directly. ALWAYS call `find_tools` first to locate the " + "dedicated tool for your task, then run it via `invoke_tool`. Dedicated tools provide schema " + "validation, structured output, and accurate risk annotations that this raw command lacks. " + "Only use this tool when `find_tools` returned zero results for your query AND you are certain " + `no dedicated tool exists.
6133
+
6134
+ ` + "When you do use it: pass one RouterOS CLI command exactly as typed in the terminal. " + "The command is executed as-is with NO validation \u2014 it can be destructive, so review carefully. " + "Runs one command per call; call again with `\u2026 print` to verify a change. " + "For multi-command scripts use add_script + run_script instead.",
6133
6135
  inputSchema: {
6134
6136
  command: z17.string().describe("Full RouterOS CLI command exactly as typed, e.g. '/ip address print'")
6135
6137
  },
@@ -6260,7 +6262,7 @@ var cache = null;
6260
6262
  async function gateway() {
6261
6263
  if (cache)
6262
6264
  return cache;
6263
- const { moduleCatalog } = await import("./library-fnp716x3.js");
6265
+ const { moduleCatalog } = await import("./library-xvsabg24.js");
6264
6266
  const forIndex = [];
6265
6267
  const byName = new Map;
6266
6268
  for (const mod of moduleCatalog) {
@@ -6298,7 +6300,9 @@ var toolGatewayTools = [
6298
6300
  name: "find_tools",
6299
6301
  title: "Find Tools (catalog search)",
6300
6302
  annotations: READ,
6301
- description: "Search the FULL MikroTik tool catalog by intent and get back the tools that best match \u2014 " + "use this FIRST whenever you can't immediately see the specific tool you need among the listed tools (the host only surfaces a subset of the several-hundred-tool catalog). Describe the task in natural language or keywords, e.g. 'block a LAN client by MAC', 'add an IPv4 firewall filter rule', 'import a TLS certificate', 'list DHCP leases', 'create a WireGuard peer'. Returns each match's exact tool name, what it does, and its " + "parameter names \u2014 then call it directly if it's already available, or run it via " + "`invoke_tool`. For IPv4 vs IPv6, say which: 'ipv4'/'ipv6' disambiguates the result.",
6303
+ description: "\uD83D\uDD0D START HERE \u2014 this is the PRIMARY entry point for ANY MikroTik / RouterOS task. " + "ALWAYS call this tool FIRST before attempting any other tool. This server has several hundred dedicated tools with full validation and structured output, but the host only surfaces a small " + `subset \u2014 this tool searches the FULL catalog and finds the best match for your intent.
6304
+
6305
+ ` + "Describe what you want to do in natural language or keywords, e.g. 'block a LAN client by MAC', 'add an IPv4 firewall filter rule', 'import a TLS certificate', 'list DHCP leases', " + "'create a WireGuard peer'. Returns each match's exact tool name, description, and parameters \u2014 " + "then call it directly if available, or via `invoke_tool`.\n\n" + "Workflow: find_tools \u2192 (optional) describe_tool \u2192 invoke_tool. " + "Only fall back to run_routeros_command if this search returns zero results. For IPv4 vs IPv6, include 'ipv4' or 'ipv6' to disambiguate.",
6302
6306
  inputSchema: {
6303
6307
  query: z18.string().min(1).describe("What you want to do, in words or keywords (e.g. 'add ipv4 nat masquerade rule')."),
6304
6308
  limit: z18.coerce.number().int().min(1).max(25).optional().describe("Max results to return (default 8).")
@@ -24719,7 +24723,7 @@ ${result}`;
24719
24723
  const interfaceType = await detectWirelessInterfaceType(ctx);
24720
24724
  if (!interfaceType)
24721
24725
  return "Error: No wireless interface support detected on this device.";
24722
- const scanCmd = new Cmd(`${interfaceType} scan`).raw(a.interface).set("duration", a.duration).build();
24726
+ const scanCmd = new Cmd(`${interfaceType} scan`).raw(quoteValue(a.interface)).set("duration", a.duration).build();
24723
24727
  const result = await executeMikrotikCommand(scanCmd, ctx);
24724
24728
  if (looksLikeError(result))
24725
24729
  return `Failed to scan wireless networks: ${result}`;
@@ -4,7 +4,7 @@ import {
4
4
  allToolModules,
5
5
  moduleCatalog,
6
6
  selectToolModules
7
- } from "./library-wppv8kdx.js";
7
+ } from "./library-esjkmrg2.js";
8
8
  export {
9
9
  selectToolModules,
10
10
  moduleCatalog,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usex/mikrotik-mcp",
3
- "version": "3.47.0",
3
+ "version": "3.48.0",
4
4
  "description": "MCP server for MikroTik RouterOS — 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
5
5
  "keywords": [
6
6
  "ai",