@usex/mikrotik-mcp 3.8.0 → 3.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 CHANGED
@@ -20038,7 +20038,7 @@ ${details}` : "WireGuard interface created successfully.";
20038
20038
  name: "list_wireguard_interfaces",
20039
20039
  title: "List WireGuard Interfaces",
20040
20040
  annotations: READ,
20041
- description: "Lists WireGuard tunnel interfaces (`/interface wireguard print`). Returns each interface's" + " name, listen-port, public-key, MTU, and running/disabled status." + " Supports filtering by name substring (name_filter), disabled-only, or running-only." + " For the peer table use list_wireguard_peers." + " Use the name from this output with get_wireguard_interface or update_wireguard_interface.",
20041
+ description: "`list_wireguard_interfaces` \u2014 READ / list / show / inspect all WireGuard tunnel interfaces" + " (`/interface wireguard print`). The go-to tool to read the current WireGuard state on a" + " device. Returns each interface's name, listen-port, public-key, MTU, and running/disabled" + " status. Filter by name substring (name_filter), disabled-only, or running-only." + " For one interface's full detail use get_wireguard_interface; for the peer table use" + " list_wireguard_peers; for interfaces AND peers in one call use get_wireguard_status.",
20042
20042
  inputSchema: {
20043
20043
  name_filter: z108.string().optional(),
20044
20044
  disabled_only: z108.boolean().default(false),
@@ -20063,7 +20063,7 @@ ${result}`;
20063
20063
  name: "get_wireguard_interface",
20064
20064
  title: "Get WireGuard Interface Details",
20065
20065
  annotations: READ,
20066
- description: "Retrieves full detail of a single WireGuard tunnel interface (`/interface wireguard print detail`)" + " looked up by name. Returns listen-port, private-key, public-key, MTU, running state, and comment." + " For the peer table use get_wireguard_peer." + " Use list_wireguard_interfaces to discover available interface names.",
20066
+ description: "`get_wireguard_interface` \u2014 READ / get / show the full detail of ONE WireGuard tunnel interface" + " (`/interface wireguard print detail`) looked up by name. Returns listen-port, private-key," + " public-key, MTU, running state, and comment. To list all interfaces use" + " list_wireguard_interfaces; for that interface's peers use list_wireguard_peers; for" + " interfaces AND peers in one call use get_wireguard_status.",
20067
20067
  inputSchema: { name: z108.string() },
20068
20068
  async handler(a, ctx) {
20069
20069
  ctx.info(`Getting WireGuard interface details: name=${a.name}`);
@@ -20073,6 +20073,31 @@ ${result}`;
20073
20073
  ${result}`;
20074
20074
  }
20075
20075
  }),
