@usex/mikrotik-mcp 6.8.0 → 6.9.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-qszw8tv2.js → cli-0ckmf678.js} +1 -1
- package/dist/shared/{cli-ksq2qr7d.js → cli-7en5gay6.js} +1 -1
- package/dist/shared/{cli-4a4dxv04.js → cli-amd43kc5.js} +1 -1
- package/dist/shared/{cli-pan4hpjf.js → cli-fb8k4p45.js} +1 -1
- package/dist/shared/{cli-mh3kf1gx.js → cli-v5tym2a3.js} +91 -17
- package/dist/shared/{library-qwkp17zf.js → library-3hjxj4ph.js} +91 -17
- package/dist/shared/{library-g8fvds7b.js → library-5mbnzvye.js} +1 -1
- package/dist/shared/{library-qdh9kmg5.js → library-8fxp8mc8.js} +1 -1
- package/dist/shared/{library-r8m6ftrj.js → library-j1ptdg4x.js} +1 -1
- package/dist/shared/{library-5ejy1n1c.js → library-znv72s94.js} +1 -1
- package/package.json +1 -1
- package/schemas/README.md +1 -1
- package/schemas/devtools-manifest.json +23 -1
- package/schemas/tool-catalog.json +148 -5
- package/schemas/tools/add_bridge_port.json +4 -0
- package/schemas/tools/add_dot1x_server.json +4 -0
- package/schemas/tools/add_wireguard_peer.json +6 -0
- package/schemas/tools/create_bridge.json +21 -0
- package/schemas/tools/create_dhcp_server.json +4 -0
- package/schemas/tools/create_ipv6_dhcp_server.json +8 -0
- package/schemas/tools/create_vlan_interface.json +4 -0
- package/schemas/tools/list_bgp_instances.json +7 -0
- package/schemas/tools/update_bgp_instance_med_comparison.json +22 -0
- package/schemas/tools/update_bridge.json +21 -0
- package/schemas/tools/update_dot1x_server.json +4 -0
- package/schemas/tools/update_vlan_interface.json +4 -0
- package/schemas/tools/update_wireguard_peer.json +17 -3
|
@@ -15606,13 +15606,13 @@ async function undoMigration(id, confirm, selected) {
|
|
|
15606
15606
|
throw new Error("Undo lost Safe Mode or exceeded its time budget.");
|
|
15607
15607
|
await checkedRead(item.undo, createContext(undefined, device));
|
|
15608
15608
|
}
|
|
15609
|
-
const beforeTarget = (await import("./library-
|
|
15610
|
-
const db = await beforeTarget((await import("./library-
|
|
15609
|
+
const beforeTarget = (await import("./library-5mbnzvye.js")).openSnapshotStore;
|
|
15610
|
+
const db = await beforeTarget((await import("./library-8fxp8mc8.js")).DEFAULT_SNAPSHOT_DB);
|
|
15611
15611
|
try {
|
|
15612
15612
|
const original = db.get(p.snapshots.target);
|
|
15613
15613
|
if (!original)
|
|
15614
15614
|
throw new Error("Original target snapshot unavailable.");
|
|
15615
|
-
const { normalizeExport } = await import("./library-
|
|
15615
|
+
const { normalizeExport } = await import("./library-znv72s94.js");
|
|
15616
15616
|
if (normalizeExport((await migrationInventory(device)).export) !== normalizeExport(original.body))
|
|
15617
15617
|
throw new Error("Target differs from its backup. Undo verification failed.");
|
|
15618
15618
|
} finally {
|
|
@@ -23757,6 +23757,11 @@ var bridgeTools = [
|
|
|
23757
23757
|
frame_types: FrameTypes.optional().describe("Default accepted frame types for ports"),
|
|
23758
23758
|
ingress_filtering: boolean().optional().describe("Default ingress VLAN filtering for ports"),
|
|
23759
23759
|
dhcp_snooping: boolean().optional().describe("Enable DHCP snooping"),
|
|
23760
|
+
arp_inspection: boolean().optional().describe("RouterOS 7.25+ validate ARP against DHCP snooping bindings"),
|
|
23761
|
+
ip_source_guard: boolean().optional().describe("RouterOS 7.25+ validate IPv4 source against DHCP snooping bindings"),
|
|
23762
|
+
mlag_init_delay: string().optional().describe("RouterOS 7.25+ MLAG LACP initialization delay"),
|
|
23763
|
+
mlag_lacp_fallback: boolean().optional().describe("RouterOS 7.25+ MLAG LACP fallback after peer loss"),
|
|
23764
|
+
confirm_security_disruption: literal(true).optional().describe("Required when enabling ARP inspection or IP source guard; DHCP bindings may be cleared and traffic interrupted"),
|
|
23760
23765
|
igmp_snooping: boolean().optional().describe("Enable IGMP/MLD snooping"),
|
|
23761
23766
|
fast_forward: boolean().optional().describe("Enable Fast Forward optimization"),
|
|
23762
23767
|
mvrp: boolean().optional().describe("Enable Multiple VLAN Registration Protocol"),
|
|
@@ -23765,8 +23770,10 @@ var bridgeTools = [
|
|
|
23765
23770
|
transmit_hold_count: number().int().optional().describe("STP transmit hold count")
|
|
23766
23771
|
},
|
|
23767
23772
|
async handler(a, ctx) {
|
|
23773
|
+
if ((a.arp_inspection || a.ip_source_guard) && !a.confirm_security_disruption)
|
|
23774
|
+
return "Enabling ARP inspection or IP source guard can clear DHCP bindings and interrupt clients. Review DHCP snooping and trusted ports, then set confirm_security_disruption=true.";
|
|
23768
23775
|
ctx.info(`Creating bridge: name=${a.name}, vlan_filtering=${a.vlan_filtering}`);
|
|
23769
|
-
const cmd = new Cmd("/interface bridge add").set("name", a.name).opt("comment", a.comment).flag("vlan-filtering", a.vlan_filtering).opt("protocol-mode", a.protocol_mode).opt("mtu", a.mtu).opt("ageing-time", a.ageing_time).opt("arp", a.arp).opt("arp-timeout", a.arp_timeout).bool("auto-mac", a.auto_mac).opt("admin-mac", a.admin_mac).opt("priority", a.priority).opt("ether-type", a.ether_type).opt("pvid", a.pvid).opt("frame-types", a.frame_types).bool("ingress-filtering", a.ingress_filtering).bool("dhcp-snooping", a.dhcp_snooping).bool("igmp-snooping", a.igmp_snooping).bool("fast-forward", a.fast_forward).bool("mvrp", a.mvrp).opt("forward-delay", a.forward_delay).opt("max-message-age", a.max_message_age).opt("transmit-hold-count", a.transmit_hold_count).flag("disabled", a.disabled).build();
|
|
23776
|
+
const cmd = new Cmd("/interface bridge add").set("name", a.name).opt("comment", a.comment).flag("vlan-filtering", a.vlan_filtering).opt("protocol-mode", a.protocol_mode).opt("mtu", a.mtu).opt("ageing-time", a.ageing_time).opt("arp", a.arp).opt("arp-timeout", a.arp_timeout).bool("auto-mac", a.auto_mac).opt("admin-mac", a.admin_mac).opt("priority", a.priority).opt("ether-type", a.ether_type).opt("pvid", a.pvid).opt("frame-types", a.frame_types).bool("ingress-filtering", a.ingress_filtering).bool("dhcp-snooping", a.dhcp_snooping).bool("arp-inspection", a.arp_inspection).bool("ip-source-guard", a.ip_source_guard).opt("mlag-init-delay", a.mlag_init_delay).bool("mlag-lacp-fallback", a.mlag_lacp_fallback).bool("igmp-snooping", a.igmp_snooping).bool("fast-forward", a.fast_forward).bool("mvrp", a.mvrp).opt("forward-delay", a.forward_delay).opt("max-message-age", a.max_message_age).opt("transmit-hold-count", a.transmit_hold_count).flag("disabled", a.disabled).build();
|
|
23770
23777
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
23771
23778
|
if (looksLikeError(result))
|
|
23772
23779
|
return `Failed to create bridge: ${result}`;
|
|
@@ -23833,6 +23840,11 @@ ${result}`;
|
|
|
23833
23840
|
frame_types: FrameTypes.optional().describe("Default accepted frame types for ports"),
|
|
23834
23841
|
ingress_filtering: boolean().optional().describe("Default ingress VLAN filtering for ports"),
|
|
23835
23842
|
dhcp_snooping: boolean().optional().describe("Enable DHCP snooping"),
|
|
23843
|
+
arp_inspection: boolean().optional().describe("RouterOS 7.25+ validate ARP against DHCP snooping bindings"),
|
|
23844
|
+
ip_source_guard: boolean().optional().describe("RouterOS 7.25+ validate IPv4 source against DHCP snooping bindings"),
|
|
23845
|
+
mlag_init_delay: string().optional().describe("RouterOS 7.25+ MLAG LACP initialization delay"),
|
|
23846
|
+
mlag_lacp_fallback: boolean().optional().describe("RouterOS 7.25+ MLAG LACP fallback after peer loss"),
|
|
23847
|
+
confirm_security_disruption: literal(true).optional().describe("Required when enabling ARP inspection or IP source guard; DHCP bindings may be cleared and traffic interrupted"),
|
|
23836
23848
|
igmp_snooping: boolean().optional().describe("Enable IGMP/MLD snooping"),
|
|
23837
23849
|
fast_forward: boolean().optional().describe("Enable Fast Forward optimization"),
|
|
23838
23850
|
mvrp: boolean().optional().describe("Enable Multiple VLAN Registration Protocol"),
|
|
@@ -23841,15 +23853,17 @@ ${result}`;
|
|
|
23841
23853
|
transmit_hold_count: number().int().optional().describe("STP transmit hold count")
|
|
23842
23854
|
},
|
|
23843
23855
|
async handler(a, ctx) {
|
|
23856
|
+
if ((a.arp_inspection || a.ip_source_guard) && !a.confirm_security_disruption)
|
|
23857
|
+
return "Enabling ARP inspection or IP source guard can clear DHCP bindings and interrupt clients. Review DHCP snooping and trusted ports, then set confirm_security_disruption=true.";
|
|
23844
23858
|
ctx.info(`Updating bridge: name=${a.name}`);
|
|
23845
|
-
const cmd = new Cmd(`/interface bridge set [find name
|
|
23859
|
+
const cmd = new Cmd(`/interface bridge set [find name=${quoteValue(a.name)}]`).opt("name", a.new_name).opt("comment", a.comment).bool("vlan-filtering", a.vlan_filtering).opt("protocol-mode", a.protocol_mode).bool("disabled", a.disabled).opt("mtu", a.mtu).opt("ageing-time", a.ageing_time).opt("arp", a.arp).opt("arp-timeout", a.arp_timeout).bool("auto-mac", a.auto_mac).opt("admin-mac", a.admin_mac).opt("priority", a.priority).opt("ether-type", a.ether_type).opt("pvid", a.pvid).opt("frame-types", a.frame_types).bool("ingress-filtering", a.ingress_filtering).bool("dhcp-snooping", a.dhcp_snooping).bool("arp-inspection", a.arp_inspection).bool("ip-source-guard", a.ip_source_guard).opt("mlag-init-delay", a.mlag_init_delay).bool("mlag-lacp-fallback", a.mlag_lacp_fallback).bool("igmp-snooping", a.igmp_snooping).bool("fast-forward", a.fast_forward).bool("mvrp", a.mvrp).opt("forward-delay", a.forward_delay).opt("max-message-age", a.max_message_age).opt("transmit-hold-count", a.transmit_hold_count).build();
|
|
23846
23860
|
if (!cmd.includes("=", cmd.indexOf("]")))
|
|
23847
23861
|
return "No updates specified.";
|
|
23848
23862
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
23849
23863
|
if (looksLikeError(result))
|
|
23850
23864
|
return `Failed to update bridge: ${result}`;
|
|
23851
23865
|
const target = a.new_name ?? a.name;
|
|
23852
|
-
const details = await executeMikrotikCommand2(
|
|
23866
|
+
const details = await executeMikrotikCommand2(new Cmd("/interface bridge print detail where").set("name", target).build(), ctx);
|
|
23853
23867
|
return `Bridge updated successfully:
|
|
23854
23868
|
|
|
23855
23869
|
${details}`;
|
|
@@ -23899,6 +23913,7 @@ ${details}`;
|
|
|
23899
23913
|
restricted_role: boolean().optional().describe("Exclude port from becoming the root port"),
|
|
23900
23914
|
restricted_tcn: boolean().optional().describe("Block topology change notifications from this port"),
|
|
23901
23915
|
trusted: boolean().optional().describe("Trust DHCP server replies on this port (DHCP snooping)"),
|
|
23916
|
+
trusted_arp: boolean().optional().describe("RouterOS 7.25+ exempt this port from ARP inspection"),
|
|
23902
23917
|
multicast_router: MulticastRouter.optional().describe("IGMP-snooping multicast router state"),
|
|
23903
23918
|
fast_leave: boolean().optional().describe("IGMP-snooping fast leave"),
|
|
23904
23919
|
unknown_unicast_flood: boolean().optional().describe("Flood unknown-unicast frames to this port"),
|
|
@@ -23907,7 +23922,7 @@ ${details}`;
|
|
|
23907
23922
|
},
|
|
23908
23923
|
async handler(a, ctx) {
|
|
23909
23924
|
ctx.info(`Adding bridge port: bridge=${a.bridge}, interface=${a.interface}`);
|
|
23910
|
-
const cmd = new Cmd("/interface bridge port add").set("bridge", a.bridge).set("interface", a.interface).opt("pvid", a.pvid).opt("comment", a.comment).bool("hw", a.hw).bool("disabled", a.disabled).opt("frame-types", a.frame_types).bool("ingress-filtering", a.ingress_filtering).bool("tag-stacking", a.tag_stacking).opt("priority", a.priority).opt("path-cost", a.path_cost).opt("internal-path-cost", a.internal_path_cost).opt("horizon", a.horizon).opt("learn", a.learn).opt("edge", a.edge).opt("point-to-point", a.point_to_point).bool("auto-isolate", a.auto_isolate).bool("bpdu-guard", a.bpdu_guard).bool("restricted-role", a.restricted_role).bool("restricted-tcn", a.restricted_tcn).bool("trusted", a.trusted).opt("multicast-router", a.multicast_router).bool("fast-leave", a.fast_leave).bool("unknown-unicast-flood", a.unknown_unicast_flood).bool("unknown-multicast-flood", a.unknown_multicast_flood).bool("broadcast-flood", a.broadcast_flood).build();
|
|
23925
|
+
const cmd = new Cmd("/interface bridge port add").set("bridge", a.bridge).set("interface", a.interface).opt("pvid", a.pvid).opt("comment", a.comment).bool("hw", a.hw).bool("disabled", a.disabled).opt("frame-types", a.frame_types).bool("ingress-filtering", a.ingress_filtering).bool("tag-stacking", a.tag_stacking).opt("priority", a.priority).opt("path-cost", a.path_cost).opt("internal-path-cost", a.internal_path_cost).opt("horizon", a.horizon).opt("learn", a.learn).opt("edge", a.edge).opt("point-to-point", a.point_to_point).bool("auto-isolate", a.auto_isolate).bool("bpdu-guard", a.bpdu_guard).bool("restricted-role", a.restricted_role).bool("restricted-tcn", a.restricted_tcn).bool("trusted", a.trusted).bool("trusted-arp", a.trusted_arp).opt("multicast-router", a.multicast_router).bool("fast-leave", a.fast_leave).bool("unknown-unicast-flood", a.unknown_unicast_flood).bool("unknown-multicast-flood", a.unknown_multicast_flood).bool("broadcast-flood", a.broadcast_flood).build();
|
|
23911
23926
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
23912
23927
|
if (looksLikeError(result))
|
|
23913
23928
|
return `Failed to add bridge port: ${result}`;
|
|
@@ -26550,6 +26565,7 @@ var dhcpTools = [
|
|
|
26550
26565
|
delay_threshold: string().optional(),
|
|
26551
26566
|
add_arp: boolean().optional().describe("Add dynamic ARP entry for each lease (use with reply-only ARP on the interface)"),
|
|
26552
26567
|
always_broadcast: boolean().optional().describe("Always send replies as broadcast"),
|
|
26568
|
+
ipv6_only_preferred: boolean().optional().describe("RouterOS 7.25+ advertise DHCP option 108 for IPv6-only preferred clients"),
|
|
26553
26569
|
bootp_support: _enum(["none", "static", "dynamic"]).optional().describe("Which BOOTP requests to answer"),
|
|
26554
26570
|
conflict_detection: boolean().optional().describe("Ping/ARP-probe an address before offering it to detect conflicts"),
|
|
26555
26571
|
use_radius: _enum(["yes", "no", "accounting"]).optional().describe("Use RADIUS for leases (accounting = RADIUS accounting only)"),
|
|
@@ -26560,7 +26576,7 @@ var dhcpTools = [
|
|
|
26560
26576
|
},
|
|
26561
26577
|
async handler(a, ctx) {
|
|
26562
26578
|
ctx.info(`Creating DHCP server: name=${a.name}, interface=${a.interface}`);
|
|
26563
|
-
const cmd = new Cmd("/ip dhcp-server add").set("name", a.name).set("interface", a.interface).set("lease-time", a.lease_time).opt("address-pool", a.address_pool).flag("disabled", a.disabled).raw(a.authoritative !== "yes" ? `authoritative=${a.authoritative}` : null).opt("delay-threshold", a.delay_threshold).bool("add-arp", a.add_arp).bool("always-broadcast", a.always_broadcast).opt("bootp-support", a.bootp_support).bool("conflict-detection", a.conflict_detection).opt("use-radius", a.use_radius).opt("relay", a.relay).opt("server-address", a.server_address).opt("lease-script", a.lease_script).opt("comment", a.comment).build();
|
|
26579
|
+
const cmd = new Cmd("/ip dhcp-server add").set("name", a.name).set("interface", a.interface).set("lease-time", a.lease_time).opt("address-pool", a.address_pool).flag("disabled", a.disabled).raw(a.authoritative !== "yes" ? `authoritative=${a.authoritative}` : null).opt("delay-threshold", a.delay_threshold).bool("add-arp", a.add_arp).bool("always-broadcast", a.always_broadcast).bool("ipv6-only-preferred", a.ipv6_only_preferred).opt("bootp-support", a.bootp_support).bool("conflict-detection", a.conflict_detection).opt("use-radius", a.use_radius).opt("relay", a.relay).opt("server-address", a.server_address).opt("lease-script", a.lease_script).opt("comment", a.comment).build();
|
|
26564
26580
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
26565
26581
|
if (looksLikeError(result))
|
|
26566
26582
|
return `Failed to create DHCP server: ${result}`;
|
|
@@ -28141,7 +28157,7 @@ var cache3 = null;
|
|
|
28141
28157
|
async function gateway() {
|
|
28142
28158
|
if (cache3)
|
|
28143
28159
|
return cache3;
|
|
28144
|
-
const { moduleCatalog } = await import("./library-
|
|
28160
|
+
const { moduleCatalog } = await import("./library-j1ptdg4x.js");
|
|
28145
28161
|
const forIndex = [];
|
|
28146
28162
|
const byName = new Map;
|
|
28147
28163
|
for (const mod of moduleCatalog) {
|
|
@@ -28863,12 +28879,15 @@ var dot1xServerTools = [
|
|
|
28863
28879
|
reject_vlan_id: string().optional().describe("VLAN id or 'none'"),
|
|
28864
28880
|
server_fail_vlan_id: string().optional().describe("VLAN id or 'none'"),
|
|
28865
28881
|
reauth_timeout: string().optional().describe("Re-auth period or 'none'"),
|
|
28882
|
+
reauth_period: string().optional().describe("RouterOS 7.25+ re-authentication period"),
|
|
28866
28883
|
comment: string().optional(),
|
|
28867
28884
|
disabled: boolean().default(false)
|
|
28868
28885
|
},
|
|
28869
28886
|
async handler(a, ctx) {
|
|
28887
|
+
if (a.reauth_period !== undefined && a.reauth_timeout !== undefined)
|
|
28888
|
+
return "Specify either reauth_period (RouterOS 7.25+) or reauth_timeout (older RouterOS), not both.";
|
|
28870
28889
|
ctx.info(`Adding dot1x server: interface=${a.interface}`);
|
|
28871
|
-
const cmd = new Cmd("/interface dot1x server add").set("interface", a.interface).opt("auth-types", a.auth_types).bool("accounting", a.accounting).opt("interim-update", a.interim_update).opt("mac-auth-mode", a.mac_auth_mode).opt("guest-vlan-id", a.guest_vlan_id).opt("reject-vlan-id", a.reject_vlan_id).opt("server-fail-vlan-id", a.server_fail_vlan_id).opt("reauth-timeout", a.reauth_timeout).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
28890
|
+
const cmd = new Cmd("/interface dot1x server add").set("interface", a.interface).opt("auth-types", a.auth_types).bool("accounting", a.accounting).opt("interim-update", a.interim_update).opt("mac-auth-mode", a.mac_auth_mode).opt("guest-vlan-id", a.guest_vlan_id).opt("reject-vlan-id", a.reject_vlan_id).opt("server-fail-vlan-id", a.server_fail_vlan_id).opt("reauth-timeout", a.reauth_timeout).opt("reauth-period", a.reauth_period).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
28872
28891
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
28873
28892
|
if (looksLikeError(result))
|
|
28874
28893
|
return `Failed to add dot1x server: ${result}`;
|
|
@@ -28934,14 +28953,18 @@ ${result}`;
|
|
|
28934
28953
|
reject_vlan_id: string().optional(),
|
|
28935
28954
|
server_fail_vlan_id: string().optional(),
|
|
28936
28955
|
reauth_timeout: string().optional(),
|
|
28956
|
+
reauth_period: string().optional().describe("RouterOS 7.25+ re-authentication period"),
|
|
28937
28957
|
comment: string().optional(),
|
|
28938
28958
|
disabled: boolean().optional()
|
|
28939
28959
|
},
|
|
28940
28960
|
async handler(a, ctx) {
|
|
28961
|
+
if (a.reauth_period !== undefined && a.reauth_timeout !== undefined)
|
|
28962
|
+
return "Specify either reauth_period (RouterOS 7.25+) or reauth_timeout (older RouterOS), not both.";
|
|
28941
28963
|
ctx.info(`Updating dot1x server: server_id=${a.server_id}`);
|
|
28942
28964
|
const selector = a.server_id.startsWith("*") ? `.id="${a.server_id}"` : `interface="${a.server_id}"`;
|
|
28943
28965
|
const base = `/interface dot1x server set [find ${selector}]`;
|
|
28944
28966
|
const cmd = new Cmd(base).opt("auth-types", a.auth_types).bool("accounting", a.accounting).opt("interim-update", a.interim_update).opt("mac-auth-mode", a.mac_auth_mode).opt("guest-vlan-id", a.guest_vlan_id).opt("reject-vlan-id", a.reject_vlan_id).opt("server-fail-vlan-id", a.server_fail_vlan_id).opt("reauth-timeout", a.reauth_timeout);
|
|
28967
|
+
cmd.opt("reauth-period", a.reauth_period);
|
|
28945
28968
|
if (a.comment !== undefined)
|
|
28946
28969
|
cmd.raw(`comment=${quoteValue(a.comment)}`);
|
|
28947
28970
|
if (a.disabled !== undefined)
|
|
@@ -35618,6 +35641,8 @@ var ipv6DhcpServerTools = [
|
|
|
35618
35641
|
lease_time: string().default("3d").describe("Lease duration e.g. '1d', '12h', '30m'"),
|
|
35619
35642
|
binding_script: string().optional(),
|
|
35620
35643
|
rapid_commit: boolean().optional(),
|
|
35644
|
+
add_dns_entries: boolean().optional().describe("RouterOS 7.25+ create AAAA DNS entries for client FQDNs"),
|
|
35645
|
+
add_dns_entries_suffix: string().optional().describe("Suffix for dynamically created DHCPv6 DNS entries"),
|
|
35621
35646
|
preference: number().int().min(0).max(255).optional(),
|
|
35622
35647
|
route_distance: number().int().optional(),
|
|
35623
35648
|
use_radius: boolean().optional().describe("Authenticate clients via RADIUS"),
|
|
@@ -35629,7 +35654,7 @@ var ipv6DhcpServerTools = [
|
|
|
35629
35654
|
},
|
|
35630
35655
|
async handler(a, ctx) {
|
|
35631
35656
|
ctx.info(`Creating DHCPv6 server: name=${a.name}, interface=${a.interface}`);
|
|
35632
|
-
const cmd = new Cmd("/ipv6 dhcp-server add").set("name", a.name).set("interface", a.interface).set("address-pool", a.address_pool).set("lease-time", a.lease_time).opt("binding-script", a.binding_script).bool("rapid-commit", a.rapid_commit).opt("preference", a.preference).opt("route-distance", a.route_distance).bool("use-radius", a.use_radius).bool("allow-dual-stack-queue", a.allow_dual_stack_queue).opt("parent-queue", a.parent_queue).opt("dhcp-option", a.dhcp_option?.length ? a.dhcp_option.join(",") : undefined).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
35657
|
+
const cmd = new Cmd("/ipv6 dhcp-server add").set("name", a.name).set("interface", a.interface).set("address-pool", a.address_pool).set("lease-time", a.lease_time).opt("binding-script", a.binding_script).bool("rapid-commit", a.rapid_commit).bool("add-dns-entries", a.add_dns_entries).opt("add-dns-entries-suffix", a.add_dns_entries_suffix).opt("preference", a.preference).opt("route-distance", a.route_distance).bool("use-radius", a.use_radius).bool("allow-dual-stack-queue", a.allow_dual_stack_queue).opt("parent-queue", a.parent_queue).opt("dhcp-option", a.dhcp_option?.length ? a.dhcp_option.join(",") : undefined).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
35633
35658
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
35634
35659
|
if (looksLikeError(result))
|
|
35635
35660
|
return `Failed to create DHCPv6 server: ${result}`;
|
|
@@ -48508,6 +48533,51 @@ ${result}`;
|
|
|
48508
48533
|
// src/tools/routing-bgp.ts
|
|
48509
48534
|
var UNSUPPORTED2 = "BGP is not available on this device (requires RouterOS v7 with the routing package).";
|
|
48510
48535
|
var routingBgpTools = [
|
|
48536
|
+
defineTool2({
|
|
48537
|
+
name: "list_bgp_instances",
|
|
48538
|
+
title: "List BGP Instances",
|
|
48539
|
+
annotations: READ,
|
|
48540
|
+
description: "Read BGP instances and their best-path selection settings, including RouterOS 7.25+ always-compare-med. Use before changing an instance.",
|
|
48541
|
+
async handler(_a, ctx) {
|
|
48542
|
+
const result = await executeMikrotikCommand2("/routing bgp instance print detail", ctx);
|
|
48543
|
+
if (commandUnsupported(result))
|
|
48544
|
+
return UNSUPPORTED2;
|
|
48545
|
+
return isEmpty(result) ? "No BGP instances found." : `BGP INSTANCES:
|
|
48546
|
+
|
|
48547
|
+
${result}`;
|
|
48548
|
+
}
|
|
48549
|
+
}),
|
|
48550
|
+
defineTool2({
|
|
48551
|
+
name: "update_bgp_instance_med_comparison",
|
|
48552
|
+
title: "Set BGP Instance MED Comparison",
|
|
48553
|
+
annotations: WRITE_IDEMPOTENT,
|
|
48554
|
+
description: "Set RouterOS 7.25+ always-compare-med on one named BGP instance. This changes best-path selection and can reroute traffic; inspect list_bgp_instances and obtain operator approval first.",
|
|
48555
|
+
inputSchema: {
|
|
48556
|
+
name: string().min(1).describe("Exact BGP instance name"),
|
|
48557
|
+
always_compare_med: boolean(),
|
|
48558
|
+
confirm_routing_change: literal(true).describe("Operator approved the best-path behavior change")
|
|
48559
|
+
},
|
|
48560
|
+
async handler(a, ctx) {
|
|
48561
|
+
const selector = new Cmd("/routing bgp instance print count-only where").set("name", a.name).build();
|
|
48562
|
+
const count = await executeMikrotikCommand2(selector, ctx);
|
|
48563
|
+
if (commandUnsupported(count))
|
|
48564
|
+
return UNSUPPORTED2;
|
|
48565
|
+
if (looksLikeError(count))
|
|
48566
|
+
return `Failed to inspect BGP instance: ${count}`;
|
|
48567
|
+
if (isEmpty(count) || count.trim() === "0")
|
|
48568
|
+
return `BGP instance '${a.name}' not found.`;
|
|
48569
|
+
const cmd = new Cmd(`/routing bgp instance set [find name=${quoteValue(a.name)}]`).bool("always-compare-med", a.always_compare_med).build();
|
|
48570
|
+
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
48571
|
+
if (looksLikeError(result))
|
|
48572
|
+
return `Failed to update BGP instance: ${result}`;
|
|
48573
|
+
const details = await executeMikrotikCommand2(new Cmd("/routing bgp instance print detail where").set("name", a.name).build(), ctx);
|
|
48574
|
+
if (looksLikeError(details) || isEmpty(details))
|
|
48575
|
+
return `BGP instance update was sent, but read-back failed: ${details || "no details returned"}`;
|
|
48576
|
+
return `BGP instance '${a.name}' MED comparison updated:
|
|
48577
|
+
|
|
48578
|
+
${details}`;
|
|
48579
|
+
}
|
|
48580
|
+
}),
|
|
48511
48581
|
defineTool2({
|
|
48512
48582
|
name: "list_bgp_connections",
|
|
48513
48583
|
title: "List BGP Connections",
|
|
@@ -53317,7 +53387,7 @@ var riskByTool = null;
|
|
|
53317
53387
|
async function riskIndex() {
|
|
53318
53388
|
if (riskByTool)
|
|
53319
53389
|
return riskByTool;
|
|
53320
|
-
const { moduleCatalog } = await import("./library-
|
|
53390
|
+
const { moduleCatalog } = await import("./library-j1ptdg4x.js");
|
|
53321
53391
|
const index = new Map;
|
|
53322
53392
|
for (const mod of moduleCatalog) {
|
|
53323
53393
|
for (const tool of mod.tools)
|
|
@@ -60190,6 +60260,7 @@ var vlanTools = [
|
|
|
60190
60260
|
comment: string().optional(),
|
|
60191
60261
|
disabled: boolean().default(false),
|
|
60192
60262
|
mtu: number().int().optional(),
|
|
60263
|
+
forced_mac_address: string().optional().describe("RouterOS 7.25+ forced VLAN interface MAC address"),
|
|
60193
60264
|
use_service_tag: boolean().default(false).describe("Use 802.1ad service tag (QinQ)"),
|
|
60194
60265
|
arp: ArpMode2.default("enabled"),
|
|
60195
60266
|
arp_timeout: string().optional(),
|
|
@@ -60199,7 +60270,7 @@ var vlanTools = [
|
|
|
60199
60270
|
},
|
|
60200
60271
|
async handler(a, ctx) {
|
|
60201
60272
|
ctx.info(`Creating VLAN interface: name=${a.name}, vlan_id=${a.vlan_id}, interface=${a.interface}`);
|
|
60202
|
-
const cmd = new Cmd("/interface vlan add").set("name", a.name).set("vlan-id", a.vlan_id).set("interface", a.interface).opt("comment", a.comment).flag("disabled", a.disabled).opt("mtu", a.mtu).flag("use-service-tag", a.use_service_tag).raw(a.arp !== "enabled" ? `arp=${a.arp}` : null).opt("arp-timeout", a.arp_timeout).opt("loop-protect", a.loop_protect).opt("loop-protect-disable-time", a.loop_protect_disable_time).opt("loop-protect-send-interval", a.loop_protect_send_interval).build();
|
|
60273
|
+
const cmd = new Cmd("/interface vlan add").set("name", a.name).set("vlan-id", a.vlan_id).set("interface", a.interface).opt("comment", a.comment).flag("disabled", a.disabled).opt("mtu", a.mtu).opt("forced-mac-address", a.forced_mac_address).flag("use-service-tag", a.use_service_tag).raw(a.arp !== "enabled" ? `arp=${a.arp}` : null).opt("arp-timeout", a.arp_timeout).opt("loop-protect", a.loop_protect).opt("loop-protect-disable-time", a.loop_protect_disable_time).opt("loop-protect-send-interval", a.loop_protect_send_interval).build();
|
|
60203
60274
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
60204
60275
|
if (looksLikeError(result))
|
|
60205
60276
|
return `Failed to create VLAN interface: ${result}`;
|
|
@@ -60264,6 +60335,7 @@ ${result}`;
|
|
|
60264
60335
|
comment: string().optional(),
|
|
60265
60336
|
disabled: boolean().optional(),
|
|
60266
60337
|
mtu: number().int().optional(),
|
|
60338
|
+
forced_mac_address: string().optional().describe("RouterOS 7.25+ forced VLAN interface MAC address"),
|
|
60267
60339
|
use_service_tag: boolean().optional(),
|
|
60268
60340
|
arp: ArpMode2.optional(),
|
|
60269
60341
|
arp_timeout: string().optional(),
|
|
@@ -60273,7 +60345,7 @@ ${result}`;
|
|
|
60273
60345
|
},
|
|
60274
60346
|
async handler(a, ctx) {
|
|
60275
60347
|
ctx.info(`Updating VLAN interface: name=${a.name}`);
|
|
60276
|
-
const cmd = new Cmd(`/interface vlan set [find name="${a.name}"]`).opt("name", a.new_name).opt("vlan-id", a.vlan_id).opt("interface", a.interface).opt("comment", a.comment).bool("disabled", a.disabled).opt("mtu", a.mtu).bool("use-service-tag", a.use_service_tag).opt("arp", a.arp).opt("arp-timeout", a.arp_timeout).opt("loop-protect", a.loop_protect).opt("loop-protect-disable-time", a.loop_protect_disable_time).opt("loop-protect-send-interval", a.loop_protect_send_interval).build();
|
|
60348
|
+
const cmd = new Cmd(`/interface vlan set [find name="${a.name}"]`).opt("name", a.new_name).opt("vlan-id", a.vlan_id).opt("interface", a.interface).opt("comment", a.comment).bool("disabled", a.disabled).opt("mtu", a.mtu).opt("forced-mac-address", a.forced_mac_address).bool("use-service-tag", a.use_service_tag).opt("arp", a.arp).opt("arp-timeout", a.arp_timeout).opt("loop-protect", a.loop_protect).opt("loop-protect-disable-time", a.loop_protect_disable_time).opt("loop-protect-send-interval", a.loop_protect_send_interval).build();
|
|
60277
60349
|
if (!cmd.includes("=", cmd.indexOf("]")))
|
|
60278
60350
|
return "No updates specified.";
|
|
60279
60351
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
@@ -60698,12 +60770,13 @@ ${details}`;
|
|
|
60698
60770
|
client_endpoint: string().optional().describe("server endpoint host[:port] written into the generated client config"),
|
|
60699
60771
|
client_keepalive: string().optional().describe('client persistent-keepalive for the generated config e.g. "25s"'),
|
|
60700
60772
|
client_listen_port: number().int().optional().describe("listen-port written into the generated client config"),
|
|
60773
|
+
client_mtu: number().int().min(576).max(65535).optional().describe("RouterOS 7.25+ MTU in generated client configuration"),
|
|
60701
60774
|
comment: string().optional(),
|
|
60702
60775
|
disabled: boolean().default(false)
|
|
60703
60776
|
},
|
|
60704
60777
|
async handler(a, ctx) {
|
|
60705
60778
|
ctx.info(`Adding WireGuard peer: interface=${a.interface}, public_key=${a.public_key.slice(0, 12)}...`);
|
|
60706
|
-
const cmd = new Cmd("/interface wireguard peers add").set("interface", a.interface).set("public-key", a.public_key).set("allowed-address", a.allowed_address).opt("endpoint-address", a.endpoint_address).opt("endpoint-port", a.endpoint_port).opt("preshared-key", a.preshared_key).opt("persistent-keepalive", a.persistent_keepalive).opt("name", a.name).opt("private-key", a.private_key).bool("responder", a.responder).opt("client-address", a.client_address).opt("client-dns", a.client_dns).opt("client-endpoint", a.client_endpoint).opt("client-keepalive", a.client_keepalive).opt("client-listen-port", a.client_listen_port).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
60779
|
+
const cmd = new Cmd("/interface wireguard peers add").set("interface", a.interface).set("public-key", a.public_key).set("allowed-address", a.allowed_address).opt("endpoint-address", a.endpoint_address).opt("endpoint-port", a.endpoint_port).opt("preshared-key", a.preshared_key).opt("persistent-keepalive", a.persistent_keepalive).opt("name", a.name).opt("private-key", a.private_key).bool("responder", a.responder).opt("client-address", a.client_address).opt("client-dns", a.client_dns).opt("client-endpoint", a.client_endpoint).opt("client-keepalive", a.client_keepalive).opt("client-listen-port", a.client_listen_port).opt("client-mtu", a.client_mtu).opt("comment", a.comment).flag("disabled", a.disabled).build();
|
|
60707
60780
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
|
60708
60781
|
if (looksLikeError(result))
|
|
60709
60782
|
return `Failed to add WireGuard peer: ${result}`;
|
|
@@ -60783,7 +60856,8 @@ ${result}`;
|
|
|
60783
60856
|
client_dns: string().optional().describe("DNS server(s) written into the generated client config"),
|
|
60784
60857
|
client_endpoint: string().optional().describe("server endpoint host[:port] written into the generated client config"),
|
|
60785
60858
|
client_keepalive: string().optional().describe('client persistent-keepalive for the generated config e.g. "25s"'),
|
|
60786
|
-
client_listen_port: number().int().optional().describe("listen
|
|
60859
|
+
client_listen_port: union([number().int(), literal("")]).optional().describe("Client listen port; empty string unsets it on RouterOS 7.25+"),
|
|
60860
|
+
client_mtu: number().int().min(576).max(65535).optional().describe("RouterOS 7.25+ MTU in generated client configuration"),
|
|
60787
60861
|
comment: string().optional(),
|
|
60788
60862
|
disabled: boolean().optional()
|
|
60789
60863
|
},
|
|
@@ -60793,7 +60867,7 @@ ${result}`;
|
|
|
60793
60867
|
if (!id)
|
|
60794
60868
|
return peerNotFound(a.peer_id);
|
|
60795
60869
|
const base = `/interface wireguard peers set ${id}`;
|
|
60796
|
-
const cmd = new Cmd(base).raw(a.public_key !== undefined ? `public-key=${quoteValue(a.public_key)}` : null).raw(a.allowed_address !== undefined ? `allowed-address=${quoteValue(a.allowed_address)}` : null).raw(a.endpoint_address !== undefined ? a.endpoint_address === "" ? "!endpoint-address" : `endpoint-address=${quoteValue(a.endpoint_address)}` : null).opt("endpoint-port", a.endpoint_port).raw(a.preshared_key !== undefined ? a.preshared_key === "" ? "!preshared-key" : `preshared-key=${quoteValue(a.preshared_key)}` : null).raw(a.persistent_keepalive !== undefined ? `persistent-keepalive=${a.persistent_keepalive}` : null).opt("name", a.name).opt("private-key", a.private_key).bool("responder", a.responder).raw(a.client_address !== undefined ? a.client_address === "" ? "!client-address" : `client-address=${quoteValue(a.client_address)}` : null).raw(a.client_dns !== undefined ? a.client_dns === "" ? "!client-dns" : `client-dns=${quoteValue(a.client_dns)}` : null).raw(a.client_endpoint !== undefined ? a.client_endpoint === "" ? "!client-endpoint" : `client-endpoint=${quoteValue(a.client_endpoint)}` : null).opt("client-keepalive", a.client_keepalive).opt("client-listen-port", a.client_listen_port).raw(a.comment !== undefined ? `comment=${quoteValue(a.comment)}` : null).bool("disabled", a.disabled).build();
|
|
60870
|
+
const cmd = new Cmd(base).raw(a.public_key !== undefined ? `public-key=${quoteValue(a.public_key)}` : null).raw(a.allowed_address !== undefined ? `allowed-address=${quoteValue(a.allowed_address)}` : null).raw(a.endpoint_address !== undefined ? a.endpoint_address === "" ? "!endpoint-address" : `endpoint-address=${quoteValue(a.endpoint_address)}` : null).opt("endpoint-port", a.endpoint_port).raw(a.preshared_key !== undefined ? a.preshared_key === "" ? "!preshared-key" : `preshared-key=${quoteValue(a.preshared_key)}` : null).raw(a.persistent_keepalive !== undefined ? `persistent-keepalive=${a.persistent_keepalive}` : null).opt("name", a.name).opt("private-key", a.private_key).bool("responder", a.responder).raw(a.client_address !== undefined ? a.client_address === "" ? "!client-address" : `client-address=${quoteValue(a.client_address)}` : null).raw(a.client_dns !== undefined ? a.client_dns === "" ? "!client-dns" : `client-dns=${quoteValue(a.client_dns)}` : null).raw(a.client_endpoint !== undefined ? a.client_endpoint === "" ? "!client-endpoint" : `client-endpoint=${quoteValue(a.client_endpoint)}` : null).opt("client-keepalive", a.client_keepalive).raw(a.client_listen_port === "" ? "!client-listen-port" : null).opt("client-listen-port", a.client_listen_port === "" ? undefined : a.client_listen_port).opt("client-mtu", a.client_mtu).raw(a.comment !== undefined ? `comment=${quoteValue(a.comment)}` : null).bool("disabled", a.disabled).build();
|
|
60797
60871
|
if (cmd === base)
|
|
60798
60872
|
return "No updates specified.";
|
|
60799
60873
|
const result = await executeMikrotikCommand2(cmd, ctx);
|
package/package.json
CHANGED
package/schemas/README.md
CHANGED
|
@@ -7,7 +7,7 @@ edit by hand — regenerate instead.
|
|
|
7
7
|
| File | Contents |
|
|
8
8
|
| -------------------- | ------------------------------------------------------------------------------------------ |
|
|
9
9
|
| `config.schema.json` | The runtime configuration object (env vars / CLI flags). |
|
|
10
|
-
| `tool-catalog.json` | Every one of the
|
|
10
|
+
| `tool-catalog.json` | Every one of the 983 tools: `name`, `risk`, `title`, `description`, and input JSON Schema. |
|
|
11
11
|
| `tools/<name>.json` | The input JSON Schema for a single tool. |
|
|
12
12
|
|
|
13
13
|
`risk` is derived from the MCP tool annotations:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.0",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"slug": "client-check",
|
|
@@ -811,6 +811,8 @@
|
|
|
811
811
|
"description": "BGP connections, templates, sessions and advertisements (`/routing bgp`).",
|
|
812
812
|
"alwaysOn": false,
|
|
813
813
|
"tools": [
|
|
814
|
+
"list_bgp_instances",
|
|
815
|
+
"update_bgp_instance_med_comparison",
|
|
814
816
|
"list_bgp_connections",
|
|
815
817
|
"get_bgp_connection",
|
|
816
818
|
"add_bgp_connection",
|
|
@@ -5451,6 +5453,26 @@
|
|
|
5451
5453
|
"automatic": true
|
|
5452
5454
|
}
|
|
5453
5455
|
},
|
|
5456
|
+
{
|
|
5457
|
+
"name": "list_bgp_instances",
|
|
5458
|
+
"module": "routing-bgp",
|
|
5459
|
+
"group": "Dynamic Routing",
|
|
5460
|
+
"noDevice": false,
|
|
5461
|
+
"requires": null,
|
|
5462
|
+
"ui": {
|
|
5463
|
+
"resourceUri": "ui://mikrotik/records.html?v=2",
|
|
5464
|
+
"visibility": ["model", "app"],
|
|
5465
|
+
"automatic": true
|
|
5466
|
+
}
|
|
5467
|
+
},
|
|
5468
|
+
{
|
|
5469
|
+
"name": "update_bgp_instance_med_comparison",
|
|
5470
|
+
"module": "routing-bgp",
|
|
5471
|
+
"group": "Dynamic Routing",
|
|
5472
|
+
"noDevice": false,
|
|
5473
|
+
"requires": null,
|
|
5474
|
+
"ui": null
|
|
5475
|
+
},
|
|
5454
5476
|
{
|
|
5455
5477
|
"name": "list_bgp_connections",
|
|
5456
5478
|
"module": "routing-bgp",
|