@usex/mikrotik-mcp 3.32.0 → 3.32.2
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 +8 -4
- package/dist/index.js +2 -2
- package/dist/shared/{cli-hyans525.js → cli-t84nm0d4.js} +22 -9
- package/dist/shared/{cli-vv85nx6e.js → cli-ytn5v321.js} +1 -1
- package/dist/shared/{library-rdt05kk9.js → library-bj9xrcg0.js} +22 -9
- package/dist/shared/{library-6q0frr4m.js → library-gsvkewg5.js} +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
toggleAaaEntity,
|
|
85
85
|
updateAaaEntity,
|
|
86
86
|
writeBackup
|
|
87
|
-
} from "./shared/cli-
|
|
87
|
+
} from "./shared/cli-t84nm0d4.js";
|
|
88
88
|
|
|
89
89
|
// src/cli.ts
|
|
90
90
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -2231,7 +2231,7 @@ function registerPrompts(server) {
|
|
|
2231
2231
|
// package.json
|
|
2232
2232
|
var package_default = {
|
|
2233
2233
|
name: "@usex/mikrotik-mcp",
|
|
2234
|
-
version: "3.32.
|
|
2234
|
+
version: "3.32.2",
|
|
2235
2235
|
description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
|
|
2236
2236
|
keywords: [
|
|
2237
2237
|
"ai",
|
|
@@ -2707,16 +2707,20 @@ async function main() {
|
|
|
2707
2707
|
warnIfPlaintextPasswordInContainer(Object.values(cfg.devices).some((d) => !!d.password));
|
|
2708
2708
|
const deviceNames = Object.keys(cfg.devices);
|
|
2709
2709
|
logger.info(`Starting ${SERVER_NAME} v${VERSION} (transport=${cfg.mcp.transport}, ` + `devices=${deviceNames.length === 1 ? deviceNames[0] : deviceNames.join("/")})`);
|
|
2710
|
-
|
|
2710
|
+
const startDashboard = async () => {
|
|
2711
|
+
if (!cfg.dashboard.enabled)
|
|
2712
|
+
return;
|
|
2711
2713
|
try {
|
|
2712
2714
|
await runDashboard(cfg.dashboard, cfg.mcp.transport);
|
|
2713
2715
|
} catch (e) {
|
|
2714
2716
|
logger.error(`Failed to start observability dashboard: ${e instanceof Error ? e.message : String(e)}. ` + "Continuing without it.");
|
|
2715
2717
|
}
|
|
2716
|
-
}
|
|
2718
|
+
};
|
|
2717
2719
|
if (cfg.mcp.transport === "stdio") {
|
|
2718
2720
|
await runStdio();
|
|
2721
|
+
await startDashboard();
|
|
2719
2722
|
} else {
|
|
2723
|
+
await startDashboard();
|
|
2720
2724
|
await runHttp(cfg.mcp);
|
|
2721
2725
|
}
|
|
2722
2726
|
}
|
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-bj9xrcg0.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.32.
|
|
134
|
+
version: "3.32.2",
|
|
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",
|
|
@@ -2459,11 +2459,24 @@ import { join as join3 } from "path";
|
|
|
2459
2459
|
import { registerAppResource, RESOURCE_MIME_TYPE } from "@modelcontextprotocol/ext-apps/server";
|
|
2460
2460
|
|
|
2461
2461
|
// src/paths.ts
|
|
2462
|
+
import { existsSync } from "fs";
|
|
2462
2463
|
import { join as join2, dirname } from "path";
|
|
2463
2464
|
import { fileURLToPath } from "url";
|
|
2464
2465
|
var meta = import.meta;
|
|
2465
2466
|
var HERE = meta.dir ?? meta.dirname ?? dirname(fileURLToPath(import.meta.url));
|
|
2466
|
-
|
|
2467
|
+
function findRoot(start) {
|
|
2468
|
+
let dir = start;
|
|
2469
|
+
for (let i = 0;i < 12; i++) {
|
|
2470
|
+
if (existsSync(join2(dir, "package.json")))
|
|
2471
|
+
return dir;
|
|
2472
|
+
const parent = dirname(dir);
|
|
2473
|
+
if (parent === dir)
|
|
2474
|
+
break;
|
|
2475
|
+
dir = parent;
|
|
2476
|
+
}
|
|
2477
|
+
return dirname(start);
|
|
2478
|
+
}
|
|
2479
|
+
var ROOT = findRoot(HERE);
|
|
2467
2480
|
var PROMPTS_DIR = join2(ROOT, "prompts");
|
|
2468
2481
|
var SCHEMAS_DIR = join2(ROOT, "schemas");
|
|
2469
2482
|
var UI_DIST_DIR = join2(ROOT, "dist", "ui");
|
|
@@ -3014,7 +3027,7 @@ function deviceSlug(name) {
|
|
|
3014
3027
|
|
|
3015
3028
|
// src/backups/vault.ts
|
|
3016
3029
|
import {
|
|
3017
|
-
existsSync,
|
|
3030
|
+
existsSync as existsSync2,
|
|
3018
3031
|
mkdirSync,
|
|
3019
3032
|
readFileSync as readFileSync4,
|
|
3020
3033
|
readdirSync,
|
|
@@ -3043,7 +3056,7 @@ function safeName(name) {
|
|
|
3043
3056
|
}
|
|
3044
3057
|
function listBackups() {
|
|
3045
3058
|
const dir = backupDir();
|
|
3046
|
-
if (!
|
|
3059
|
+
if (!existsSync2(dir))
|
|
3047
3060
|
return [];
|
|
3048
3061
|
return readdirSync(dir).filter((f) => f.endsWith(".rsc")).map((f) => {
|
|
3049
3062
|
const st = statSync(join4(dir, f));
|
|
@@ -3063,12 +3076,12 @@ function writeBackup(name, content) {
|
|
|
3063
3076
|
const dir = backupDir();
|
|
3064
3077
|
mkdirSync(dir, { recursive: true });
|
|
3065
3078
|
let final = safeName(name);
|
|
3066
|
-
if (
|
|
3079
|
+
if (existsSync2(join4(dir, final))) {
|
|
3067
3080
|
const dot = final.lastIndexOf(".");
|
|
3068
3081
|
const stem = dot > 0 ? final.slice(0, dot) : final;
|
|
3069
3082
|
const ext = dot > 0 ? final.slice(dot) : "";
|
|
3070
3083
|
let n = 2;
|
|
3071
|
-
while (
|
|
3084
|
+
while (existsSync2(join4(dir, `${stem}_${n}${ext}`)))
|
|
3072
3085
|
n++;
|
|
3073
3086
|
final = `${stem}_${n}${ext}`;
|
|
3074
3087
|
}
|
|
@@ -3077,7 +3090,7 @@ function writeBackup(name, content) {
|
|
|
3077
3090
|
}
|
|
3078
3091
|
function deleteBackup(name) {
|
|
3079
3092
|
const p = join4(backupDir(), safeName(name));
|
|
3080
|
-
if (!
|
|
3093
|
+
if (!existsSync2(p))
|
|
3081
3094
|
return false;
|
|
3082
3095
|
rmSync(p);
|
|
3083
3096
|
return true;
|
|
@@ -3089,9 +3102,9 @@ function renameBackup(oldName, newName) {
|
|
|
3089
3102
|
if (!to.endsWith(".rsc"))
|
|
3090
3103
|
to += ".rsc";
|
|
3091
3104
|
const toPath = join4(dir, to);
|
|
3092
|
-
if (!
|
|
3105
|
+
if (!existsSync2(from))
|
|
3093
3106
|
throw new Error(`backup not found: ${oldName}`);
|
|
3094
|
-
if (
|
|
3107
|
+
if (existsSync2(toPath))
|
|
3095
3108
|
throw new Error(`a backup named '${to}' already exists`);
|
|
3096
3109
|
renameSync(from, toPath);
|
|
3097
3110
|
return to;
|
|
@@ -5919,7 +5932,7 @@ var cache = null;
|
|
|
5919
5932
|
async function gateway() {
|
|
5920
5933
|
if (cache)
|
|
5921
5934
|
return cache;
|
|
5922
|
-
const { moduleCatalog } = await import("./cli-
|
|
5935
|
+
const { moduleCatalog } = await import("./cli-ytn5v321.js");
|
|
5923
5936
|
const forIndex = [];
|
|
5924
5937
|
const byName = new Map;
|
|
5925
5938
|
for (const mod of moduleCatalog) {
|
|
@@ -2374,11 +2374,24 @@ import { join as join3 } from "path";
|
|
|
2374
2374
|
import { registerAppResource, RESOURCE_MIME_TYPE } from "@modelcontextprotocol/ext-apps/server";
|
|
2375
2375
|
|
|
2376
2376
|
// src/paths.ts
|
|
2377
|
+
import { existsSync } from "fs";
|
|
2377
2378
|
import { join as join2, dirname } from "path";
|
|
2378
2379
|
import { fileURLToPath } from "url";
|
|
2379
2380
|
var meta = import.meta;
|
|
2380
2381
|
var HERE = meta.dir ?? meta.dirname ?? dirname(fileURLToPath(import.meta.url));
|
|
2381
|
-
|
|
2382
|
+
function findRoot(start) {
|
|
2383
|
+
let dir = start;
|
|
2384
|
+
for (let i = 0;i < 12; i++) {
|
|
2385
|
+
if (existsSync(join2(dir, "package.json")))
|
|
2386
|
+
return dir;
|
|
2387
|
+
const parent = dirname(dir);
|
|
2388
|
+
if (parent === dir)
|
|
2389
|
+
break;
|
|
2390
|
+
dir = parent;
|
|
2391
|
+
}
|
|
2392
|
+
return dirname(start);
|
|
2393
|
+
}
|
|
2394
|
+
var ROOT = findRoot(HERE);
|
|
2382
2395
|
var PROMPTS_DIR = join2(ROOT, "prompts");
|
|
2383
2396
|
var SCHEMAS_DIR = join2(ROOT, "schemas");
|
|
2384
2397
|
var UI_DIST_DIR = join2(ROOT, "dist", "ui");
|
|
@@ -2929,7 +2942,7 @@ function deviceSlug(name) {
|
|
|
2929
2942
|
|
|
2930
2943
|
// src/backups/vault.ts
|
|
2931
2944
|
import {
|
|
2932
|
-
existsSync,
|
|
2945
|
+
existsSync as existsSync2,
|
|
2933
2946
|
mkdirSync,
|
|
2934
2947
|
readFileSync as readFileSync4,
|
|
2935
2948
|
readdirSync,
|
|
@@ -2958,7 +2971,7 @@ function safeName(name) {
|
|
|
2958
2971
|
}
|
|
2959
2972
|
function listBackups() {
|
|
2960
2973
|
const dir = backupDir();
|
|
2961
|
-
if (!
|
|
2974
|
+
if (!existsSync2(dir))
|
|
2962
2975
|
return [];
|
|
2963
2976
|
return readdirSync(dir).filter((f) => f.endsWith(".rsc")).map((f) => {
|
|
2964
2977
|
const st = statSync(join4(dir, f));
|
|
@@ -2978,12 +2991,12 @@ function writeBackup(name, content) {
|
|
|
2978
2991
|
const dir = backupDir();
|
|
2979
2992
|
mkdirSync(dir, { recursive: true });
|
|
2980
2993
|
let final = safeName(name);
|
|
2981
|
-
if (
|
|
2994
|
+
if (existsSync2(join4(dir, final))) {
|
|
2982
2995
|
const dot = final.lastIndexOf(".");
|
|
2983
2996
|
const stem = dot > 0 ? final.slice(0, dot) : final;
|
|
2984
2997
|
const ext = dot > 0 ? final.slice(dot) : "";
|
|
2985
2998
|
let n = 2;
|
|
2986
|
-
while (
|
|
2999
|
+
while (existsSync2(join4(dir, `${stem}_${n}${ext}`)))
|
|
2987
3000
|
n++;
|
|
2988
3001
|
final = `${stem}_${n}${ext}`;
|
|
2989
3002
|
}
|
|
@@ -2992,7 +3005,7 @@ function writeBackup(name, content) {
|
|
|
2992
3005
|
}
|
|
2993
3006
|
function deleteBackup(name) {
|
|
2994
3007
|
const p = join4(backupDir(), safeName(name));
|
|
2995
|
-
if (!
|
|
3008
|
+
if (!existsSync2(p))
|
|
2996
3009
|
return false;
|
|
2997
3010
|
rmSync(p);
|
|
2998
3011
|
return true;
|
|
@@ -3004,9 +3017,9 @@ function renameBackup(oldName, newName) {
|
|
|
3004
3017
|
if (!to.endsWith(".rsc"))
|
|
3005
3018
|
to += ".rsc";
|
|
3006
3019
|
const toPath = join4(dir, to);
|
|
3007
|
-
if (!
|
|
3020
|
+
if (!existsSync2(from))
|
|
3008
3021
|
throw new Error(`backup not found: ${oldName}`);
|
|
3009
|
-
if (
|
|
3022
|
+
if (existsSync2(toPath))
|
|
3010
3023
|
throw new Error(`a backup named '${to}' already exists`);
|
|
3011
3024
|
renameSync(from, toPath);
|
|
3012
3025
|
return to;
|
|
@@ -5834,7 +5847,7 @@ var cache = null;
|
|
|
5834
5847
|
async function gateway() {
|
|
5835
5848
|
if (cache)
|
|
5836
5849
|
return cache;
|
|
5837
|
-
const { moduleCatalog } = await import("./library-
|
|
5850
|
+
const { moduleCatalog } = await import("./library-gsvkewg5.js");
|
|
5838
5851
|
const forIndex = [];
|
|
5839
5852
|
const byName = new Map;
|
|
5840
5853
|
for (const mod of moduleCatalog) {
|
package/package.json
CHANGED