20076
+ defineTool({
20077
+ name: "get_wireguard_status",
20078
+ title: "Get WireGuard Status (Interfaces + Peers)",
20079
+ annotations: READ,
20080
+ description: "`get_wireguard_status` \u2014 READ the current WireGuard state on a device in ONE call: ALL tunnel" + " interfaces AND ALL peers together. Use this FIRST to inspect / show / check WireGuard before" + " changing anything (e.g. to read public keys, see which side initiates, or confirm the tunnel" + " is up). Interfaces report name, listen-port, public-key, MTU and running state; peers report" + " .id, interface, public-key, allowed-address, endpoint/current-endpoint, last-handshake time" + " and rx/tx bytes. Combines list_wireguard_interfaces + list_wireguard_peers; optionally filter" + " both to one interface with interface_filter.",
20081
+ inputSchema: {
20082
+ interface_filter: z108.string().optional().describe("Limit to one interface name, e.g. 'wg-mesh'")
20083
+ },
20084
+ async handler(a, ctx) {
20085
+ ctx.info("Reading WireGuard status (interfaces + peers)");
20086
+ const ifFilters = a.interface_filter ? [`name="${a.interface_filter}"`] : [];
20087
+ const peerFilters = a.interface_filter ? [`interface="${a.interface_filter}"`] : [];
20088
+ const interfaces = await executeMikrotikCommand(`/interface wireguard print${whereClause(ifFilters)}`, ctx);
20089
+ const peers = await executeMikrotikCommand(`/interface wireguard peers print${whereClause(peerFilters)}`, ctx);
20090
+ const ifBlock = isEmpty(interfaces) ? "(none)" : interfaces;
20091
+ const peerBlock = isEmpty(peers) ? "(none)" : peers;
20092
+ return `WIREGUARD INTERFACES:
20093
+
20094
+ ${ifBlock}
20095
+
20096
+ WIREGUARD PEERS:
20097
+
20098
+ ${peerBlock}`;
20099
+ }
20100
+ }),
20076
20101
  defineTool({
20077
20102
  name: "update_wireguard_interface",
20078
20103
  title: "Update WireGuard Interface",
@@ -20185,7 +20210,7 @@ ${details}` : "WireGuard peer added successfully.";
20185
20210
  name: "list_wireguard_peers",
20186
20211
  title: "List WireGuard Peers",
20187
20212
  annotations: READ,
20188
- description: "Lists all WireGuard peer entries (`/interface wireguard peers print`)." + " Returns each peer's .id, interface, public-key, allowed-address, endpoint, last-handshake time, and rx/tx byte counters." + " Filter by interface name (interface_filter) or disabled-only." + " For the interface table use list_wireguard_interfaces." + " Use the .id from this output with get_wireguard_peer, update_wireguard_peer, remove_wireguard_peer," + " enable_wireguard_peer, or disable_wireguard_peer.",
20213
+ description: "`list_wireguard_peers` \u2014 READ / list / show / inspect all WireGuard peers" + " (`/interface wireguard peers print`). Use this to read which peers are configured and" + " whether the tunnel is up (handshake). Returns each peer's .id, interface, public-key," + " allowed-address, endpoint/current-endpoint, last-handshake time, and rx/tx byte counters." + " Filter by interface name (interface_filter) or disabled-only. For the interface table use" + " list_wireguard_interfaces; for one peer's full detail use get_wireguard_peer; for interfaces" + " AND peers in one call use get_wireguard_status. Use the .id from this output with" + " update_wireguard_peer, remove_wireguard_peer, enable_wireguard_peer, or disable_wireguard_peer.",
20189
20214
  inputSchema: {
20190
20215
  interface_filter: z108.string().optional(),
20191
20216
  disabled_only: z108.boolean().default(false)
@@ -20207,7 +20232,7 @@ ${result}`;
20207
20232
  name: "get_wireguard_peer",
20208
20233
  title: "Get WireGuard Peer Details",
20209
20234
  annotations: READ,
20210
- description: "Retrieves full detail of a single WireGuard peer (`/interface wireguard peers print detail`) by its .id." + " Returns public-key, allowed-address, endpoint, preshared-key presence, last-handshake time, and rx/tx bytes." + " For the interface table use get_wireguard_interface." + ` Use list_wireguard_peers to obtain peer .id values.
20235
+ description: "`get_wireguard_peer` \u2014 READ / get / show the full detail of ONE WireGuard peer" + " (`/interface wireguard peers print detail`) by its .id. Returns public-key, allowed-address," + " endpoint/current-endpoint, preshared-key presence, last-handshake time, and rx/tx bytes." + " To list all peers use list_wireguard_peers; for interfaces AND peers in one call use" + ` get_wireguard_status.
20211
20236
 
20212
20237
  ` + `Notes:
20213
20238
  ` + ' peer_id: the .id from list_wireguard_peers, format "*N" or "N" e.g. "*2"',
@@ -23276,7 +23301,7 @@ function registerPrompts(server) {
23276
23301
  // package.json
23277
23302
  var package_default = {
23278
23303
  name: "@usex/mikrotik-mcp",
23279
- version: "3.8.0",
23304
+ version: "3.9.0",
23280
23305
  description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
23281
23306
  keywords: [
23282
23307
  "ai",
package/dist/index.js CHANGED
@@ -20050,7 +20050,7 @@ ${details}` : "WireGuard interface created successfully.";
20050
20050
  name: "list_wireguard_interfaces",
20051
20051
  title: "List WireGuard Interfaces",
20052
20052
  annotations: READ,
20053
- description: "Lists WireGuard tunnel interfaces (`/interface wireguard print`). Returns each interface's" + " name, listen-port, public-key, MTU, and running/disabled status." + " Supports filtering by name substring (name_filter), disabled-only, or running-only." + " For the peer table use list_wireguard_peers." + " Use the name from this output with get_wireguard_interface or update_wireguard_interface.",
20053
+ description: "`list_wireguard_interfaces` \u2014 READ / list / show / inspect all WireGuard tunnel interfaces" + " (`/interface wireguard print`). The go-to tool to read the current WireGuard state on a" + " device. Returns each interface's name, listen-port, public-key, MTU, and running/disabled" + " status. Filter by name substring (name_filter), disabled-only, or running-only." + " For one interface's full detail use get_wireguard_interface; for the peer table use" + " list_wireguard_peers; for interfaces AND peers in one call use get_wireguard_status.",
20054
20054
  inputSchema: {
20055
20055
  name_filter: z109.string().optional(),
20056
20056
  disabled_only: z109.boolean().default(false),
@@ -20075,7 +20075,7 @@ ${result}`;
20075
20075
  name: "get_wireguard_interface",
20076
20076
  title: "Get WireGuard Interface Details",
20077
20077
  annotations: READ,
20078
- description: "Retrieves full detail of a single WireGuard tunnel interface (`/interface wireguard print detail`)" + " looked up by name. Returns listen-port, private-key, public-key, MTU, running state, and comment." + " For the peer table use get_wireguard_peer." + " Use list_wireguard_interfaces to discover available interface names.",
20078
+ description: "`get_wireguard_interface` \u2014 READ / get / show the full detail of ONE WireGuard tunnel interface" + " (`/interface wireguard print detail`) looked up by name. Returns listen-port, private-key," + " public-key, MTU, running state, and comment. To list all interfaces use" + " list_wireguard_interfaces; for that interface's peers use list_wireguard_peers; for" + " interfaces AND peers in one call use get_wireguard_status.",
20079
20079
  inputSchema: { name: z109.string() },
20080
20080
  async handler(a, ctx) {
20081
20081
  ctx.info(`Getting WireGuard interface details: name=${a.name}`);
@@ -20085,6 +20085,31 @@ ${result}`;
20085
20085
  ${result}`;
20086
20086
  }
20087
20087
  }),
20088
+ defineTool({
20089
+ name: "get_wireguard_status",
20090
+ title: "Get WireGuard Status (Interfaces + Peers)",
20091
+ annotations: READ,
20092
+ description: "`get_wireguard_status` \u2014 READ the current WireGuard state on a device in ONE call: ALL tunnel" + " interfaces AND ALL peers together. Use this FIRST to inspect / show / check WireGuard before" + " changing anything (e.g. to read public keys, see which side initiates, or confirm the tunnel" + " is up). Interfaces report name, listen-port, public-key, MTU and running state; peers report" + " .id, interface, public-key, allowed-address, endpoint/current-endpoint, last-handshake time" + " and rx/tx bytes. Combines list_wireguard_interfaces + list_wireguard_peers; optionally filter" + " both to one interface with interface_filter.",
20093
+ inputSchema: {
20094
+ interface_filter: z109.string().optional().describe("Limit to one interface name, e.g. 'wg-mesh'")
20095
+ },
20096
+ async handler(a, ctx) {
20097
+ ctx.info("Reading WireGuard status (interfaces + peers)");
20098
+ const ifFilters = a.interface_filter ? [`name="${a.interface_filter}"`] : [];
20099
+ const peerFilters = a.interface_filter ? [`interface="${a.interface_filter}"`] : [];
20100
+ const interfaces = await executeMikrotikCommand(`/interface wireguard print${whereClause(ifFilters)}`, ctx);
20101
+ const peers = await executeMikrotikCommand(`/interface wireguard peers print${whereClause(peerFilters)}`, ctx);
20102
+ const ifBlock = isEmpty(interfaces) ? "(none)" : interfaces;
20103
+ const peerBlock = isEmpty(peers) ? "(none)" : peers;
20104
+ return `WIREGUARD INTERFACES:
20105
+
20106
+ ${ifBlock}
20107
+
20108
+ WIREGUARD PEERS:
20109
+
20110
+ ${peerBlock}`;
20111
+ }
20112
+ }),
20088
20113
  defineTool({
20089
20114
  name: "update_wireguard_interface",
20090
20115
  title: "Update WireGuard Interface",
@@ -20197,7 +20222,7 @@ ${details}` : "WireGuard peer added successfully.";
20197
20222
  name: "list_wireguard_peers",
20198
20223
  title: "List WireGuard Peers",
20199
20224
  annotations: READ,
20200
- description: "Lists all WireGuard peer entries (`/interface wireguard peers print`)." + " Returns each peer's .id, interface, public-key, allowed-address, endpoint, last-handshake time, and rx/tx byte counters." + " Filter by interface name (interface_filter) or disabled-only." + " For the interface table use list_wireguard_interfaces." + " Use the .id from this output with get_wireguard_peer, update_wireguard_peer, remove_wireguard_peer," + " enable_wireguard_peer, or disable_wireguard_peer.",
20225
+ description: "`list_wireguard_peers` \u2014 READ / list / show / inspect all WireGuard peers" + " (`/interface wireguard peers print`). Use this to read which peers are configured and" + " whether the tunnel is up (handshake). Returns each peer's .id, interface, public-key," + " allowed-address, endpoint/current-endpoint, last-handshake time, and rx/tx byte counters." + " Filter by interface name (interface_filter) or disabled-only. For the interface table use" + " list_wireguard_interfaces; for one peer's full detail use get_wireguard_peer; for interfaces" + " AND peers in one call use get_wireguard_status. Use the .id from this output with" + " update_wireguard_peer, remove_wireguard_peer, enable_wireguard_peer, or disable_wireguard_peer.",
20201
20226
  inputSchema: {
20202
20227
  interface_filter: z109.string().optional(),
20203
20228
  disabled_only: z109.boolean().default(false)
@@ -20219,7 +20244,7 @@ ${result}`;
20219
20244
  name: "get_wireguard_peer",
20220
20245
  title: "Get WireGuard Peer Details",
20221
20246
  annotations: READ,
20222
- description: "Retrieves full detail of a single WireGuard peer (`/interface wireguard peers print detail`) by its .id." + " Returns public-key, allowed-address, endpoint, preshared-key presence, last-handshake time, and rx/tx bytes." + " For the interface table use get_wireguard_interface." + ` Use list_wireguard_peers to obtain peer .id values.
20247
+ description: "`get_wireguard_peer` \u2014 READ / get / show the full detail of ONE WireGuard peer" + " (`/interface wireguard peers print detail`) by its .id. Returns public-key, allowed-address," + " endpoint/current-endpoint, preshared-key presence, last-handshake time, and rx/tx bytes." + " To list all peers use list_wireguard_peers; for interfaces AND peers in one call use" + ` get_wireguard_status.
20223
20248
 
20224
20249
  ` + `Notes:
20225
20250
  ` + ' peer_id: the .id from list_wireguard_peers, format "*N" or "N" e.g. "*2"',
@@ -21679,7 +21704,7 @@ function selectToolModules(filter = {}, catalog = moduleCatalog) {
21679
21704
  // package.json
21680
21705
  var package_default = {
21681
21706
  name: "@usex/mikrotik-mcp",
21682
- version: "3.8.0",
21707
+ version: "3.9.0",
21683
21708
  description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
21684
21709
  keywords: [
21685
21710
  "ai",