@usex/mikrotik-mcp 3.41.0 → 3.42.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
@@ -84,7 +84,7 @@ import {
84
84
  toggleAaaEntity,
85
85
  updateAaaEntity,
86
86
  writeBackup
87
- } from "./shared/cli-ef0ns1dq.js";
87
+ } from "./shared/cli-sq4trv31.js";
88
88
 
89
89
  // src/cli.ts
90
90
  import { existsSync as existsSync2 } from "fs";
@@ -2242,7 +2242,7 @@ function registerPrompts(server) {
2242
2242
  // package.json
2243
2243
  var package_default = {
2244
2244
  name: "@usex/mikrotik-mcp",
2245
- version: "3.41.0",
2245
+ version: "3.42.0",
2246
2246
  description: "MCP server for MikroTik RouterOS \u2014 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
2247
2247
  keywords: [
2248
2248
  "ai",
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  resolveDeviceName,
22
22
  selectToolModules,
23
23
  setConfig
24
- } from "./shared/library-vhp4xd29.js";
24
+ } from "./shared/library-5cjmn0n7.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.41.0",
134
+ version: "3.42.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-ef0ns1dq.js";
7
+ } from "./cli-sq4trv31.js";
8
8
  export {
9
9
  selectToolModules,
10
10
  moduleCatalog,
@@ -6141,7 +6141,7 @@ var cache = null;
6141
6141
  async function gateway() {
6142
6142
  if (cache)
6143
6143
  return cache;
6144
- const { moduleCatalog } = await import("./cli-fwswsq2a.js");
6144
+ const { moduleCatalog } = await import("./cli-rptenaf7.js");
6145
6145
  const forIndex = [];
6146
6146
  const byName = new Map;
6147
6147
  for (const mod of moduleCatalog) {
@@ -18147,21 +18147,34 @@ ${result}`;
18147
18147
  name: "check_route_path",
18148
18148
  title: "Check IPv4 Route Path",
18149
18149
  annotations: READ,
18150
- description: "Resolves which nexthop RouterOS would use for a given IPv4 destination (`/ip route check`) " + '\u2014 answers "which gateway will this packet take?" without sending any traffic. ' + "Optionally scoped by `source` address and `routing_mark` for policy-routing table lookups. " + "For listing all known routes use list_routes; for a named-table view use get_routing_table. " + "Returns the resolved nexthop and interface detail.",
18150
+ description: "Resolves which nexthop RouterOS would use for a given IPv4 destination " + '\u2014 answers "which gateway will this packet take?" without sending any traffic. ' + "Version-aware: uses `/ip route check` on v6, falls back to " + "`/ip route print where dst-address in <dest> active=yes` on v7+ where the check " + "command was removed. Optionally scoped by `routing_table` (v7) / `routing_mark` (v6) " + "for policy-routing table lookups. " + "For listing all known routes use list_routes; for a named-table view use get_routing_table. " + "Returns the resolved nexthop and interface detail.",
18151
18151
  inputSchema: {
18152
18152
  destination: z83.string(),
18153
- source: z83.string().optional(),
18154
- routing_mark: z83.string().optional()
18153
+ routing_table: z83.string().optional().describe('Policy-routing table name (v7) or routing-mark (v6), e.g. "VPN"')
18155
18154
  },
18156
18155
  async handler(a, ctx) {
18157
18156
  ctx.info(`Checking route path to: ${a.destination}`);
18158
- const cmd = new Cmd(`/ip route check ${a.destination}`).opt("src-address", a.source).opt("routing-mark", a.routing_mark).build();
18159
- const result = await executeMikrotikCommand(cmd, ctx);
18160
- if (!result)
18161
- return `Unable to check route to ${a.destination}`;
18157
+ const table = a.routing_table;
18158
+ const v6Cmd = new Cmd(`/ip route check ${a.destination}`).opt("routing-mark", table).build();
18159
+ const v6Result = await executeMikrotikCommand(v6Cmd, ctx);
18160
+ if (!commandUnsupported(v6Result) && !looksLikeError(v6Result) && !isEmpty(v6Result)) {
18161
+ return `ROUTE PATH TO ${a.destination}:
18162
+
18163
+ ${v6Result}`;
18164
+ }
18165
+ const where = [`dst-address in ${a.destination}`, "active=yes"];
18166
+ if (table)
18167
+ where.push(`routing-table=${quoteValue(table)}`);
18168
+ const v7Cmd = `/ip route print detail where ${where.join(" ")}`;
18169
+ const v7Result = await executeMikrotikCommand(v7Cmd, ctx);
18170
+ if (looksLikeError(v7Result))
18171
+ return `Failed to check route to ${a.destination}: ${v7Result}`;
18172
+ if (isEmpty(v7Result)) {
18173
+ return `No active route to ${a.destination}${table ? ` in table '${table}'` : ""}.`;
18174
+ }
18162
18175
  return `ROUTE PATH TO ${a.destination}:
18163
18176
 
18164
- ${result}`;
18177
+ ${v7Result}`;
18165
18178
  }
18166
18179
  }),
