@usex/mikrotik-mcp 3.43.0 → 3.45.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
@@ -74,6 +74,7 @@ import {
74
74
  resolveDeviceName,
75
75
  restoreLocalBackup,
76
76
  s3Target,
77
+ sampleAllTraffic,
77
78
  sampleDeviceTraffic,
78
79
  selectToolModules,
79
80
  setConfig,
@@ -88,7 +89,7 @@ import {
88
89
  toggleAaaEntity,
89
90
  updateAaaEntity,
90
91
  writeBackup
91
- } from "./shared/cli-vrm1c5fb.js";
92
+ } from "./shared/cli-k2ghtqd0.js";
92
93
 
93
94
  // src/cli.ts
94
95
  import { existsSync as existsSync2 } from "fs";
@@ -1130,6 +1131,146 @@ function computeStats(events, opts) {
1130
1131
  windowMs: span
1131
1132
  };
1132
1133
  }
1134
+ // package.json
1135
+ var package_default = {
1136
+ name: "@usex/mikrotik-mcp",
1137
+ version: "3.45.0",
1138
+ description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
1139
+ keywords: [
1140
+ "ai",
1141
+ "bun",
1142
+ "claude",
1143
+ "mcp",
1144
+ "mikrotik",
1145
+ "mikrotik mcp"
1146
+ ],
1147
+ homepage: "https://mikrotik-mcp.usestrict.dev",
1148
+ bugs: {
1149
+ url: "https://github.com/ali-master/mikrotik-mcp/issues"
1150
+ },
1151
+ license: "MIT",
1152
+ author: {
1153
+ name: "Ali Torki",
1154
+ email: "ali_4286@live.com",
1155
+ url: "https://github.com/ali-master"
1156
+ },
1157
+ repository: {
1158
+ type: "git",
1159
+ url: "https://github.com/ali-master/mikrotik-mcp.git"
1160
+ },
1161
+ bin: {
1162
+ "mikrotik-mcp": "dist/cli.js"
1163
+ },
1164
+ files: [
1165
+ "dist",
1166
+ "prompts",
1167
+ "schemas"
1168
+ ],
1169
+ type: "module",
1170
+ main: "dist/index.js",
1171
+ module: "dist/index.js",
1172
+ types: "dist/index.d.ts",
1173
+ exports: {
1174
+ ".": {
1175
+ types: "./dist/index.d.ts",
1176
+ import: "./dist/index.js"
1177
+ }
1178
+ },
1179
+ publishConfig: {
1180
+ access: "public"
1181
+ },
1182
+ scripts: {
1183
+ build: "bunup && chmod +x dist/cli.js && bun run build:ui",
1184
+ "build:ui": "bun run scripts/build-ui.ts",
1185
+ dev: "bunup --watch",
1186
+ prepack: "bunup && chmod +x dist/cli.js && bun run build:ui",
1187
+ "auth-check": "bun run src/cli.ts auth-check",
1188
+ "gen:schemas": "bun run scripts/gen-schemas.ts",
1189
+ "gen:docs": "bun run scripts/gen-tool-docs.ts",
1190
+ gen: "bun run gen:schemas && bun run gen:docs",
1191
+ start: "bun run src/cli.ts serve",
1192
+ discover: "bun run scripts/discover-macs.ts",
1193
+ inspect: "bunx @modelcontextprotocol/inspector bun run src/cli.ts serve",
1194
+ "inspect:built": "bun run build && bunx @modelcontextprotocol/inspector bun dist/cli.js serve",
1195
+ "inspect:config": "bunx @modelcontextprotocol/inspector --config mcp-inspector.config.json --server mikrotik",
1196
+ "inspect:cli": "bunx @modelcontextprotocol/inspector --cli bun run src/cli.ts serve --method tools/list",
1197
+ "inspect:config:local": "bunx @modelcontextprotocol/inspector --config /var/open-source/mikrotik-mcp/mcp-inspector.config.local.json --server mikrotik",
1198
+ test: "vp test run",
1199
+ "test:watch": "vp test",
1200
+ release: "release-it",
1201
+ "test:types": "tsc --noEmit",
1202
+ check: "vp check",
1203
+ lint: "vp lint",
1204
+ "lint:fix": "vp lint --fix",
1205
+ format: "vp fmt --check",
1206
+ "format:fix": "vp fmt --write",
1207
+ prepare: "vp config"
1208
+ },
1209
+ dependencies: {
1210
+ "@modelcontextprotocol/ext-apps": "^1.7.4",
1211
+ "@modelcontextprotocol/sdk": "^1.29.0",
1212
+ "@tikoci/centrs": "^0.1.0",
1213
+ "ipaddr.js": "^2.4.0",
1214
+ ssh2: "^1.17.0",
1215
+ zod: "^4.4.3"
1216
+ },
1217
+ devDependencies: {
1218
+ "@resvg/resvg-js": "^2.6.2",
1219
+ "@tailwindcss/vite": "^4.3.2",
1220
+ "@types/bun": "latest",
1221
+ "@types/node": "^26.0.1",
1222
+ "@types/react": "^19.2.17",
1223
+ "@types/react-dom": "^19.2.3",
1224
+ "@types/ssh2": "^1.15.5",
1225
+ "@types/update-notifier": "^6.0.8",
1226
+ bunup: "^0.16.32",
1227
+ "class-variance-authority": "^0.7.1",
1228
+ clsx: "^2.1.1",
1229
+ gsap: "^3.15.0",
1230
+ prettier: "^3.9.4",
1231
+ react: "^19.2.7",
1232
+ "react-dom": "^19.2.7",
1233
+ recharts: "^3.9.0",
1234
+ "release-it": "^20.2.1",
1235
+ "tailwind-merge": "^3.6.0",
1236
+ tailwindcss: "^4.3.2",
1237
+ vite: "npm:@voidzero-dev/vite-plus-core@latest",
1238
+ "vite-plus": "latest"
1239
+ },
1240
+ peerDependencies: {
1241
+ typescript: "^6.0.3"
1242
+ },
1243
+ overrides: {
1244
+ vite: "npm:@voidzero-dev/vite-plus-core@latest",
1245
+ vitest: "4.1.9"
1246
+ },
1247
+ engines: {
1248
+ bun: ">=1.3.0"
1249
+ },
1250
+ packageManager: "bun@1.3.14",
1251
+ changelog: {
1252
+ labels: {
1253
+ feature: "Features",
1254
+ bug: "Bug fixes",
1255
+ enhancement: "Enhancements",
1256
+ docs: "Docs",
1257
+ dependencies: "Dependencies",
1258
+ "type: code style": "Code style tweaks",
1259
+ "status: blocked": "Breaking changes",
1260
+ "breaking change": "Breaking changes"
1261
+ }
1262
+ },
1263
+ logo: "https://raw.githubusercontent.com/ali-master/mikrotik-mcp/master/assets/logo.svg",
1264
+ logoIcon: "https://raw.githubusercontent.com/ali-master/mikrotik-mcp/master/assets/logo-icon.svg"
1265
+ };
1266
+
1267
+ // src/version.ts
1268
+ var VERSION = package_default.version;
1269
+ var WEBSITE_URL = package_default.homepage;
1270
+ var LOGO_URL = package_default.logoIcon;
1271
+ var SERVER_TITLE = package_default.name;
1272
+ var SERVER_DESCRIPTION = package_default.description;
1273
+ var SERVER_NAME = "mcp-mikrotik";
1133
1274
 
