@usex/mikrotik-mcp 4.1.0 → 4.3.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 +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/{cli-kq9jry12.js → cli-k18dkv4w.js} +1 -1
- package/dist/shared/{cli-2dtt405d.js → cli-mm90zmj3.js} +22 -41
- package/dist/shared/{library-pqnndx9v.js → library-t0cfgfyj.js} +22 -41
- package/dist/shared/{library-0d02nsc7.js → library-tmmvpwjf.js} +1 -1
- package/package.json +1 -1
- package/schemas/tool-catalog.json +4 -3
- package/schemas/tools/add_ospf_interface_template.json +2 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
selectToolModules,
|
|
30
30
|
setConfig,
|
|
31
31
|
updateSummaryLine
|
|
32
|
-
} from "./shared/library-
|
|
32
|
+
} from "./shared/library-t0cfgfyj.js";
|
|
33
33
|
// src/server.ts
|
|
34
34
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
35
35
|
import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -8364,7 +8364,7 @@ var cache = null;
|
|
|
8364
8364
|
async function gateway() {
|
|
8365
8365
|
if (cache)
|
|
8366
8366
|
return cache;
|
|
8367
|
-
const { moduleCatalog } = await import("./cli-
|
|
8367
|
+
const { moduleCatalog } = await import("./cli-k18dkv4w.js");
|
|
8368
8368
|
const forIndex = [];
|
|
8369
8369
|
const byName = new Map;
|
|
8370
8370
|
for (const mod of moduleCatalog) {
|
|
@@ -10158,23 +10158,26 @@ Management access may be partially restricted \u2014 review immediately.`;
|
|
|
10158
10158
|
|
|
10159
10159
|
// src/tools/firewall-filter.ts
|
|
10160
10160
|
import { z as z28 } from "zod";
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
return count.trim() !== "0" ? ruleId : null;
|
|
10161
|
+
|
|
10162
|
+
// src/tools/_resolve-rule-id.ts
|
|
10163
|
+
function ruleResolver(scope) {
|
|
10164
|
+
return async function resolveRuleId(ruleId, ctx) {
|
|
10165
|
+
if (/^\d+$/.test(ruleId)) {
|
|
10166
|
+
const idsRaw = await executeMikrotikCommand(`:foreach i in=[${scope} find] do={:put $i}`, ctx);
|
|
10167
|
+
if (isEmpty(idsRaw))
|
|
10168
|
+
return null;
|
|
10169
|
+
const ids = idsRaw.trim().split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
10170
|
+
const pos = Number.parseInt(ruleId, 10);
|
|
10171
|
+
return pos >= 0 && pos < ids.length ? ids[pos] : null;
|
|
10172
|
+
}
|
|
10173
|
+
const count = await executeMikrotikCommand(`${scope} print count-only where .id=${ruleId}`, ctx);
|
|
10174
|
+
return count.trim() !== "0" ? ruleId : null;
|
|
10175
|
+
};
|
|
10177
10176
|
}
|
|
10177
|
+
|
|
10178
|
+
// src/tools/firewall-filter.ts
|
|
10179
|
+
var isDigits = (s) => /^\d+$/.test(s);
|
|
10180
|
+
var resolveFilterRuleId = ruleResolver("/ip firewall filter");
|
|
10178
10181
|
async function updateFilterRule(a, ctx) {
|
|
10179
10182
|
ctx.info(`Updating firewall filter rule: rule_id=${a.rule_id}`);
|
|
10180
10183
|
const updates = [];
|
|
@@ -10561,28 +10564,6 @@ ${results.join(`
|
|
|
10561
10564
|
|
|
10562
10565
|
// src/tools/firewall-nat.ts
|
|
10563
10566
|
import { z as z29 } from "zod";
|
|
10564
|
-
|
|
10565
|
-
// src/tools/_resolve-rule-id.ts
|
|
10566
|
-
function ruleResolver(scope) {
|
|
10567
|
-
return async function resolveRuleId(ruleId, ctx) {
|
|
10568
|
-
if (/^\d+$/.test(ruleId)) {
|
|
10569
|
-
const id = `*${ruleId}`;
|
|
10570
|
-
const byId = await executeMikrotikCommand(`${scope} print count-only where .id=${id}`, ctx);
|
|
10571
|
-
if (byId.trim() !== "0")
|
|
10572
|
-
return id;
|
|
10573
|
-
const idsRaw = await executeMikrotikCommand(`:foreach i in=[${scope} find] do={:put $i}`, ctx);
|
|
10574
|
-
if (isEmpty(idsRaw))
|
|
10575
|
-
return null;
|
|
10576
|
-
const ids = idsRaw.trim().split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
10577
|
-
const pos = Number.parseInt(ruleId, 10);
|
|
10578
|
-
return pos >= 0 && pos < ids.length ? ids[pos] : null;
|
|
10579
|
-
}
|
|
10580
|
-
const count = await executeMikrotikCommand(`${scope} print count-only where .id=${ruleId}`, ctx);
|
|
10581
|
-
return count.trim() !== "0" ? ruleId : null;
|
|
10582
|
-
};
|
|
10583
|
-
}
|
|
10584
|
-
|
|
10585
|
-
// src/tools/firewall-nat.ts
|
|
10586
10567
|
var isDigits2 = (s) => /^\d+$/.test(s);
|
|
10587
10568
|
var resolveNatRuleId = ruleResolver("/ip firewall nat");
|
|
10588
10569
|
async function updateNatRule(a, ctx) {
|
|
@@ -23687,14 +23668,14 @@ ${result}`;
|
|
|
23687
23668
|
name: "add_ospf_interface_template",
|
|
23688
23669
|
title: "Add OSPF Interface Template",
|
|
23689
23670
|
annotations: WRITE,
|
|
23690
|
-
description: "Bind interfaces or network prefixes to an OSPF area (`/routing ospf interface-template add`). " + "Match links via `interfaces` (interface or interface-list name) and/or `networks` (prefix, " + "e.g. '10.0.0.0/24'). `type` sets the link model: broadcast (LAN), ptp (point-to-point), " + "
|
|
23671
|
+
description: "Bind interfaces or network prefixes to an OSPF area (`/routing ospf interface-template add`). " + "Match links via `interfaces` (interface or interface-list name) and/or `networks` (prefix, " + "e.g. '10.0.0.0/24'). `type` sets the link model: broadcast (LAN), ptp (point-to-point), " + "ptmp, ptmp-broadcast, nbma, or virtual-link. `passive=true` advertises the subnet without forming OSPF adjacencies " + "(for stub networks). `auth`/`auth_id`/`auth_key` enable per-interface authentication; `hello_interval` " + "e.g. '10s', `dead_interval` e.g. '40s'. " + "Requires the area to already exist (add_ospf_area). " + "Returns the new template id (e.g. '*2') if RouterOS echoes one; use list_ospf_interface_templates to verify.",
|
|
23691
23672
|
inputSchema: {
|
|
23692
23673
|
area: z96.string().describe("OSPF area name to attach matched interfaces to"),
|
|
23693
23674
|
interfaces: z96.string().optional().describe("Interface or interface-list name"),
|
|
23694
23675
|
networks: z96.string().optional().describe('Network prefix(es) to enable OSPF on, e.g. "10.0.0.0/24"'),
|
|
23695
23676
|
cost: z96.number().int().optional().describe("Output cost / metric"),
|
|
23696
23677
|
priority: z96.number().int().optional().describe("DR election priority (0 = never DR)"),
|
|
23697
|
-
type: z96.enum(["broadcast", "ptp", "
|
|
23678
|
+
type: z96.enum(["broadcast", "ptp", "ptmp", "ptmp-broadcast", "nbma", "virtual-link"]).optional(),
|
|
23698
23679
|
passive: z96.boolean().optional(),
|
|
23699
23680
|
hello_interval: z96.string().optional().describe('e.g. "10s"'),
|
|
23700
23681
|
dead_interval: z96.string().optional().describe('e.g. "40s"'),
|
|
@@ -8294,7 +8294,7 @@ var cache = null;
|
|
|
8294
8294
|
async function gateway() {
|
|
8295
8295
|
if (cache)
|
|
8296
8296
|
return cache;
|
|
8297
|
-
const { moduleCatalog } = await import("./library-
|
|
8297
|
+
const { moduleCatalog } = await import("./library-tmmvpwjf.js");
|
|
8298
8298
|
const forIndex = [];
|
|
8299
8299
|
const byName = new Map;
|
|
8300
8300
|
for (const mod of moduleCatalog) {
|
|
@@ -10088,23 +10088,26 @@ Management access may be partially restricted \u2014 review immediately.`;
|
|
|
10088
10088
|
|
|
10089
10089
|
// src/tools/firewall-filter.ts
|
|
10090
10090
|
import { z as z28 } from "zod";
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
return count.trim() !== "0" ? ruleId : null;
|
|
10091
|
+
|
|
10092
|
+
// src/tools/_resolve-rule-id.ts
|
|
10093
|
+
function ruleResolver(scope) {
|
|
10094
|
+
return async function resolveRuleId(ruleId, ctx) {
|
|
10095
|
+
if (/^\d+$/.test(ruleId)) {
|
|
10096
|
+
const idsRaw = await executeMikrotikCommand(`:foreach i in=[${scope} find] do={:put $i}`, ctx);
|
|
10097
|
+
if (isEmpty(idsRaw))
|
|
10098
|
+
return null;
|
|
10099
|
+
const ids = idsRaw.trim().split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
10100
|
+
const pos = Number.parseInt(ruleId, 10);
|
|
10101
|
+
return pos >= 0 && pos < ids.length ? ids[pos] : null;
|
|
10102
|
+
}
|
|
10103
|
+
const count = await executeMikrotikCommand(`${scope} print count-only where .id=${ruleId}`, ctx);
|
|
10104
|
+
return count.trim() !== "0" ? ruleId : null;
|
|
10105
|
+
};
|
|
10107
10106
|
}
|
|
10107
|
+
|
|
10108
|
+
// src/tools/firewall-filter.ts
|
|
10109
|
+
var isDigits = (s) => /^\d+$/.test(s);
|
|
10110
|
+
var resolveFilterRuleId = ruleResolver("/ip firewall filter");
|
|
10108
10111
|
async function updateFilterRule(a, ctx) {
|
|
10109
10112
|
ctx.info(`Updating firewall filter rule: rule_id=${a.rule_id}`);
|
|
10110
10113
|
const updates = [];
|
|
@@ -10491,28 +10494,6 @@ ${results.join(`
|
|
|
10491
10494
|
|
|
10492
10495
|
// src/tools/firewall-nat.ts
|
|
10493
10496
|
import { z as z29 } from "zod";
|
|
10494
|
-
|
|
10495
|
-
// src/tools/_resolve-rule-id.ts
|
|
10496
|
-
function ruleResolver(scope) {
|
|
10497
|
-
return async function resolveRuleId(ruleId, ctx) {
|
|
10498
|
-
if (/^\d+$/.test(ruleId)) {
|
|
10499
|
-
const id = `*${ruleId}`;
|
|
10500
|
-
const byId = await executeMikrotikCommand(`${scope} print count-only where .id=${id}`, ctx);
|
|
10501
|
-
if (byId.trim() !== "0")
|
|
10502
|
-
return id;
|
|
10503
|
-
const idsRaw = await executeMikrotikCommand(`:foreach i in=[${scope} find] do={:put $i}`, ctx);
|
|
10504
|
-
if (isEmpty(idsRaw))
|
|
10505
|
-
return null;
|
|
10506
|
-
const ids = idsRaw.trim().split(/\r?\n/).map((l) => l.trim()).filter(Boolean);
|
|
10507
|
-
const pos = Number.parseInt(ruleId, 10);
|
|
10508
|
-
return pos >= 0 && pos < ids.length ? ids[pos] : null;
|
|
10509
|
-
}
|
|
10510
|
-
const count = await executeMikrotikCommand(`${scope} print count-only where .id=${ruleId}`, ctx);
|
|
10511
|
-
return count.trim() !== "0" ? ruleId : null;
|
|
10512
|
-
};
|
|
10513
|
-
}
|
|
10514
|
-
|
|
10515
|
-
// src/tools/firewall-nat.ts
|
|
10516
10497
|
var isDigits2 = (s) => /^\d+$/.test(s);
|
|
10517
10498
|
var resolveNatRuleId = ruleResolver("/ip firewall nat");
|
|
10518
10499
|
async function updateNatRule(a, ctx) {
|
|
@@ -23617,14 +23598,14 @@ ${result}`;
|
|
|
23617
23598
|
name: "add_ospf_interface_template",
|
|
23618
23599
|
title: "Add OSPF Interface Template",
|
|
23619
23600
|
annotations: WRITE,
|
|
23620
|
-
description: "Bind interfaces or network prefixes to an OSPF area (`/routing ospf interface-template add`). " + "Match links via `interfaces` (interface or interface-list name) and/or `networks` (prefix, " + "e.g. '10.0.0.0/24'). `type` sets the link model: broadcast (LAN), ptp (point-to-point), " + "
|
|
23601
|
+
description: "Bind interfaces or network prefixes to an OSPF area (`/routing ospf interface-template add`). " + "Match links via `interfaces` (interface or interface-list name) and/or `networks` (prefix, " + "e.g. '10.0.0.0/24'). `type` sets the link model: broadcast (LAN), ptp (point-to-point), " + "ptmp, ptmp-broadcast, nbma, or virtual-link. `passive=true` advertises the subnet without forming OSPF adjacencies " + "(for stub networks). `auth`/`auth_id`/`auth_key` enable per-interface authentication; `hello_interval` " + "e.g. '10s', `dead_interval` e.g. '40s'. " + "Requires the area to already exist (add_ospf_area). " + "Returns the new template id (e.g. '*2') if RouterOS echoes one; use list_ospf_interface_templates to verify.",
|
|
23621
23602
|
inputSchema: {
|
|
23622
23603
|
area: z96.string().describe("OSPF area name to attach matched interfaces to"),
|
|
23623
23604
|
interfaces: z96.string().optional().describe("Interface or interface-list name"),
|
|
23624
23605
|
networks: z96.string().optional().describe('Network prefix(es) to enable OSPF on, e.g. "10.0.0.0/24"'),
|
|
23625
23606
|
cost: z96.number().int().optional().describe("Output cost / metric"),
|
|
23626
23607
|
priority: z96.number().int().optional().describe("DR election priority (0 = never DR)"),
|
|
23627
|
-
type: z96.enum(["broadcast", "ptp", "
|
|
23608
|
+
type: z96.enum(["broadcast", "ptp", "ptmp", "ptmp-broadcast", "nbma", "virtual-link"]).optional(),
|
|
23628
23609
|
passive: z96.boolean().optional(),
|
|
23629
23610
|
hello_interval: z96.string().optional().describe('e.g. "10s"'),
|
|
23630
23611
|
dead_interval: z96.string().optional().describe('e.g. "40s"'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"generated": "by scripts/gen-schemas.ts — do not edit by hand",
|
|
5
5
|
"toolCount": 794,
|
|
6
6
|
"tools": [
|
|
@@ -11411,7 +11411,7 @@
|
|
|
11411
11411
|
"destructiveHint": false,
|
|
11412
11412
|
"openWorldHint": false
|
|
11413
11413
|
},
|
|
11414
|
-
"description": "Bind interfaces or network prefixes to an OSPF area (`/routing ospf interface-template add`). Match links via `interfaces` (interface or interface-list name) and/or `networks` (prefix, e.g. '10.0.0.0/24'). `type` sets the link model: broadcast (LAN), ptp (point-to-point),
|
|
11414
|
+
"description": "Bind interfaces or network prefixes to an OSPF area (`/routing ospf interface-template add`). Match links via `interfaces` (interface or interface-list name) and/or `networks` (prefix, e.g. '10.0.0.0/24'). `type` sets the link model: broadcast (LAN), ptp (point-to-point), ptmp, ptmp-broadcast, nbma, or virtual-link. `passive=true` advertises the subnet without forming OSPF adjacencies (for stub networks). `auth`/`auth_id`/`auth_key` enable per-interface authentication; `hello_interval` e.g. '10s', `dead_interval` e.g. '40s'. Requires the area to already exist (add_ospf_area). Returns the new template id (e.g. '*2') if RouterOS echoes one; use list_ospf_interface_templates to verify.",
|
|
11415
11415
|
"inputSchema": {
|
|
11416
11416
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
11417
11417
|
"type": "object",
|
|
@@ -11445,8 +11445,9 @@
|
|
|
11445
11445
|
"enum": [
|
|
11446
11446
|
"broadcast",
|
|
11447
11447
|
"ptp",
|
|
11448
|
-
"nbma",
|
|
11449
11448
|
"ptmp",
|
|
11449
|
+
"ptmp-broadcast",
|
|
11450
|
+
"nbma",
|
|
11450
11451
|
"virtual-link"
|
|
11451
11452
|
]
|
|
11452
11453
|
},
|