@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 +15 -2
- package/dist/index.js +15 -2
- package/dist/shared/{cli-je6h62bk.js → cli-frtfsqcq.js} +1 -1
- package/dist/shared/{cli-b6nehpgn.js → cli-rcs47w19.js} +8 -4
- package/dist/shared/{library-wppv8kdx.js → library-esjkmrg2.js} +8 -4
- package/dist/shared/{library-fnp716x3.js → library-xvsabg24.js} +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
toggleAaaEntity,
|
|
90
90
|
updateAaaEntity,
|
|
91
91
|
writeBackup
|
|
92
|
-
} from "./shared/cli-
|
|
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.
|
|
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-
|
|
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.
|
|
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
|
|
@@ -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: "
|
|
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-
|
|
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: "
|
|
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: "
|
|
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-
|
|
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: "
|
|
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}`;
|
package/package.json
CHANGED