@usex/mikrotik-mcp 5.6.0 → 5.7.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/README.md +39 -20
- package/dist/cli.js +48117 -616
- package/dist/index.d.ts +1 -1
- package/dist/index.js +55 -55
- package/dist/shared/cli-569n3azr.js +13 -0
- package/dist/shared/library-3602qc6e.js +11 -0
- package/dist/shared/{cli-gyqfq9j6.js → library-v0tysa18.js} +24044 -23708
- package/dist/ui/aaa.html +39 -54
- package/dist/ui/connected-devices.html +39 -54
- package/dist/ui/dashboard.html +39 -54
- package/dist/ui/firewall-audit.html +39 -54
- package/dist/ui/firewall.html +40 -55
- package/dist/ui/interfaces.html +39 -54
- package/dist/ui/observability.html +62 -62
- package/dist/ui/records.html +40 -55
- package/package.json +19 -18
- package/schemas/README.md +1 -1
- package/schemas/config.schema.json +79 -0
- package/schemas/tool-catalog.json +507 -3
- package/schemas/tools/audit_service_contracts.json +7 -0
- package/schemas/tools/create_investigation.json +42 -0
- package/schemas/tools/create_service_contract.json +53 -0
- package/schemas/tools/get_investigation.json +14 -0
- package/schemas/tools/inspect_flow_path.json +50 -0
- package/schemas/tools/list_client_flow_candidates.json +14 -0
- package/schemas/tools/list_investigations.json +7 -0
- package/schemas/tools/list_service_contracts.json +7 -0
- package/schemas/tools/list_service_probe_targets.json +7 -0
- package/schemas/tools/run_service_contract.json +14 -0
- package/schemas/tools/service_contract_history.json +14 -0
- package/schemas/tools/start_rollout.json +21 -0
- package/schemas/tools/trace_round_trip.json +129 -0
- package/dist/shared/cli-h41j14aw.js +0 -13
- package/dist/shared/library-135yzct0.js +0 -45586
- package/dist/shared/library-v52e871r.js +0 -13
package/dist/index.d.ts
CHANGED
|
@@ -421,4 +421,4 @@ declare function getSafeModeManager(deviceName: string): SafeModeManager;
|
|
|
421
421
|
declare const allToolModules: ToolModule[];
|
|
422
422
|
declare const VERSION: string;
|
|
423
423
|
declare const SERVER_NAME = "mikrotik-mcp";
|
|
424
|
-
export {
|
|
424
|
+
export { DeviceConfig, DeviceConfigSchema, MikroTikSSHClient, MikrotikConfig, MikrotikConfigSchema, RegisterableTool, SERVER_NAME, SafeModeManager, ToolContext, ToolModule, VERSION, allToolModules, createServer, defineTool, executeMikrotikCommand, getConfig, getDevice, getSafeModeManager, listDevices, loadConfig, registerTools, resolveDeviceName, setConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DeviceConfigSchema2,
|
|
4
|
+
MikrotikConfigSchema2,
|
|
5
|
+
loadConfig2,
|
|
6
|
+
logger,
|
|
7
|
+
MikroTikSSHClient2,
|
|
8
|
+
setConfig2,
|
|
9
|
+
getConfig2,
|
|
10
|
+
listDevices2,
|
|
11
|
+
deviceLabels,
|
|
12
|
+
resolveDeviceName2,
|
|
13
|
+
deviceDirectory,
|
|
14
|
+
getDevice2,
|
|
15
|
+
SafeModeManager2,
|
|
16
|
+
getSafeModeManager2,
|
|
17
|
+
executeMikrotikCommand2,
|
|
18
|
+
defineTool2,
|
|
19
|
+
registerTools2,
|
|
7
20
|
PROMPTS_DIR,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
SERVER_TITLE,
|
|
11
|
-
SafeModeManager,
|
|
12
|
-
VERSION,
|
|
21
|
+
registerUiResources,
|
|
22
|
+
VERSION2,
|
|
13
23
|
WEBSITE_URL,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
executeMikrotikCommand,
|
|
19
|
-
getConfig,
|
|
20
|
-
getDevice,
|
|
21
|
-
getSafeModeManager,
|
|
22
|
-
listDevices,
|
|
23
|
-
loadConfig,
|
|
24
|
+
LOGO_URL,
|
|
25
|
+
SERVER_TITLE,
|
|
26
|
+
SERVER_DESCRIPTION,
|
|
27
|
+
SERVER_NAME2,
|
|
24
28
|
loadFileCacheSync,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
selectToolModules,
|
|
30
|
-
setConfig,
|
|
31
|
-
updateSummaryLine
|
|
32
|
-
} from "./shared/library-135yzct0.js";
|
|
29
|
+
updateSummaryLine,
|
|
30
|
+
allToolModules2,
|
|
31
|
+
selectToolModules2
|
|
32
|
+
} from "./shared/library-v0tysa18.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";
|
|
@@ -231,13 +231,13 @@ task so context is never lost between conversations:
|
|
|
231
231
|
3. Prefer specific, reusable facts over transient state. Skip one-off command
|
|
232
232
|
output; record what will still be true next session.`;
|
|
233
233
|
function createServer(opts = {}) {
|
|
234
|
-
process.title = `Mikrotik MCP Server v${
|
|
235
|
-
const { names, default: defaultDevice } =
|
|
236
|
-
const readOnly =
|
|
234
|
+
process.title = `Mikrotik MCP Server v${VERSION2}`;
|
|
235
|
+
const { names, default: defaultDevice } = listDevices2();
|
|
236
|
+
const readOnly = getConfig2().readOnly;
|
|
237
237
|
let instructions = names.length > 1 ? INSTRUCTIONS + MULTI_DEVICE_INSTRUCTIONS.replace("{{names}}", names.join(", ")).replace("{{default}}", defaultDevice) : INSTRUCTIONS;
|
|
238
|
-
if (
|
|
238
|
+
if (getConfig2().memory.enabled)
|
|
239
239
|
instructions += MEMORY_INSTRUCTIONS;
|
|
240
|
-
if (!
|
|
240
|
+
if (!getConfig2().disableUpdateCheck) {
|
|
241
241
|
const cached = loadFileCacheSync();
|
|
242
242
|
if (cached) {
|
|
243
243
|
const note = updateSummaryLine(cached);
|
|
@@ -248,8 +248,8 @@ ${note}`;
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
const server = new McpServer({
|
|
251
|
-
name:
|
|
252
|
-
version:
|
|
251
|
+
name: SERVER_NAME2,
|
|
252
|
+
version: VERSION2,
|
|
253
253
|
websiteUrl: WEBSITE_URL,
|
|
254
254
|
title: SERVER_TITLE,
|
|
255
255
|
description: SERVER_DESCRIPTION,
|
|
@@ -270,13 +270,13 @@ ${note}`;
|
|
|
270
270
|
server.server.sendLoggingMessage({ level, data: message }).catch(() => {});
|
|
271
271
|
} catch {}
|
|
272
272
|
});
|
|
273
|
-
const toolModules =
|
|
274
|
-
const toolCount =
|
|
273
|
+
const toolModules = selectToolModules2(getConfig2().tools);
|
|
274
|
+
const toolCount = registerTools2(server, toolModules, {
|
|
275
275
|
sendLog,
|
|
276
276
|
deviceNames: names,
|
|
277
277
|
deviceAliases: deviceLabels(),
|
|
278
278
|
deviceDirectory: deviceDirectory(),
|
|
279
|
-
appViews:
|
|
279
|
+
appViews: getConfig2().mcp.appViews,
|
|
280
280
|
readOnly
|
|
281
281
|
});
|
|
282
282
|
const promptCount = registerPrompts(server, {
|
|
@@ -285,7 +285,7 @@ ${note}`;
|
|
|
285
285
|
deviceDirectory: deviceDirectory()
|
|
286
286
|
});
|
|
287
287
|
const uiViewCount = registerUiResources(server);
|
|
288
|
-
installToolPagination(server,
|
|
288
|
+
installToolPagination(server, getConfig2().mcp.toolPageSize);
|
|
289
289
|
return { server, toolCount, promptCount, uiViewCount, readOnly };
|
|
290
290
|
}
|
|
291
291
|
function installToolPagination(server, pageSize) {
|
|
@@ -312,22 +312,22 @@ function installToolPagination(server, pageSize) {
|
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
export {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
getConfig,
|
|
323
|
-
executeMikrotikCommand,
|
|
324
|
-
defineTool,
|
|
315
|
+
DeviceConfigSchema2 as DeviceConfigSchema,
|
|
316
|
+
MikroTikSSHClient2 as MikroTikSSHClient,
|
|
317
|
+
MikrotikConfigSchema2 as MikrotikConfigSchema,
|
|
318
|
+
SERVER_NAME2 as SERVER_NAME,
|
|
319
|
+
SafeModeManager2 as SafeModeManager,
|
|
320
|
+
VERSION2 as VERSION,
|
|
321
|
+
allToolModules2 as allToolModules,
|
|
325
322
|
createServer,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
323
|
+
defineTool2 as defineTool,
|
|
324
|
+
executeMikrotikCommand2 as executeMikrotikCommand,
|
|
325
|
+
getConfig2 as getConfig,
|
|
326
|
+
getDevice2 as getDevice,
|
|
327
|
+
getSafeModeManager2 as getSafeModeManager,
|
|
328
|
+
listDevices2 as listDevices,
|
|
329
|
+
loadConfig2 as loadConfig,
|
|
330
|
+
registerTools2 as registerTools,
|
|
331
|
+
resolveDeviceName2 as resolveDeviceName,
|
|
332
|
+
setConfig2 as setConfig
|
|
333
333
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
moduleCatalog2,
|
|
4
|
+
allToolModules2,
|
|
5
|
+
ALWAYS_ON_MODULES2,
|
|
6
|
+
selectToolModules2
|
|
7
|
+
} from "../cli.js";
|
|
8
|
+
export {
|
|
9
|
+
ALWAYS_ON_MODULES2 as ALWAYS_ON_MODULES,
|
|
10
|
+
allToolModules2 as allToolModules,
|
|
11
|
+
moduleCatalog2 as moduleCatalog,
|
|
12
|
+
selectToolModules2 as selectToolModules
|
|
13
|
+
};
|