18167
18180
  defineTool({
@@ -6117,7 +6117,7 @@ var cache = null;
6117
6117
  async function gateway() {
6118
6118
  if (cache)
6119
6119
  return cache;
6120
- const { moduleCatalog } = await import("./library-2s6sp2r5.js");
6120
+ const { moduleCatalog } = await import("./library-z22txcv0.js");
6121
6121
  const forIndex = [];
6122
6122
  const byName = new Map;
6123
6123
  for (const mod of moduleCatalog) {
@@ -18123,21 +18123,34 @@ ${result}`;
18123
18123
  name: "check_route_path",
18124
18124
  title: "Check IPv4 Route Path",
18125
18125
  annotations: READ,
18126
- description: "Resolves which nexthop RouterOS would use for a given IPv4 destination (`/ip route check`) " + '\u2014 answers "which gateway will this packet take?" without sending any traffic. ' + "Optionally scoped by `source` address and `routing_mark` for policy-routing table lookups. " + "For listing all known routes use list_routes; for a named-table view use get_routing_table. " + "Returns the resolved nexthop and interface detail.",
18126
+ description: "Resolves which nexthop RouterOS would use for a given IPv4 destination " + '\u2014 answers "which gateway will this packet take?" without sending any traffic. ' + "Version-aware: uses `/ip route check` on v6, falls back to " + "`/ip route print where dst-address in <dest> active=yes` on v7+ where the check " + "command was removed. Optionally scoped by `routing_table` (v7) / `routing_mark` (v6) " + "for policy-routing table lookups. " + "For listing all known routes use list_routes; for a named-table view use get_routing_table. " + "Returns the resolved nexthop and interface detail.",
18127
18127
  inputSchema: {
18128
18128
  destination: z83.string(),
18129
- source: z83.string().optional(),
18130
- routing_mark: z83.string().optional()
18129
+ routing_table: z83.string().optional().describe('Policy-routing table name (v7) or routing-mark (v6), e.g. "VPN"')
18131
18130
  },
18132
18131
  async handler(a, ctx) {
18133
18132
  ctx.info(`Checking route path to: ${a.destination}`);
18134
- const cmd = new Cmd(`/ip route check ${a.destination}`).opt("src-address", a.source).opt("routing-mark", a.routing_mark).build();
18135
- const result = await executeMikrotikCommand(cmd, ctx);
18136
- if (!result)
18137
- return `Unable to check route to ${a.destination}`;
18133
+ const table = a.routing_table;
18134
+ const v6Cmd = new Cmd(`/ip route check ${a.destination}`).opt("routing-mark", table).build();
18135
+ const v6Result = await executeMikrotikCommand(v6Cmd, ctx);
18136
+ if (!commandUnsupported(v6Result) && !looksLikeError(v6Result) && !isEmpty(v6Result)) {
18137
+ return `ROUTE PATH TO ${a.destination}:
18138
+
18139
+ ${v6Result}`;
18140
+ }
18141
+ const where = [`dst-address in ${a.destination}`, "active=yes"];
18142
+ if (table)
18143
+ where.push(`routing-table=${quoteValue(table)}`);
18144
+ const v7Cmd = `/ip route print detail where ${where.join(" ")}`;
18145
+ const v7Result = await executeMikrotikCommand(v7Cmd, ctx);
18146
+ if (looksLikeError(v7Result))
18147
+ return `Failed to check route to ${a.destination}: ${v7Result}`;
18148
+ if (isEmpty(v7Result)) {
18149
+ return `No active route to ${a.destination}${table ? ` in table '${table}'` : ""}.`;
18150
+ }
18138
18151
  return `ROUTE PATH TO ${a.destination}:
18139
18152
 
18140
- ${result}`;
18153
+ ${v7Result}`;
18141
18154
  }
18142
18155
  }),
18143
18156
  defineTool({
@@ -4,7 +4,7 @@ import {
4
4
  allToolModules,
5
5
  moduleCatalog,
6
6
  selectToolModules
7
- } from "./library-vhp4xd29.js";
7
+ } from "./library-5cjmn0n7.js";
8
8
  export {
9
9
  selectToolModules,
10
10
  moduleCatalog,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usex/mikrotik-mcp",
3
- "version": "3.41.0",
3
+ "version": "3.42.0",
4
4
  "description": "MCP server for MikroTik RouterOS — 660+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
5
5
  "keywords": [
6
6
  "ai",