1134
1275
  // src/observability/dashboard.ts
1135
1276
  var SERVER_TAG2 = "mikrotik-mcp";
@@ -1561,6 +1702,10 @@ async function clientsRoutes(req, url) {
1561
1702
  const ctx = createContext(undefined, deviceFromQuery());
1562
1703
  return json(await sampleDeviceTraffic(ctx, ip));
1563
1704
  }
1705
+ if (p === "/api/clients/traffic-bulk" && req.method === "GET") {
1706
+ const ctx = createContext(undefined, deviceFromQuery());
1707
+ return json(await sampleAllTraffic(ctx));
1708
+ }
1564
1709
  if (req.method === "POST") {
1565
1710
  const b = await readJson(req);
1566
1711
  const ctx = createContext(undefined, b?.device);
@@ -2048,6 +2193,7 @@ async function runDashboard(cfg, transportLabel) {
2048
2193
  const f = facets(db);
2049
2194
  return json({
2050
2195
  ...f,
2196
+ version: VERSION,
2051
2197
  risks: ["READ", "WRITE", "WRITE_IDEMPOTENT", "DESTRUCTIVE", "DANGEROUS"],
2052
2198
  total: db.total(),
2053
2199
  liveClients: subscriberCount(),
@@ -2279,146 +2425,6 @@ function registerPrompts(server) {
2279
2425
  }
2280
2426
  return count;
2281
2427
  }
2282
- // package.json
2283
- var package_default = {
2284
- name: "@usex/mikrotik-mcp",
2285
- version: "3.43.0",
2286
- description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
2287
- keywords: [
2288
- "ai",
2289
- "bun",
2290
- "claude",
2291
- "mcp",
2292
- "mikrotik",
2293
- "mikrotik mcp"
2294
- ],
2295
- homepage: "https://mikrotik-mcp.usestrict.dev",
2296
- bugs: {
2297
- url: "https://github.com/ali-master/mikrotik-mcp/issues"
2298
- },
2299
- license: "MIT",
2300
- author: {
2301
- name: "Ali Torki",
2302
- email: "ali_4286@live.com",
2303
- url: "https://github.com/ali-master"
2304
- },
2305
- repository: {
2306
- type: "git",
2307
- url: "https://github.com/ali-master/mikrotik-mcp.git"
2308
- },
2309
- bin: {
2310
- "mikrotik-mcp": "dist/cli.js"
2311
- },
2312
- files: [
2313
- "dist",
2314
- "prompts",
2315
- "schemas"
2316
- ],
2317
- type: "module",
2318
- main: "dist/index.js",
2319
- module: "dist/index.js",
2320
- types: "dist/index.d.ts",
2321
- exports: {
2322
- ".": {
2323
- types: "./dist/index.d.ts",
2324
- import: "./dist/index.js"
2325
- }
2326
- },
2327
- publishConfig: {
2328
- access: "public"
2329
- },
2330
- scripts: {
2331
- build: "bunup && chmod +x dist/cli.js && bun run build:ui",
2332
- "build:ui": "bun run scripts/build-ui.ts",
2333
- dev: "bunup --watch",
2334
- prepack: "bunup && chmod +x dist/cli.js && bun run build:ui",
2335
- "auth-check": "bun run src/cli.ts auth-check",
2336
- "gen:schemas": "bun run scripts/gen-schemas.ts",
2337
- "gen:docs": "bun run scripts/gen-tool-docs.ts",
2338
- gen: "bun run gen:schemas && bun run gen:docs",
2339
- start: "bun run src/cli.ts serve",
2340
- discover: "bun run scripts/discover-macs.ts",
2341
- inspect: "bunx @modelcontextprotocol/inspector bun run src/cli.ts serve",
2342
- "inspect:built": "bun run build && bunx @modelcontextprotocol/inspector bun dist/cli.js serve",
2343
- "inspect:config": "bunx @modelcontextprotocol/inspector --config mcp-inspector.config.json --server mikrotik",
2344
- "inspect:cli": "bunx @modelcontextprotocol/inspector --cli bun run src/cli.ts serve --method tools/list",
2345
- "inspect:config:local": "bunx @modelcontextprotocol/inspector --config /var/open-source/mikrotik-mcp/mcp-inspector.config.local.json --server mikrotik",
2346
- test: "vp test run",
2347
- "test:watch": "vp test",
2348
- release: "release-it",
2349
- "test:types": "tsc --noEmit",
2350
- check: "vp check",
2351
- lint: "vp lint",
2352
- "lint:fix": "vp lint --fix",
2353
- format: "vp fmt --check",
2354
- "format:fix": "vp fmt --write",
2355
- prepare: "vp config"
2356
- },
2357
- dependencies: {
2358
- "@modelcontextprotocol/ext-apps": "^1.7.4",
2359
- "@modelcontextprotocol/sdk": "^1.29.0",
2360
- "@tikoci/centrs": "^0.1.0",
2361
- "ipaddr.js": "^2.4.0",
2362
- ssh2: "^1.17.0",
2363
- zod: "^4.4.3"
2364
- },
2365
- devDependencies: {
2366
- "@resvg/resvg-js": "^2.6.2",
2367
- "@tailwindcss/vite": "^4.3.2",
2368
- "@types/bun": "latest",
2369
- "@types/node": "^26.0.1",
2370
- "@types/react": "^19.2.17",
2371
- "@types/react-dom": "^19.2.3",
2372
- "@types/ssh2": "^1.15.5",
2373
- "@types/update-notifier": "^6.0.8",
2374
- bunup: "^0.16.32",
2375
- "class-variance-authority": "^0.7.1",
2376
- clsx: "^2.1.1",
2377
- gsap: "^3.15.0",
2378
- prettier: "^3.9.4",
2379
- react: "^19.2.7",
2380
- "react-dom": "^19.2.7",
2381
- recharts: "^3.9.0",
2382
- "release-it": "^20.2.1",
2383
- "tailwind-merge": "^3.6.0",
2384
- tailwindcss: "^4.3.2",
2385
- vite: "npm:@voidzero-dev/vite-plus-core@latest",
2386
- "vite-plus": "latest"
2387
- },
2388
- peerDependencies: {
2389
- typescript: "^6.0.3"
2390
- },
2391
- overrides: {
2392
- vite: "npm:@voidzero-dev/vite-plus-core@latest",
2393
- vitest: "4.1.9"
2394
- },
2395
- engines: {
2396
- bun: ">=1.3.0"
2397
- },
2398
- packageManager: "bun@1.3.14",
2399
- changelog: {
2400
- labels: {
2401
- feature: "Features",
2402
- bug: "Bug fixes",
2403
- enhancement: "Enhancements",
2404
- docs: "Docs",
2405
- dependencies: "Dependencies",
2406
- "type: code style": "Code style tweaks",
2407
- "status: blocked": "Breaking changes",
2408
- "breaking change": "Breaking changes"
2409
- }
2410
- },
2411
- logo: "https://raw.githubusercontent.com/ali-master/mikrotik-mcp/master/assets/logo.svg",
2412
- logoIcon: "https://raw.githubusercontent.com/ali-master/mikrotik-mcp/master/assets/logo-icon.svg"
2413
- };
2414
-
2415
- // src/version.ts
2416
- var VERSION = package_default.version;
2417
- var WEBSITE_URL = package_default.homepage;
2418
- var LOGO_URL = package_default.logoIcon;
2419
- var SERVER_TITLE = package_default.name;
2420
- var SERVER_DESCRIPTION = package_default.description;
2421
- var SERVER_NAME = "mcp-mikrotik";
2422
2428
 
2423
2429
  // src/server.ts
2424
2430
  var INSTRUCTIONS = `MikroTik RouterOS management over SSH.
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  resolveDeviceName,
22
22
  selectToolModules,
23
23
  setConfig
24
- } from "./shared/library-hjde13aa.js";
24
+ } from "./shared/library-nb4wss02.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.43.0",
134
+ version: "3.45.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",
@@ -4,7 +4,7 @@ import {
4
4
  allToolModules,
5
5
  moduleCatalog,
6
6
  selectToolModules
7
- } from "./cli-vrm1c5fb.js";
7
+ } from "./cli-k2ghtqd0.js";
8
8
  export {
9
9
  selectToolModules,
10
10
  moduleCatalog,
@@ -2413,6 +2413,28 @@ async function sampleDeviceTraffic(ctx, ip) {
2413
2413
  uploadLimit: limit(upLim)
2414
2414
  };
2415
2415
  }
2416
+ async function sampleAllTraffic(ctx) {
2417
+ const ts = Date.now();
2418
+ const out = await executeMikrotikCommand("/queue simple print stats detail", ctx);
2419
+ if (isEmpty(out) || looksLikeError(out))
2420
+ return { ts, queues: {} };
2421
+ const queues = {};
2422
+ const limit = (v) => v && v !== "0" ? v : "";
2423
+ for (const row of parseRecords(out).rows) {
2424
+ const ip = (row.target ?? "").split("/")[0]?.trim();
2425
+ if (!ip)
2426
+ continue;
2427
+ const [txB, rxB] = (row.bytes ?? "0/0").split("/");
2428
+ const [upLim, downLim] = (row["max-limit"] ?? "0/0").split("/");
2429
+ queues[ip] = {
2430
+ txBytes: parseLeadingNumber(txB) ?? 0,
2431
+ rxBytes: parseLeadingNumber(rxB) ?? 0,
2432
+ downloadLimit: limit(downLim),
2433
+ uploadLimit: limit(upLim)
2434
+ };
2435
+ }
2436
+ return { ts, queues };
2437
+ }
2416
2438
  async function setDeviceLimits(ctx, ip, opts) {
2417
2439
  const rate = (v) => {
2418
2440
  const t = (v ?? "").trim();
@@ -6288,7 +6310,7 @@ var cache = null;
6288
6310
  async function gateway() {
6289
6311
  if (cache)
6290
6312
  return cache;
6291
- const { moduleCatalog } = await import("./cli-j7xj0at0.js");
6313
+ const { moduleCatalog } = await import("./cli-1e5sj65w.js");
6292
6314
  const forIndex = [];
6293
6315
  const byName = new Map;
6294
6316
  for (const mod of moduleCatalog) {
@@ -25885,4 +25907,4 @@ function selectToolModules(filter = {}, catalog = moduleCatalog) {
25885
25907
  }).map((m) => m.tools);
25886
25908
  }
25887
25909
 
25888
- export { __require, DEFAULT_SNAPSHOT_DB, DEFAULT_CONFIG_HISTORY_DIR, DeviceConfigSchema, ToolFilterSchema, MikrotikConfigSchema, getConfigSource, loadConfig, logger, setConfig, getConfig, listDevices, deviceLabels, resolveDeviceName, deviceDirectory, isMacTelnetDevice, createDeviceClient, describeTransport, isPoolEnabled, closeAll, poolStatus, executeMikrotikCommand, createContext, isEmpty, looksLikeError, commandUnsupported, parseKeyValues, parseRouterosDate, parseSize, parseSystemResource, parseRecords, parseLeadingNumber, REDACTED, redact, configureRecorder, getEventStore, subscribe, subscriberCount, registerTools, fetchDevices, sampleDeviceTraffic, setDeviceLimits, blockDevice, allowDevice, makeDeviceStatic, setDeviceIp, setDeviceLabel, removeDeviceLease, devicesView, PROMPTS_DIR, UI_DIST_DIR, registerUiResources, backupDir, listBackups, readBackup, writeBackup, deleteBackup, renameBackup, createLocalBackup, restoreLocalBackup, isS3Configured, getS3Client, presignExpiresIn, s3Target, splitCommands, buildChangePlan, renderPlan, diffLines, normalizeExport, openSnapshotStore, DEFAULT_TZSP_PORT, capture2 as capture, AAA_ENTITIES, listAaaEntity, addAaaEntity, updateAaaEntity, removeAaaEntity, toggleAaaEntity, getRadiusIncoming, setRadiusIncoming, resetRadiusCounters, getUmSettings, setUmSettings, moduleCatalog, allToolModules, ALWAYS_ON_MODULES, selectToolModules };
25910
+ export { __require, DEFAULT_SNAPSHOT_DB, DEFAULT_CONFIG_HISTORY_DIR, DeviceConfigSchema, ToolFilterSchema, MikrotikConfigSchema, getConfigSource, loadConfig, logger, setConfig, getConfig, listDevices, deviceLabels, resolveDeviceName, deviceDirectory, isMacTelnetDevice, createDeviceClient, describeTransport, isPoolEnabled, closeAll, poolStatus, executeMikrotikCommand, createContext, isEmpty, looksLikeError, commandUnsupported, parseKeyValues, parseRouterosDate, parseSize, parseSystemResource, parseRecords, parseLeadingNumber, REDACTED, redact, configureRecorder, getEventStore, subscribe, subscriberCount, registerTools, fetchDevices, sampleDeviceTraffic, sampleAllTraffic, setDeviceLimits, blockDevice, allowDevice, makeDeviceStatic, setDeviceIp, setDeviceLabel, removeDeviceLease, devicesView, PROMPTS_DIR, UI_DIST_DIR, registerUiResources, backupDir, listBackups, readBackup, writeBackup, deleteBackup, renameBackup, createLocalBackup, restoreLocalBackup, isS3Configured, getS3Client, presignExpiresIn, s3Target, splitCommands, buildChangePlan, renderPlan, diffLines, normalizeExport, openSnapshotStore, DEFAULT_TZSP_PORT, capture2 as capture, AAA_ENTITIES, listAaaEntity, addAaaEntity, updateAaaEntity, removeAaaEntity, toggleAaaEntity, getRadiusIncoming, setRadiusIncoming, resetRadiusCounters, getUmSettings, setUmSettings, moduleCatalog, allToolModules, ALWAYS_ON_MODULES, selectToolModules };
@@ -4,7 +4,7 @@ import {
4
4
  allToolModules,
5
5
  moduleCatalog,
6
6
  selectToolModules
7
- } from "./library-hjde13aa.js";
7
+ } from "./library-nb4wss02.js";
8
8
  export {
9
9
  selectToolModules,
10
10
  moduleCatalog,
@@ -6251,7 +6251,7 @@ var cache = null;
6251
6251
  async function gateway() {
6252
6252
  if (cache)
6253
6253
  return cache;
6254
- const { moduleCatalog } = await import("./library-hjh5hy5d.js");
6254
+ const { moduleCatalog } = await import("./library-98nh7hz6.js");
6255
6255
  const forIndex = [];
6256
6256
  const byName = new Map;
6257
6257
  for (const mod of moduleCatalog) {