@usex/mikrotik-mcp 3.15.0 → 3.16.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 +13 -4
- package/dist/index.js +13 -4
- package/package.json +1 -1
- package/schemas/tool-catalog.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -17023,6 +17023,16 @@ ${details}`;
|
|
|
17023
17023
|
// src/tools/routing-table.ts
|
|
17024
17024
|
import { z as z91 } from "zod";
|
|
17025
17025
|
var UNSUPPORTED14 = "Routing tables are not available on this device (requires RouterOS v7 with the routing package).";
|
|
17026
|
+
function fibToken(fib, onSet = false) {
|
|
17027
|
+
if (fib === undefined)
|
|
17028
|
+
return;
|
|
17029
|
+
if (fib)
|
|
17030
|
+
return "fib";
|
|
17031
|
+
return onSet ? "!fib" : undefined;
|
|
17032
|
+
}
|
|
17033
|
+
function buildAddRoutingTableCommand(a) {
|
|
17034
|
+
return new Cmd("/routing table add").set("name", a.name).raw(fibToken(a.fib)).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
17035
|
+
}
|
|
17026
17036
|
var routingTableTools = [
|
|
17027
17037
|
defineTool({
|
|
17028
17038
|
name: "list_routing_tables",
|
|
@@ -17072,7 +17082,7 @@ ${result}`;
|
|
|
17072
17082
|
},
|
|
17073
17083
|
async handler(a, ctx) {
|
|
17074
17084
|
ctx.info(`Adding routing table: ${a.name}`);
|
|
17075
|
-
const cmd =
|
|
17085
|
+
const cmd = buildAddRoutingTableCommand(a);
|
|
17076
17086
|
const result = await executeMikrotikCommand(cmd, ctx);
|
|
17077
17087
|
if (commandUnsupported(result))
|
|
17078
17088
|
return UNSUPPORTED14;
|
|
@@ -17099,8 +17109,7 @@ ${details}`;
|
|
|
17099
17109
|
ctx.info(`Updating routing table: ${a.name}`);
|
|
17100
17110
|
const base = `/routing table set [find name="${a.name}"]`;
|
|
17101
17111
|
const cmd = new Cmd(base);
|
|
17102
|
-
|
|
17103
|
-
cmd.bool("fib", a.fib);
|
|
17112
|
+
cmd.raw(fibToken(a.fib, true));
|
|
17104
17113
|
if (a.comment !== undefined)
|
|
17105
17114
|
cmd.set("comment", a.comment);
|
|
17106
17115
|
if (a.disabled !== undefined)
|
|
@@ -23613,7 +23622,7 @@ function registerPrompts(server) {
|
|
|
23613
23622
|
// package.json
|
|
23614
23623
|
var package_default = {
|
|
23615
23624
|
name: "@usex/mikrotik-mcp",
|
|
23616
|
-
version: "3.
|
|
23625
|
+
version: "3.16.0",
|
|
23617
23626
|
description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
|
|
23618
23627
|
keywords: [
|
|
23619
23628
|
"ai",
|
package/dist/index.js
CHANGED
|
@@ -17035,6 +17035,16 @@ ${details}`;
|
|
|
17035
17035
|
// src/tools/routing-table.ts
|
|
17036
17036
|
import { z as z92 } from "zod";
|
|
17037
17037
|
var UNSUPPORTED14 = "Routing tables are not available on this device (requires RouterOS v7 with the routing package).";
|
|
17038
|
+
function fibToken(fib, onSet = false) {
|
|
17039
|
+
if (fib === undefined)
|
|
17040
|
+
return;
|
|
17041
|
+
if (fib)
|
|
17042
|
+
return "fib";
|
|
17043
|
+
return onSet ? "!fib" : undefined;
|
|
17044
|
+
}
|
|
17045
|
+
function buildAddRoutingTableCommand(a) {
|
|
17046
|
+
return new Cmd("/routing table add").set("name", a.name).raw(fibToken(a.fib)).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
17047
|
+
}
|
|
17038
17048
|
var routingTableTools = [
|
|
17039
17049
|
defineTool({
|
|
17040
17050
|
name: "list_routing_tables",
|
|
@@ -17084,7 +17094,7 @@ ${result}`;
|
|
|
17084
17094
|
},
|
|
17085
17095
|
async handler(a, ctx) {
|
|
17086
17096
|
ctx.info(`Adding routing table: ${a.name}`);
|
|
17087
|
-
const cmd =
|
|
17097
|
+
const cmd = buildAddRoutingTableCommand(a);
|
|
17088
17098
|
const result = await executeMikrotikCommand(cmd, ctx);
|
|
17089
17099
|
if (commandUnsupported(result))
|
|
17090
17100
|
return UNSUPPORTED14;
|
|
@@ -17111,8 +17121,7 @@ ${details}`;
|
|
|
17111
17121
|
ctx.info(`Updating routing table: ${a.name}`);
|
|
17112
17122
|
const base = `/routing table set [find name="${a.name}"]`;
|
|
17113
17123
|
const cmd = new Cmd(base);
|
|
17114
|
-
|
|
17115
|
-
cmd.bool("fib", a.fib);
|
|
17124
|
+
cmd.raw(fibToken(a.fib, true));
|
|
17116
17125
|
if (a.comment !== undefined)
|
|
17117
17126
|
cmd.set("comment", a.comment);
|
|
17118
17127
|
if (a.disabled !== undefined)
|
|
@@ -22016,7 +22025,7 @@ function selectToolModules(filter = {}, catalog = moduleCatalog) {
|
|
|
22016
22025
|
// package.json
|
|
22017
22026
|
var package_default = {
|
|
22018
22027
|
name: "@usex/mikrotik-mcp",
|
|
22019
|
-
version: "3.
|
|
22028
|
+
version: "3.16.0",
|
|
22020
22029
|
description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
|
|
22021
22030
|
keywords: [
|
|
22022
22031
|
"ai",
|
package/package.json
CHANGED