@teamnetwork-nz/sonicwall-api-mcp-server 0.8.0 → 0.8.1

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 CHANGED
@@ -58,7 +58,9 @@ uv pip install sonicwall-mcp-server
58
58
  | `SONICWALL_PASSWORD` | Yes | — | Admin password |
59
59
  | `SONICWALL_PORT` | No | `443` | HTTPS management port |
60
60
  | `SONICWALL_SSL_VERIFY` | No | `true` | Set `false` for self-signed certificates |
61
- | `SONICWALL_READ_ONLY` | No | `true` | Set `false` to allow write operations |
61
+ | `SONICWALL_READWRITE` | No | `false` | Set `true` to allow write operations |
62
+
63
+ `SONICWALL_READ_ONLY=false` remains a deprecated compatibility alias for one release. `SONICWALL_READWRITE` takes precedence when both are set.
62
64
  | `SONICWALL_DEVICES_FILE` | No | — | Path to JSON file for multi-device config |
63
65
  | `SONICWALL_REQUEST_TIMEOUT` | No | `30.0` | Per-request timeout in seconds |
64
66
 
@@ -81,7 +83,7 @@ Add to your MCP config (`claude_desktop_config.json` or `.claude/settings.json`)
81
83
  "SONICWALL_USERNAME": "admin",
82
84
  "SONICWALL_PASSWORD": "your_password",
83
85
  "SONICWALL_SSL_VERIFY": "false",
84
- "SONICWALL_READ_ONLY": "false"
86
+ "SONICWALL_READWRITE": "true"
85
87
  }
86
88
  }
87
89
  }
@@ -101,7 +103,7 @@ Add to your MCP config (`claude_desktop_config.json` or `.claude/settings.json`)
101
103
  "SONICWALL_USERNAME": "admin",
102
104
  "SONICWALL_PASSWORD": "your_password",
103
105
  "SONICWALL_SSL_VERIFY": "false",
104
- "SONICWALL_READ_ONLY": "false"
106
+ "SONICWALL_READWRITE": "true"
105
107
  }
106
108
  }
107
109
  }
@@ -120,7 +122,7 @@ Add to your MCP config (`claude_desktop_config.json` or `.claude/settings.json`)
120
122
  "SONICWALL_USERNAME": "admin",
121
123
  "SONICWALL_PASSWORD": "your_password",
122
124
  "SONICWALL_SSL_VERIFY": "false",
123
- "SONICWALL_READ_ONLY": "false"
125
+ "SONICWALL_READWRITE": "true"
124
126
  }
125
127
  }
126
128
  }
package/dist/env.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/env.ts
22
+ var env_exports = {};
23
+ __export(env_exports, {
24
+ parsePositiveInt: () => parsePositiveInt
25
+ });
26
+ module.exports = __toCommonJS(env_exports);
27
+ function parsePositiveInt(name, raw, fallback, maximum) {
28
+ if (raw === void 0 || raw.trim() === "") return fallback;
29
+ if (!/^\d+$/.test(raw.trim())) {
30
+ throw new Error(`${name} must be an integer from 1 to ${maximum}`);
31
+ }
32
+ const value = Number(raw);
33
+ if (!Number.isSafeInteger(value) || value < 1 || value > maximum) {
34
+ throw new Error(`${name} must be an integer from 1 to ${maximum}`);
35
+ }
36
+ return value;
37
+ }
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ parsePositiveInt
41
+ });
package/dist/index.js CHANGED
@@ -29,6 +29,48 @@ var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
29
29
 
30
30
  // src/config.ts
31
31
  var fs = __toESM(require("fs"));
32
+
33
+ // src/write-gate.ts
34
+ function readWriteEnabled(canonicalName, legacy, env = process.env) {
35
+ const canonical = env[canonicalName];
36
+ if (canonical !== void 0) return canonical.toLowerCase() === "true";
37
+ if (!legacy || env[legacy.name] === void 0) return false;
38
+ process.stderr.write(`[deprecated] ${legacy.name} is deprecated; use ${canonicalName}=true to enable writes.
39
+ `);
40
+ const value = env[legacy.name].toLowerCase();
41
+ return legacy.readonlySemantics ? value === "false" : value === "true";
42
+ }
43
+
44
+ // src/env.ts
45
+ function parsePositiveInt(name, raw, fallback, maximum) {
46
+ if (raw === void 0 || raw.trim() === "") return fallback;
47
+ if (!/^\d+$/.test(raw.trim())) {
48
+ throw new Error(`${name} must be an integer from 1 to ${maximum}`);
49
+ }
50
+ const value = Number(raw);
51
+ if (!Number.isSafeInteger(value) || value < 1 || value > maximum) {
52
+ throw new Error(`${name} must be an integer from 1 to ${maximum}`);
53
+ }
54
+ return value;
55
+ }
56
+
57
+ // src/config.ts
58
+ var import_zod = require("zod");
59
+ var DeviceProfileSchema = import_zod.z.object({
60
+ name: import_zod.z.string().min(1),
61
+ host: import_zod.z.string().min(1),
62
+ username: import_zod.z.string().min(1),
63
+ password: import_zod.z.string().min(1),
64
+ port: import_zod.z.number().int().min(1).max(65535),
65
+ sslVerify: import_zod.z.boolean(),
66
+ readOnly: import_zod.z.boolean(),
67
+ requestTimeout: import_zod.z.number().int().min(1).max(300)
68
+ }).strict();
69
+ var ConfigSchema = import_zod.z.object({
70
+ profiles: import_zod.z.array(DeviceProfileSchema).min(1),
71
+ transport: import_zod.z.enum(["stdio", "http"]),
72
+ ssePort: import_zod.z.number().int().min(1).max(65535)
73
+ }).strict();
32
74
  function loadConfig() {
33
75
  const devicesFile = process.env.SONICWALL_DEVICES_FILE;
34
76
  let profiles = [];
@@ -37,7 +79,7 @@ function loadConfig() {
37
79
  if (!Array.isArray(data) || data.length === 0) {
38
80
  throw new Error("SONICWALL_DEVICES_FILE must be a non-empty JSON array");
39
81
  }
40
- profiles = data.map((d) => ({
82
+ profiles = data.map((d) => DeviceProfileSchema.parse({
41
83
  name: d.name,
42
84
  host: d.host,
43
85
  username: d.username,
@@ -56,22 +98,22 @@ function loadConfig() {
56
98
  "Set SONICWALL_HOST, SONICWALL_USERNAME, and SONICWALL_PASSWORD (or SONICWALL_DEVICES_FILE for multi-device)"
57
99
  );
58
100
  }
59
- profiles = [{
101
+ profiles = [DeviceProfileSchema.parse({
60
102
  name: process.env.SONICWALL_DEVICE_NAME ?? "default",
61
103
  host,
62
104
  username,
63
105
  password,
64
- port: parseInt(process.env.SONICWALL_PORT ?? "443", 10),
106
+ port: parsePositiveInt("SONICWALL_PORT", process.env.SONICWALL_PORT, 443, 65535),
65
107
  sslVerify: (process.env.SONICWALL_SSL_VERIFY ?? "true") !== "false",
66
- readOnly: (process.env.SONICWALL_READ_ONLY ?? "true") !== "false",
67
- requestTimeout: parseFloat(process.env.SONICWALL_REQUEST_TIMEOUT ?? "30")
68
- }];
108
+ readOnly: !readWriteEnabled("SONICWALL_READWRITE", { name: "SONICWALL_READ_ONLY", readonlySemantics: true }),
109
+ requestTimeout: parsePositiveInt("SONICWALL_REQUEST_TIMEOUT", process.env.SONICWALL_REQUEST_TIMEOUT, 30, 300)
110
+ })];
69
111
  }
70
- return {
112
+ return ConfigSchema.parse({
71
113
  profiles,
72
114
  transport: process.env.SONICWALL_TRANSPORT ?? "stdio",
73
- ssePort: parseInt(process.env.SONICWALL_SSE_PORT ?? "8000", 10)
74
- };
115
+ ssePort: parsePositiveInt("SONICWALL_SSE_PORT", process.env.SONICWALL_SSE_PORT, 8e3, 65535)
116
+ });
75
117
  }
76
118
 
77
119
  // src/auth.ts
@@ -290,7 +332,7 @@ var WRITE_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
290
332
  var ReadOnlyError = class extends Error {
291
333
  constructor(method, path) {
292
334
  super(
293
- `${method} ${path} is a write operation but the server is in read-only mode. Set SONICWALL_READ_ONLY=false to enable write access.`
335
+ `${method} ${path} is a write operation but the server is in read-only mode. Set SONICWALL_READWRITE=true to enable write access.`
294
336
  );
295
337
  this.name = "ReadOnlyError";
296
338
  }
@@ -524,7 +566,7 @@ var DeviceRegistry = class {
524
566
  };
525
567
 
526
568
  // src/tools/system.ts
527
- var import_zod = require("zod");
569
+ var import_zod2 = require("zod");
528
570
  function registerSystemTools(server, registry) {
529
571
  server.tool(
530
572
  "list_devices",
@@ -542,7 +584,7 @@ function registerSystemTools(server, registry) {
542
584
  server.tool(
543
585
  "get_system_status",
544
586
  "Return device model, firmware version, serial number, and uptime.",
545
- { device: import_zod.z.string().optional() },
587
+ { device: import_zod2.z.string().optional() },
546
588
  async ({ device }) => {
547
589
  try {
548
590
  const client = await registry.getClient(device);
@@ -556,7 +598,7 @@ function registerSystemTools(server, registry) {
556
598
  server.tool(
557
599
  "commit_config",
558
600
  "Commit all staged configuration changes so they take effect on the appliance. Must be called after any create/update/delete operation or changes will be lost.",
559
- { device: import_zod.z.string().optional() },
601
+ { device: import_zod2.z.string().optional() },
560
602
  async ({ device }) => {
561
603
  try {
562
604
  const client = await registry.getClient(device);
@@ -570,7 +612,7 @@ function registerSystemTools(server, registry) {
570
612
  server.tool(
571
613
  "discard_config",
572
614
  "Discard all staged configuration changes without applying them.",
573
- { device: import_zod.z.string().optional() },
615
+ { device: import_zod2.z.string().optional() },
574
616
  async ({ device }) => {
575
617
  try {
576
618
  const client = await registry.getClient(device);
@@ -584,7 +626,7 @@ function registerSystemTools(server, registry) {
584
626
  server.tool(
585
627
  "get_pending_config",
586
628
  "Show configuration changes that have been staged but not yet committed.",
587
- { device: import_zod.z.string().optional() },
629
+ { device: import_zod2.z.string().optional() },
588
630
  async ({ device }) => {
589
631
  try {
590
632
  const client = await registry.getClient(device);
@@ -598,15 +640,15 @@ function registerSystemTools(server, registry) {
598
640
  }
599
641
 
600
642
  // src/tools/address-objects.ts
601
- var import_zod2 = require("zod");
643
+ var import_zod3 = require("zod");
602
644
  var ALL_TYPES = ["ipv4", "ipv6", "fqdn", "mac"];
603
645
  function registerAddressObjectTools(server, registry) {
604
646
  server.tool(
605
647
  "list_address_objects",
606
648
  "List address objects on the appliance. type: filter by 'ipv4', 'ipv6', 'fqdn', 'mac', or 'all' (default).",
607
649
  {
608
- type: import_zod2.z.enum(["ipv4", "ipv6", "fqdn", "mac", "all"]).optional().default("all"),
609
- device: import_zod2.z.string().optional()
650
+ type: import_zod3.z.enum(["ipv4", "ipv6", "fqdn", "mac", "all"]).optional().default("all"),
651
+ device: import_zod3.z.string().optional()
610
652
  },
611
653
  async ({ type, device }) => {
612
654
  try {
@@ -637,9 +679,9 @@ function registerAddressObjectTools(server, registry) {
637
679
  "get_address_object",
638
680
  "Retrieve a single address object by name and type.",
639
681
  {
640
- name: import_zod2.z.string(),
641
- type: import_zod2.z.enum(["ipv4", "ipv6", "fqdn", "mac"]),
642
- device: import_zod2.z.string().optional()
682
+ name: import_zod3.z.string(),
683
+ type: import_zod3.z.enum(["ipv4", "ipv6", "fqdn", "mac"]),
684
+ device: import_zod3.z.string().optional()
643
685
  },
644
686
  async ({ name, type, device }) => {
645
687
  try {
@@ -655,14 +697,14 @@ function registerAddressObjectTools(server, registry) {
655
697
  "create_address_object_ipv4",
656
698
  "Create an IPv4 address object. Provide exactly one of: host (single IP or CIDR), network+subnet_mask, or range_begin+range_end. Changes are STAGED; call commit_config to apply.",
657
699
  {
658
- name: import_zod2.z.string(),
659
- zone: import_zod2.z.string(),
660
- host: import_zod2.z.string().optional(),
661
- network: import_zod2.z.string().optional(),
662
- subnet_mask: import_zod2.z.string().optional(),
663
- range_begin: import_zod2.z.string().optional(),
664
- range_end: import_zod2.z.string().optional(),
665
- device: import_zod2.z.string().optional()
700
+ name: import_zod3.z.string(),
701
+ zone: import_zod3.z.string(),
702
+ host: import_zod3.z.string().optional(),
703
+ network: import_zod3.z.string().optional(),
704
+ subnet_mask: import_zod3.z.string().optional(),
705
+ range_begin: import_zod3.z.string().optional(),
706
+ range_end: import_zod3.z.string().optional(),
707
+ device: import_zod3.z.string().optional()
666
708
  },
667
709
  async ({ name, zone, host, network, subnet_mask, range_begin, range_end, device }) => {
668
710
  try {
@@ -688,12 +730,12 @@ function registerAddressObjectTools(server, registry) {
688
730
  "create_address_object_ipv6",
689
731
  "Create an IPv6 address object. Provide either address (single IPv6) or network+prefix_length. Changes are STAGED; call commit_config to apply.",
690
732
  {
691
- name: import_zod2.z.string(),
692
- zone: import_zod2.z.string(),
693
- address: import_zod2.z.string().optional(),
694
- network: import_zod2.z.string().optional(),
695
- prefix_length: import_zod2.z.number().optional(),
696
- device: import_zod2.z.string().optional()
733
+ name: import_zod3.z.string(),
734
+ zone: import_zod3.z.string(),
735
+ address: import_zod3.z.string().optional(),
736
+ network: import_zod3.z.string().optional(),
737
+ prefix_length: import_zod3.z.number().optional(),
738
+ device: import_zod3.z.string().optional()
697
739
  },
698
740
  async ({ name, zone, address, network, prefix_length, device }) => {
699
741
  try {
@@ -717,10 +759,10 @@ function registerAddressObjectTools(server, registry) {
717
759
  "create_address_object_fqdn",
718
760
  "Create an FQDN address object. Changes are STAGED; call commit_config to apply.",
719
761
  {
720
- name: import_zod2.z.string(),
721
- zone: import_zod2.z.string(),
722
- domain: import_zod2.z.string(),
723
- device: import_zod2.z.string().optional()
762
+ name: import_zod3.z.string(),
763
+ zone: import_zod3.z.string(),
764
+ domain: import_zod3.z.string(),
765
+ device: import_zod3.z.string().optional()
724
766
  },
725
767
  async ({ name, zone, domain, device }) => {
726
768
  try {
@@ -738,14 +780,14 @@ function registerAddressObjectTools(server, registry) {
738
780
  "update_address_object",
739
781
  "Update an existing address object. Only supplied fields are changed (GET-then-PUT). Changes are STAGED; call commit_config to apply.",
740
782
  {
741
- name: import_zod2.z.string(),
742
- type: import_zod2.z.enum(["ipv4", "ipv6", "fqdn", "mac"]),
743
- zone: import_zod2.z.string().optional(),
744
- host: import_zod2.z.string().optional(),
745
- network: import_zod2.z.string().optional(),
746
- subnet_mask: import_zod2.z.string().optional(),
747
- domain: import_zod2.z.string().optional(),
748
- device: import_zod2.z.string().optional()
783
+ name: import_zod3.z.string(),
784
+ type: import_zod3.z.enum(["ipv4", "ipv6", "fqdn", "mac"]),
785
+ zone: import_zod3.z.string().optional(),
786
+ host: import_zod3.z.string().optional(),
787
+ network: import_zod3.z.string().optional(),
788
+ subnet_mask: import_zod3.z.string().optional(),
789
+ domain: import_zod3.z.string().optional(),
790
+ device: import_zod3.z.string().optional()
749
791
  },
750
792
  async ({ name, type, zone, host, network, subnet_mask, domain, device }) => {
751
793
  try {
@@ -770,9 +812,9 @@ function registerAddressObjectTools(server, registry) {
770
812
  "delete_address_object",
771
813
  "Delete an address object by name and type. Changes are STAGED; call commit_config to apply.",
772
814
  {
773
- name: import_zod2.z.string(),
774
- type: import_zod2.z.enum(["ipv4", "ipv6", "fqdn", "mac"]),
775
- device: import_zod2.z.string().optional()
815
+ name: import_zod3.z.string(),
816
+ type: import_zod3.z.enum(["ipv4", "ipv6", "fqdn", "mac"]),
817
+ device: import_zod3.z.string().optional()
776
818
  },
777
819
  async ({ name, type, device }) => {
778
820
  try {
@@ -787,14 +829,14 @@ function registerAddressObjectTools(server, registry) {
787
829
  }
788
830
 
789
831
  // src/tools/address-groups.ts
790
- var import_zod3 = require("zod");
832
+ var import_zod4 = require("zod");
791
833
  function registerAddressGroupTools(server, registry) {
792
834
  server.tool(
793
835
  "list_address_groups",
794
836
  "List address groups on the appliance. type: filter by 'ipv4', 'ipv6', or 'all' (default).",
795
837
  {
796
- type: import_zod3.z.enum(["ipv4", "ipv6", "all"]).optional().default("all"),
797
- device: import_zod3.z.string().optional()
838
+ type: import_zod4.z.enum(["ipv4", "ipv6", "all"]).optional().default("all"),
839
+ device: import_zod4.z.string().optional()
798
840
  },
799
841
  async ({ type, device }) => {
800
842
  try {
@@ -825,9 +867,9 @@ function registerAddressGroupTools(server, registry) {
825
867
  "get_address_group",
826
868
  "Retrieve a single address group by name.",
827
869
  {
828
- name: import_zod3.z.string(),
829
- type: import_zod3.z.enum(["ipv4", "ipv6"]),
830
- device: import_zod3.z.string().optional()
870
+ name: import_zod4.z.string(),
871
+ type: import_zod4.z.enum(["ipv4", "ipv6"]),
872
+ device: import_zod4.z.string().optional()
831
873
  },
832
874
  async ({ name, type, device }) => {
833
875
  try {
@@ -843,10 +885,10 @@ function registerAddressGroupTools(server, registry) {
843
885
  "create_address_group",
844
886
  "Create an address group with the given member object names. members: list of address object names. Changes are STAGED; call commit_config to apply.",
845
887
  {
846
- name: import_zod3.z.string(),
847
- type: import_zod3.z.enum(["ipv4", "ipv6"]),
848
- members: import_zod3.z.array(import_zod3.z.string()),
849
- device: import_zod3.z.string().optional()
888
+ name: import_zod4.z.string(),
889
+ type: import_zod4.z.enum(["ipv4", "ipv6"]),
890
+ members: import_zod4.z.array(import_zod4.z.string()),
891
+ device: import_zod4.z.string().optional()
850
892
  },
851
893
  async ({ name, type, members, device }) => {
852
894
  try {
@@ -865,10 +907,10 @@ function registerAddressGroupTools(server, registry) {
865
907
  "add_address_group_member",
866
908
  "Add a member address object to an existing address group. Changes are STAGED; call commit_config to apply.",
867
909
  {
868
- group_name: import_zod3.z.string(),
869
- type: import_zod3.z.enum(["ipv4", "ipv6"]),
870
- member_name: import_zod3.z.string(),
871
- device: import_zod3.z.string().optional()
910
+ group_name: import_zod4.z.string(),
911
+ type: import_zod4.z.enum(["ipv4", "ipv6"]),
912
+ member_name: import_zod4.z.string(),
913
+ device: import_zod4.z.string().optional()
872
914
  },
873
915
  async ({ group_name, type, member_name, device }) => {
874
916
  try {
@@ -894,10 +936,10 @@ function registerAddressGroupTools(server, registry) {
894
936
  "remove_address_group_member",
895
937
  "Remove a member address object from an address group. Changes are STAGED; call commit_config to apply.",
896
938
  {
897
- group_name: import_zod3.z.string(),
898
- type: import_zod3.z.enum(["ipv4", "ipv6"]),
899
- member_name: import_zod3.z.string(),
900
- device: import_zod3.z.string().optional()
939
+ group_name: import_zod4.z.string(),
940
+ type: import_zod4.z.enum(["ipv4", "ipv6"]),
941
+ member_name: import_zod4.z.string(),
942
+ device: import_zod4.z.string().optional()
901
943
  },
902
944
  async ({ group_name, type, member_name, device }) => {
903
945
  try {
@@ -920,9 +962,9 @@ function registerAddressGroupTools(server, registry) {
920
962
  "delete_address_group",
921
963
  "Delete an address group by name. Changes are STAGED; call commit_config to apply.",
922
964
  {
923
- name: import_zod3.z.string(),
924
- type: import_zod3.z.enum(["ipv4", "ipv6"]),
925
- device: import_zod3.z.string().optional()
965
+ name: import_zod4.z.string(),
966
+ type: import_zod4.z.enum(["ipv4", "ipv6"]),
967
+ device: import_zod4.z.string().optional()
926
968
  },
927
969
  async ({ name, type, device }) => {
928
970
  try {
@@ -937,13 +979,13 @@ function registerAddressGroupTools(server, registry) {
937
979
  }
938
980
 
939
981
  // src/tools/service-objects.ts
940
- var import_zod4 = require("zod");
982
+ var import_zod5 = require("zod");
941
983
  var PROTOCOLS = ["TCP", "UDP", "ICMP", "ICMPv6", "IGMP", "GRE", "ESP", "AH", "OTHER"];
942
984
  function registerServiceObjectTools(server, registry) {
943
985
  server.tool(
944
986
  "list_service_objects",
945
987
  "List all service objects on the appliance.",
946
- { device: import_zod4.z.string().optional() },
988
+ { device: import_zod5.z.string().optional() },
947
989
  async ({ device }) => {
948
990
  try {
949
991
  const client = await registry.getClient(device);
@@ -957,7 +999,7 @@ function registerServiceObjectTools(server, registry) {
957
999
  server.tool(
958
1000
  "get_service_object",
959
1001
  "Retrieve a service object by name.",
960
- { name: import_zod4.z.string(), device: import_zod4.z.string().optional() },
1002
+ { name: import_zod5.z.string(), device: import_zod5.z.string().optional() },
961
1003
  async ({ name, device }) => {
962
1004
  try {
963
1005
  const client = await registry.getClient(device);
@@ -972,13 +1014,13 @@ function registerServiceObjectTools(server, registry) {
972
1014
  "create_service_object",
973
1015
  "Create a service object. For TCP/UDP: provide port_begin (and optionally port_end for a range). For ICMP/ICMPv6: provide icmp_type and optionally icmp_code. Changes are STAGED; call commit_config to apply.",
974
1016
  {
975
- name: import_zod4.z.string(),
976
- protocol: import_zod4.z.enum(PROTOCOLS),
977
- port_begin: import_zod4.z.number().optional(),
978
- port_end: import_zod4.z.number().optional(),
979
- icmp_type: import_zod4.z.number().optional(),
980
- icmp_code: import_zod4.z.number().optional(),
981
- device: import_zod4.z.string().optional()
1017
+ name: import_zod5.z.string(),
1018
+ protocol: import_zod5.z.enum(PROTOCOLS),
1019
+ port_begin: import_zod5.z.number().optional(),
1020
+ port_end: import_zod5.z.number().optional(),
1021
+ icmp_type: import_zod5.z.number().optional(),
1022
+ icmp_code: import_zod5.z.number().optional(),
1023
+ device: import_zod5.z.string().optional()
982
1024
  },
983
1025
  async ({ name, protocol, port_begin, port_end, icmp_type, icmp_code, device }) => {
984
1026
  try {
@@ -1005,12 +1047,12 @@ function registerServiceObjectTools(server, registry) {
1005
1047
  "update_service_object",
1006
1048
  "Update port or ICMP fields on an existing service object (GET-then-PUT). Changes are STAGED; call commit_config to apply.",
1007
1049
  {
1008
- name: import_zod4.z.string(),
1009
- port_begin: import_zod4.z.number().optional(),
1010
- port_end: import_zod4.z.number().optional(),
1011
- icmp_type: import_zod4.z.number().optional(),
1012
- icmp_code: import_zod4.z.number().optional(),
1013
- device: import_zod4.z.string().optional()
1050
+ name: import_zod5.z.string(),
1051
+ port_begin: import_zod5.z.number().optional(),
1052
+ port_end: import_zod5.z.number().optional(),
1053
+ icmp_type: import_zod5.z.number().optional(),
1054
+ icmp_code: import_zod5.z.number().optional(),
1055
+ device: import_zod5.z.string().optional()
1014
1056
  },
1015
1057
  async ({ name, port_begin, port_end, icmp_type, icmp_code, device }) => {
1016
1058
  try {
@@ -1047,7 +1089,7 @@ function registerServiceObjectTools(server, registry) {
1047
1089
  server.tool(
1048
1090
  "delete_service_object",
1049
1091
  "Delete a service object by name. Changes are STAGED; call commit_config to apply.",
1050
- { name: import_zod4.z.string(), device: import_zod4.z.string().optional() },
1092
+ { name: import_zod5.z.string(), device: import_zod5.z.string().optional() },
1051
1093
  async ({ name, device }) => {
1052
1094
  try {
1053
1095
  const client = await registry.getClient(device);
@@ -1061,12 +1103,12 @@ function registerServiceObjectTools(server, registry) {
1061
1103
  }
1062
1104
 
1063
1105
  // src/tools/service-groups.ts
1064
- var import_zod5 = require("zod");
1106
+ var import_zod6 = require("zod");
1065
1107
  function registerServiceGroupTools(server, registry) {
1066
1108
  server.tool(
1067
1109
  "list_service_groups",
1068
1110
  "List all service groups on the appliance.",
1069
- { device: import_zod5.z.string().optional() },
1111
+ { device: import_zod6.z.string().optional() },
1070
1112
  async ({ device }) => {
1071
1113
  try {
1072
1114
  const client = await registry.getClient(device);
@@ -1080,7 +1122,7 @@ function registerServiceGroupTools(server, registry) {
1080
1122
  server.tool(
1081
1123
  "get_service_group",
1082
1124
  "Retrieve a service group by name.",
1083
- { name: import_zod5.z.string(), device: import_zod5.z.string().optional() },
1125
+ { name: import_zod6.z.string(), device: import_zod6.z.string().optional() },
1084
1126
  async ({ name, device }) => {
1085
1127
  try {
1086
1128
  const client = await registry.getClient(device);
@@ -1095,9 +1137,9 @@ function registerServiceGroupTools(server, registry) {
1095
1137
  "create_service_group",
1096
1138
  "Create a service group containing the given service object names. Changes are STAGED; call commit_config to apply.",
1097
1139
  {
1098
- name: import_zod5.z.string(),
1099
- members: import_zod5.z.array(import_zod5.z.string()),
1100
- device: import_zod5.z.string().optional()
1140
+ name: import_zod6.z.string(),
1141
+ members: import_zod6.z.array(import_zod6.z.string()),
1142
+ device: import_zod6.z.string().optional()
1101
1143
  },
1102
1144
  async ({ name, members, device }) => {
1103
1145
  try {
@@ -1115,9 +1157,9 @@ function registerServiceGroupTools(server, registry) {
1115
1157
  "add_service_group_member",
1116
1158
  "Add a service object to an existing service group (GET-then-PUT). Changes are STAGED; call commit_config to apply.",
1117
1159
  {
1118
- group_name: import_zod5.z.string(),
1119
- member_name: import_zod5.z.string(),
1120
- device: import_zod5.z.string().optional()
1160
+ group_name: import_zod6.z.string(),
1161
+ member_name: import_zod6.z.string(),
1162
+ device: import_zod6.z.string().optional()
1121
1163
  },
1122
1164
  async ({ group_name, member_name, device }) => {
1123
1165
  try {
@@ -1141,9 +1183,9 @@ function registerServiceGroupTools(server, registry) {
1141
1183
  "remove_service_group_member",
1142
1184
  "Remove a service object from a service group (GET-then-PUT). Changes are STAGED; call commit_config to apply.",
1143
1185
  {
1144
- group_name: import_zod5.z.string(),
1145
- member_name: import_zod5.z.string(),
1146
- device: import_zod5.z.string().optional()
1186
+ group_name: import_zod6.z.string(),
1187
+ member_name: import_zod6.z.string(),
1188
+ device: import_zod6.z.string().optional()
1147
1189
  },
1148
1190
  async ({ group_name, member_name, device }) => {
1149
1191
  try {
@@ -1163,7 +1205,7 @@ function registerServiceGroupTools(server, registry) {
1163
1205
  server.tool(
1164
1206
  "delete_service_group",
1165
1207
  "Delete a service group by name. Changes are STAGED; call commit_config to apply.",
1166
- { name: import_zod5.z.string(), device: import_zod5.z.string().optional() },
1208
+ { name: import_zod6.z.string(), device: import_zod6.z.string().optional() },
1167
1209
  async ({ name, device }) => {
1168
1210
  try {
1169
1211
  const client = await registry.getClient(device);
@@ -1177,12 +1219,12 @@ function registerServiceGroupTools(server, registry) {
1177
1219
  }
1178
1220
 
1179
1221
  // src/tools/access-rules.ts
1180
- var import_zod6 = require("zod");
1222
+ var import_zod7 = require("zod");
1181
1223
  function zoneName(v) {
1182
1224
  if (typeof v === "string") return v;
1183
1225
  if (v && typeof v === "object") {
1184
- const z15 = v.zone;
1185
- if (typeof z15 === "string") return z15;
1226
+ const z17 = v.zone;
1227
+ if (typeof z17 === "string") return z17;
1186
1228
  }
1187
1229
  return void 0;
1188
1230
  }
@@ -1194,10 +1236,10 @@ function registerAccessRuleTools(server, registry) {
1194
1236
  "list_access_rules",
1195
1237
  "List firewall access rules, optionally filtered by source and/or destination zone. Filtering is applied client-side over the complete ruleset; matched is the number returned and total is the unfiltered rule count (not pagination). Use each rule's uuid value as rule_uuid for get/update/enable/disable/delete tools.",
1196
1238
  {
1197
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1198
- from_zone: import_zod6.z.string().optional(),
1199
- to_zone: import_zod6.z.string().optional(),
1200
- device: import_zod6.z.string().optional()
1239
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1240
+ from_zone: import_zod7.z.string().optional(),
1241
+ to_zone: import_zod7.z.string().optional(),
1242
+ device: import_zod7.z.string().optional()
1201
1243
  },
1202
1244
  async ({ ip_version, from_zone, to_zone, device }) => {
1203
1245
  try {
@@ -1225,9 +1267,9 @@ function registerAccessRuleTools(server, registry) {
1225
1267
  "get_access_rule",
1226
1268
  "Retrieve a single access rule by UUID. Pass a rule's uuid value from list_access_rules as rule_uuid.",
1227
1269
  {
1228
- rule_uuid: import_zod6.z.string().uuid(),
1229
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1230
- device: import_zod6.z.string().optional()
1270
+ rule_uuid: import_zod7.z.string().uuid(),
1271
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1272
+ device: import_zod7.z.string().optional()
1231
1273
  },
1232
1274
  async ({ rule_uuid, ip_version, device }) => {
1233
1275
  try {
@@ -1243,20 +1285,20 @@ function registerAccessRuleTools(server, registry) {
1243
1285
  "create_access_rule",
1244
1286
  "Create a firewall access rule. source/destination/service: name of an existing address/service object or 'Any'. geo_ip_policy: name of a GeoIP policy that already exists on the appliance (GeoIP policies cannot be created or listed via this server \u2014 manage them in the appliance web UI). Changes are STAGED; call commit_config to apply.",
1245
1287
  {
1246
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]),
1247
- name: import_zod6.z.string(),
1248
- action: import_zod6.z.enum(["allow", "deny", "discard"]),
1249
- from_zone: import_zod6.z.string(),
1250
- to_zone: import_zod6.z.string(),
1251
- source: import_zod6.z.string(),
1252
- destination: import_zod6.z.string(),
1253
- service: import_zod6.z.string(),
1254
- enabled: import_zod6.z.boolean().optional().default(true),
1255
- log: import_zod6.z.boolean().optional().default(true),
1256
- priority: import_zod6.z.number().optional(),
1257
- geo_ip_policy: import_zod6.z.string().optional(),
1258
- comment: import_zod6.z.string().optional(),
1259
- device: import_zod6.z.string().optional()
1288
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]),
1289
+ name: import_zod7.z.string(),
1290
+ action: import_zod7.z.enum(["allow", "deny", "discard"]),
1291
+ from_zone: import_zod7.z.string(),
1292
+ to_zone: import_zod7.z.string(),
1293
+ source: import_zod7.z.string(),
1294
+ destination: import_zod7.z.string(),
1295
+ service: import_zod7.z.string(),
1296
+ enabled: import_zod7.z.boolean().optional().default(true),
1297
+ log: import_zod7.z.boolean().optional().default(true),
1298
+ priority: import_zod7.z.number().optional(),
1299
+ geo_ip_policy: import_zod7.z.string().optional(),
1300
+ comment: import_zod7.z.string().optional(),
1301
+ device: import_zod7.z.string().optional()
1260
1302
  },
1261
1303
  async ({ ip_version, name, action, from_zone, to_zone, source, destination, service, enabled, log, priority, geo_ip_policy, comment, device }) => {
1262
1304
  try {
@@ -1288,17 +1330,17 @@ function registerAccessRuleTools(server, registry) {
1288
1330
  "update_access_rule",
1289
1331
  "Update an access rule selected by UUID (GET-then-PUT). Pass a rule's uuid value from list_access_rules as rule_uuid. Only provided fields are changed. geo_ip_policy: name of an existing appliance GeoIP policy, or '' to remove it. Changes are STAGED; call commit_config to apply.",
1290
1332
  {
1291
- rule_uuid: import_zod6.z.string().uuid(),
1292
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1293
- action: import_zod6.z.enum(["allow", "deny", "discard"]).optional(),
1294
- source: import_zod6.z.string().optional(),
1295
- destination: import_zod6.z.string().optional(),
1296
- service: import_zod6.z.string().optional(),
1297
- enabled: import_zod6.z.boolean().optional(),
1298
- log: import_zod6.z.boolean().optional(),
1299
- geo_ip_policy: import_zod6.z.string().optional(),
1300
- comment: import_zod6.z.string().optional(),
1301
- device: import_zod6.z.string().optional()
1333
+ rule_uuid: import_zod7.z.string().uuid(),
1334
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1335
+ action: import_zod7.z.enum(["allow", "deny", "discard"]).optional(),
1336
+ source: import_zod7.z.string().optional(),
1337
+ destination: import_zod7.z.string().optional(),
1338
+ service: import_zod7.z.string().optional(),
1339
+ enabled: import_zod7.z.boolean().optional(),
1340
+ log: import_zod7.z.boolean().optional(),
1341
+ geo_ip_policy: import_zod7.z.string().optional(),
1342
+ comment: import_zod7.z.string().optional(),
1343
+ device: import_zod7.z.string().optional()
1302
1344
  },
1303
1345
  async ({ rule_uuid, ip_version, action, source, destination, service, enabled, log, geo_ip_policy, comment, device }) => {
1304
1346
  try {
@@ -1340,9 +1382,9 @@ function registerAccessRuleTools(server, registry) {
1340
1382
  "delete_access_rule",
1341
1383
  "Delete an access rule by UUID. Copy rule_uuid from list_access_rules. Changes are STAGED; call commit_config to apply.",
1342
1384
  {
1343
- rule_uuid: import_zod6.z.string().uuid(),
1344
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1345
- device: import_zod6.z.string().optional()
1385
+ rule_uuid: import_zod7.z.string().uuid(),
1386
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1387
+ device: import_zod7.z.string().optional()
1346
1388
  },
1347
1389
  async ({ rule_uuid, ip_version, device }) => {
1348
1390
  try {
@@ -1358,9 +1400,9 @@ function registerAccessRuleTools(server, registry) {
1358
1400
  "enable_access_rule",
1359
1401
  "Enable an access rule selected by UUID without modifying other fields. Copy rule_uuid from list_access_rules. Changes are STAGED; call commit_config to apply.",
1360
1402
  {
1361
- rule_uuid: import_zod6.z.string().uuid(),
1362
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1363
- device: import_zod6.z.string().optional()
1403
+ rule_uuid: import_zod7.z.string().uuid(),
1404
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1405
+ device: import_zod7.z.string().optional()
1364
1406
  },
1365
1407
  async ({ rule_uuid, ip_version, device }) => {
1366
1408
  try {
@@ -1383,9 +1425,9 @@ function registerAccessRuleTools(server, registry) {
1383
1425
  "disable_access_rule",
1384
1426
  "Disable an access rule selected by UUID without deleting it. Copy rule_uuid from list_access_rules. Changes are STAGED; call commit_config to apply.",
1385
1427
  {
1386
- rule_uuid: import_zod6.z.string().uuid(),
1387
- ip_version: import_zod6.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1388
- device: import_zod6.z.string().optional()
1428
+ rule_uuid: import_zod7.z.string().uuid(),
1429
+ ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1430
+ device: import_zod7.z.string().optional()
1389
1431
  },
1390
1432
  async ({ rule_uuid, ip_version, device }) => {
1391
1433
  try {
@@ -1407,7 +1449,7 @@ function registerAccessRuleTools(server, registry) {
1407
1449
  }
1408
1450
 
1409
1451
  // src/tools/nat-policies.ts
1410
- var import_zod7 = require("zod");
1452
+ var import_zod8 = require("zod");
1411
1453
  function interfaceValue(value) {
1412
1454
  return value.toLowerCase() === "any" ? "any" : value;
1413
1455
  }
@@ -1424,7 +1466,7 @@ async function resolveRef(client, kind, value, ipVersion, allowOriginal) {
1424
1466
  throw e;
1425
1467
  }
1426
1468
  }
1427
- var prioritySchema = import_zod7.z.union([import_zod7.z.number().int().min(1), import_zod7.z.literal("auto")]).optional().describe("Rule order: lower number = evaluated first. A positive integer sets a manual priority; 'auto' lets SonicOS assign it.");
1469
+ var prioritySchema = import_zod8.z.union([import_zod8.z.number().int().min(1), import_zod8.z.literal("auto")]).optional().describe("Rule order: lower number = evaluated first. A positive integer sets a manual priority; 'auto' lets SonicOS assign it.");
1428
1470
  function priorityField(priority) {
1429
1471
  return priority === "auto" ? { auto: true } : { manual: priority };
1430
1472
  }
@@ -1433,8 +1475,8 @@ function registerNatPolicyTools(server, registry) {
1433
1475
  "list_nat_policies",
1434
1476
  "List all NAT policies. ip_version: 'ipv4' (default) or 'ipv6'. Use each policy's uuid value as policy_uuid for get/update/enable/disable/delete tools.",
1435
1477
  {
1436
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1437
- device: import_zod7.z.string().optional()
1478
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1479
+ device: import_zod8.z.string().optional()
1438
1480
  },
1439
1481
  async ({ ip_version, device }) => {
1440
1482
  try {
@@ -1450,9 +1492,9 @@ function registerNatPolicyTools(server, registry) {
1450
1492
  "get_nat_policy",
1451
1493
  "Retrieve a NAT policy by UUID. Pass a policy's uuid value from list_nat_policies as policy_uuid.",
1452
1494
  {
1453
- policy_uuid: import_zod7.z.string().uuid(),
1454
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1455
- device: import_zod7.z.string().optional()
1495
+ policy_uuid: import_zod8.z.string().uuid(),
1496
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1497
+ device: import_zod8.z.string().optional()
1456
1498
  },
1457
1499
  async ({ policy_uuid, ip_version, device }) => {
1458
1500
  try {
@@ -1468,21 +1510,21 @@ function registerNatPolicyTools(server, registry) {
1468
1510
  "create_nat_policy",
1469
1511
  "Create a NAT policy. Address and service fields take an object or group name (groups are detected automatically) or 'Any'; translated fields also accept 'Original' for no translation. Interfaces take a name like 'X1' or 'Any'. Optional priority sets rule order (lower number = evaluated first). Changes are STAGED; call commit_config to apply.",
1470
1512
  {
1471
- name: import_zod7.z.string(),
1472
- original_source: import_zod7.z.string(),
1473
- translated_source: import_zod7.z.string(),
1474
- original_destination: import_zod7.z.string(),
1475
- translated_destination: import_zod7.z.string(),
1476
- original_service: import_zod7.z.string(),
1477
- translated_service: import_zod7.z.string(),
1478
- inbound_interface: import_zod7.z.string().optional().default("Any"),
1479
- outbound_interface: import_zod7.z.string().optional().default("Any"),
1480
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1481
- enabled: import_zod7.z.boolean().optional().default(true),
1482
- dns_doctoring: import_zod7.z.boolean().optional().default(false),
1513
+ name: import_zod8.z.string(),
1514
+ original_source: import_zod8.z.string(),
1515
+ translated_source: import_zod8.z.string(),
1516
+ original_destination: import_zod8.z.string(),
1517
+ translated_destination: import_zod8.z.string(),
1518
+ original_service: import_zod8.z.string(),
1519
+ translated_service: import_zod8.z.string(),
1520
+ inbound_interface: import_zod8.z.string().optional().default("Any"),
1521
+ outbound_interface: import_zod8.z.string().optional().default("Any"),
1522
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1523
+ enabled: import_zod8.z.boolean().optional().default(true),
1524
+ dns_doctoring: import_zod8.z.boolean().optional().default(false),
1483
1525
  priority: prioritySchema,
1484
- comment: import_zod7.z.string().optional(),
1485
- device: import_zod7.z.string().optional()
1526
+ comment: import_zod8.z.string().optional(),
1527
+ device: import_zod8.z.string().optional()
1486
1528
  },
1487
1529
  async ({ name, original_source, translated_source, original_destination, translated_destination, original_service, translated_service, inbound_interface, outbound_interface, ip_version, enabled, dns_doctoring, priority, comment, device }) => {
1488
1530
  try {
@@ -1515,21 +1557,21 @@ function registerNatPolicyTools(server, registry) {
1515
1557
  "update_nat_policy",
1516
1558
  "Update a NAT policy selected by UUID (GET-then-PUT). Pass a policy's uuid value from list_nat_policies as policy_uuid. dns_doctoring can be changed independently. priority changes rule order (lower number = evaluated first; 'auto' lets SonicOS assign it). Position 1 is held by the built-in IKE policy, so use 2 or higher; an unavailable priority can return success yet be ignored, so confirm with get_nat_policy. Changes are STAGED; call commit_config to apply.",
1517
1559
  {
1518
- policy_uuid: import_zod7.z.string().uuid(),
1519
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1520
- original_source: import_zod7.z.string().optional(),
1521
- translated_source: import_zod7.z.string().optional(),
1522
- original_destination: import_zod7.z.string().optional(),
1523
- translated_destination: import_zod7.z.string().optional(),
1524
- original_service: import_zod7.z.string().optional(),
1525
- translated_service: import_zod7.z.string().optional(),
1526
- inbound_interface: import_zod7.z.string().optional(),
1527
- outbound_interface: import_zod7.z.string().optional(),
1528
- enabled: import_zod7.z.boolean().optional(),
1529
- dns_doctoring: import_zod7.z.boolean().optional(),
1560
+ policy_uuid: import_zod8.z.string().uuid(),
1561
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1562
+ original_source: import_zod8.z.string().optional(),
1563
+ translated_source: import_zod8.z.string().optional(),
1564
+ original_destination: import_zod8.z.string().optional(),
1565
+ translated_destination: import_zod8.z.string().optional(),
1566
+ original_service: import_zod8.z.string().optional(),
1567
+ translated_service: import_zod8.z.string().optional(),
1568
+ inbound_interface: import_zod8.z.string().optional(),
1569
+ outbound_interface: import_zod8.z.string().optional(),
1570
+ enabled: import_zod8.z.boolean().optional(),
1571
+ dns_doctoring: import_zod8.z.boolean().optional(),
1530
1572
  priority: prioritySchema,
1531
- comment: import_zod7.z.string().optional(),
1532
- device: import_zod7.z.string().optional()
1573
+ comment: import_zod8.z.string().optional(),
1574
+ device: import_zod8.z.string().optional()
1533
1575
  },
1534
1576
  async ({ policy_uuid, ip_version, original_source, translated_source, original_destination, translated_destination, original_service, translated_service, inbound_interface, outbound_interface, enabled, dns_doctoring, priority, comment, device }) => {
1535
1577
  try {
@@ -1563,9 +1605,9 @@ function registerNatPolicyTools(server, registry) {
1563
1605
  "delete_nat_policy",
1564
1606
  "Delete a NAT policy by UUID. Copy policy_uuid from list_nat_policies. Changes are STAGED; call commit_config to apply.",
1565
1607
  {
1566
- policy_uuid: import_zod7.z.string().uuid(),
1567
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1568
- device: import_zod7.z.string().optional()
1608
+ policy_uuid: import_zod8.z.string().uuid(),
1609
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1610
+ device: import_zod8.z.string().optional()
1569
1611
  },
1570
1612
  async ({ policy_uuid, ip_version, device }) => {
1571
1613
  try {
@@ -1590,9 +1632,9 @@ function registerNatPolicyTools(server, registry) {
1590
1632
  "enable_nat_policy",
1591
1633
  "Enable a NAT policy selected by UUID without modifying other fields. Copy policy_uuid from list_nat_policies. Changes are STAGED; call commit_config to apply.",
1592
1634
  {
1593
- policy_uuid: import_zod7.z.string().uuid(),
1594
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1595
- device: import_zod7.z.string().optional()
1635
+ policy_uuid: import_zod8.z.string().uuid(),
1636
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1637
+ device: import_zod8.z.string().optional()
1596
1638
  },
1597
1639
  async ({ policy_uuid, ip_version, device }) => {
1598
1640
  try {
@@ -1607,9 +1649,9 @@ function registerNatPolicyTools(server, registry) {
1607
1649
  "disable_nat_policy",
1608
1650
  "Disable a NAT policy selected by UUID without deleting it. Copy policy_uuid from list_nat_policies. Changes are STAGED; call commit_config to apply.",
1609
1651
  {
1610
- policy_uuid: import_zod7.z.string().uuid(),
1611
- ip_version: import_zod7.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1612
- device: import_zod7.z.string().optional()
1652
+ policy_uuid: import_zod8.z.string().uuid(),
1653
+ ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1654
+ device: import_zod8.z.string().optional()
1613
1655
  },
1614
1656
  async ({ policy_uuid, ip_version, device }) => {
1615
1657
  try {
@@ -1623,12 +1665,12 @@ function registerNatPolicyTools(server, registry) {
1623
1665
  }
1624
1666
 
1625
1667
  // src/tools/security-policies.ts
1626
- var import_zod8 = require("zod");
1668
+ var import_zod9 = require("zod");
1627
1669
  function zoneName2(v) {
1628
1670
  if (typeof v === "string") return v;
1629
1671
  if (v && typeof v === "object") {
1630
- const z15 = v.zone;
1631
- if (typeof z15 === "string") return z15;
1672
+ const z17 = v.zone;
1673
+ if (typeof z17 === "string") return z17;
1632
1674
  }
1633
1675
  return void 0;
1634
1676
  }
@@ -1640,10 +1682,10 @@ function registerSecurityPolicyTools(server, registry) {
1640
1682
  "list_security_policies",
1641
1683
  "List security policies, optionally filtered by source and/or destination zone. Filtering is applied client-side (the SonicOS endpoint returns the full ruleset), so use from_zone/to_zone to keep responses small.",
1642
1684
  {
1643
- ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1644
- from_zone: import_zod8.z.string().optional(),
1645
- to_zone: import_zod8.z.string().optional(),
1646
- device: import_zod8.z.string().optional()
1685
+ ip_version: import_zod9.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1686
+ from_zone: import_zod9.z.string().optional(),
1687
+ to_zone: import_zod9.z.string().optional(),
1688
+ device: import_zod9.z.string().optional()
1647
1689
  },
1648
1690
  async ({ ip_version, from_zone, to_zone, device }) => {
1649
1691
  try {
@@ -1671,9 +1713,9 @@ function registerSecurityPolicyTools(server, registry) {
1671
1713
  "get_security_policy",
1672
1714
  "Retrieve a security policy by its numeric ID.",
1673
1715
  {
1674
- policy_id: import_zod8.z.number(),
1675
- ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1676
- device: import_zod8.z.string().optional()
1716
+ policy_id: import_zod9.z.number(),
1717
+ ip_version: import_zod9.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1718
+ device: import_zod9.z.string().optional()
1677
1719
  },
1678
1720
  async ({ policy_id, ip_version, device }) => {
1679
1721
  try {
@@ -1689,20 +1731,20 @@ function registerSecurityPolicyTools(server, registry) {
1689
1731
  "create_security_policy",
1690
1732
  "Create a security policy. action: typically 'allow' or 'deny'. source_address/destination_address: address object or group name, or 'Any'. service: service object or group name, or 'Any'. Changes are STAGED; call commit_config to apply.",
1691
1733
  {
1692
- name: import_zod8.z.string(),
1693
- source_zone: import_zod8.z.string(),
1694
- destination_zone: import_zod8.z.string(),
1695
- source_address: import_zod8.z.string(),
1696
- destination_address: import_zod8.z.string(),
1697
- service: import_zod8.z.string(),
1698
- action: import_zod8.z.string(),
1699
- ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1700
- users: import_zod8.z.array(import_zod8.z.string()).optional(),
1701
- schedule: import_zod8.z.string().optional(),
1702
- enabled: import_zod8.z.boolean().optional().default(true),
1703
- log: import_zod8.z.boolean().optional().default(true),
1704
- comment: import_zod8.z.string().optional(),
1705
- device: import_zod8.z.string().optional()
1734
+ name: import_zod9.z.string(),
1735
+ source_zone: import_zod9.z.string(),
1736
+ destination_zone: import_zod9.z.string(),
1737
+ source_address: import_zod9.z.string(),
1738
+ destination_address: import_zod9.z.string(),
1739
+ service: import_zod9.z.string(),
1740
+ action: import_zod9.z.string(),
1741
+ ip_version: import_zod9.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1742
+ users: import_zod9.z.array(import_zod9.z.string()).optional(),
1743
+ schedule: import_zod9.z.string().optional(),
1744
+ enabled: import_zod9.z.boolean().optional().default(true),
1745
+ log: import_zod9.z.boolean().optional().default(true),
1746
+ comment: import_zod9.z.string().optional(),
1747
+ device: import_zod9.z.string().optional()
1706
1748
  },
1707
1749
  async ({ name, source_zone, destination_zone, source_address, destination_address, service, action, ip_version, users, schedule, enabled, log, comment, device }) => {
1708
1750
  try {
@@ -1734,16 +1776,16 @@ function registerSecurityPolicyTools(server, registry) {
1734
1776
  "update_security_policy",
1735
1777
  "Update fields on an existing security policy (GET-then-PUT). Only provided fields are changed. Changes are STAGED; call commit_config to apply.",
1736
1778
  {
1737
- policy_id: import_zod8.z.number(),
1738
- ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1739
- action: import_zod8.z.string().optional(),
1740
- source_address: import_zod8.z.string().optional(),
1741
- destination_address: import_zod8.z.string().optional(),
1742
- service: import_zod8.z.string().optional(),
1743
- enabled: import_zod8.z.boolean().optional(),
1744
- log: import_zod8.z.boolean().optional(),
1745
- comment: import_zod8.z.string().optional(),
1746
- device: import_zod8.z.string().optional()
1779
+ policy_id: import_zod9.z.number(),
1780
+ ip_version: import_zod9.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1781
+ action: import_zod9.z.string().optional(),
1782
+ source_address: import_zod9.z.string().optional(),
1783
+ destination_address: import_zod9.z.string().optional(),
1784
+ service: import_zod9.z.string().optional(),
1785
+ enabled: import_zod9.z.boolean().optional(),
1786
+ log: import_zod9.z.boolean().optional(),
1787
+ comment: import_zod9.z.string().optional(),
1788
+ device: import_zod9.z.string().optional()
1747
1789
  },
1748
1790
  async ({ policy_id, ip_version, action, source_address, destination_address, service, enabled, log, comment, device }) => {
1749
1791
  try {
@@ -1777,9 +1819,9 @@ function registerSecurityPolicyTools(server, registry) {
1777
1819
  "delete_security_policy",
1778
1820
  "Delete a security policy by ID. Changes are STAGED; call commit_config to apply.",
1779
1821
  {
1780
- policy_id: import_zod8.z.number(),
1781
- ip_version: import_zod8.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1782
- device: import_zod8.z.string().optional()
1822
+ policy_id: import_zod9.z.number(),
1823
+ ip_version: import_zod9.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
1824
+ device: import_zod9.z.string().optional()
1783
1825
  },
1784
1826
  async ({ policy_id, ip_version, device }) => {
1785
1827
  try {
@@ -1794,7 +1836,7 @@ function registerSecurityPolicyTools(server, registry) {
1794
1836
  }
1795
1837
 
1796
1838
  // src/tools/geo-ip.ts
1797
- var import_zod9 = require("zod");
1839
+ var import_zod10 = require("zod");
1798
1840
  function parseGeoLookup(ip, raw) {
1799
1841
  const parsed = {
1800
1842
  ip,
@@ -1839,7 +1881,7 @@ function registerGeoIpTools(server, registry) {
1839
1881
  server.tool(
1840
1882
  "lookup_ip_country",
1841
1883
  "Look up the geographic location of an IP address using the appliance's built-in GeoIP database. Returns country, city, region, and botnet classification if available. Requires an active GeoIP subscription.",
1842
- { ip: import_zod9.z.string(), device: import_zod9.z.string().optional() },
1884
+ { ip: import_zod10.z.string(), device: import_zod10.z.string().optional() },
1843
1885
  async ({ ip, device }) => {
1844
1886
  try {
1845
1887
  const client = await registry.getClient(device);
@@ -1854,7 +1896,7 @@ function registerGeoIpTools(server, registry) {
1854
1896
  }
1855
1897
 
1856
1898
  // src/tools/logs.ts
1857
- var import_zod10 = require("zod");
1899
+ var import_zod11 = require("zod");
1858
1900
  async function getWithFallback(client, candidates) {
1859
1901
  let lastError;
1860
1902
  for (const path of candidates) {
@@ -1874,7 +1916,7 @@ function registerLogTools(server, registry) {
1874
1916
  server.tool(
1875
1917
  "get_log_categories",
1876
1918
  "List SonicOS log category configuration. This describes available event categories; it does not return recorded runtime log entries.",
1877
- { device: import_zod10.z.string().optional() },
1919
+ { device: import_zod11.z.string().optional() },
1878
1920
  async ({ device }) => {
1879
1921
  try {
1880
1922
  const client = await registry.getClient(device);
@@ -1888,7 +1930,7 @@ function registerLogTools(server, registry) {
1888
1930
  server.tool(
1889
1931
  "list_log_event_definitions",
1890
1932
  "List SonicOS event-definition configuration (event names, categories, priorities, and alert/syslog settings). This is not the appliance event history and cannot be searched by IP, message, or timestamp.",
1891
- { device: import_zod10.z.string().optional() },
1933
+ { device: import_zod11.z.string().optional() },
1892
1934
  async ({ device }) => {
1893
1935
  try {
1894
1936
  const client = await registry.getClient(device);
@@ -1902,12 +1944,12 @@ function registerLogTools(server, registry) {
1902
1944
  }
1903
1945
 
1904
1946
  // src/tools/zones.ts
1905
- var import_zod11 = require("zod");
1947
+ var import_zod12 = require("zod");
1906
1948
  function registerZoneTools(server, registry) {
1907
1949
  server.tool(
1908
1950
  "list_zones",
1909
1951
  "List all security zones (LAN, WAN, DMZ, etc.) with their security type and interface membership. Use this to discover valid zone names before creating access rules or security policies.",
1910
- { device: import_zod11.z.string().optional() },
1952
+ { device: import_zod12.z.string().optional() },
1911
1953
  async ({ device }) => {
1912
1954
  try {
1913
1955
  const client = await registry.getClient(device);
@@ -1921,7 +1963,7 @@ function registerZoneTools(server, registry) {
1921
1963
  server.tool(
1922
1964
  "get_zone",
1923
1965
  "Retrieve a single security zone by name.",
1924
- { name: import_zod11.z.string(), device: import_zod11.z.string().optional() },
1966
+ { name: import_zod12.z.string(), device: import_zod12.z.string().optional() },
1925
1967
  async ({ name, device }) => {
1926
1968
  try {
1927
1969
  const client = await registry.getClient(device);
@@ -1935,7 +1977,7 @@ function registerZoneTools(server, registry) {
1935
1977
  }
1936
1978
 
1937
1979
  // src/tools/interfaces.ts
1938
- var import_zod12 = require("zod");
1980
+ var import_zod13 = require("zod");
1939
1981
  var SECRET_FIELD = /(?:password|passwd|secret|private_key|pre_shared_key|community)$/i;
1940
1982
  function redactSecrets(value) {
1941
1983
  if (Array.isArray(value)) return value.map(redactSecrets);
@@ -1951,7 +1993,7 @@ function registerInterfaceTools(server, registry) {
1951
1993
  server.tool(
1952
1994
  "list_interfaces",
1953
1995
  "List IPv4 network interfaces with their IP assignment, zone, and mode (static/DHCP). Use this to discover the appliance's addressing and which interfaces belong to which zone.",
1954
- { device: import_zod12.z.string().optional() },
1996
+ { device: import_zod13.z.string().optional() },
1955
1997
  async ({ device }) => {
1956
1998
  try {
1957
1999
  const client = await registry.getClient(device);
@@ -1965,7 +2007,7 @@ function registerInterfaceTools(server, registry) {
1965
2007
  server.tool(
1966
2008
  "get_interface",
1967
2009
  'Retrieve a single IPv4 interface by name (e.g. "X0").',
1968
- { name: import_zod12.z.string(), device: import_zod12.z.string().optional() },
2010
+ { name: import_zod13.z.string(), device: import_zod13.z.string().optional() },
1969
2011
  async ({ name, device }) => {
1970
2012
  try {
1971
2013
  const client = await registry.getClient(device);
@@ -1979,12 +2021,12 @@ function registerInterfaceTools(server, registry) {
1979
2021
  }
1980
2022
 
1981
2023
  // src/tools/schedules.ts
1982
- var import_zod13 = require("zod");
2024
+ var import_zod14 = require("zod");
1983
2025
  function registerScheduleTools(server, registry) {
1984
2026
  server.tool(
1985
2027
  "list_schedules",
1986
2028
  'List schedule objects (recurring time windows like "Work Hours"). Security policies reference schedules by name to restrict when a rule is active \u2014 use this to discover valid schedule names.',
1987
- { device: import_zod13.z.string().optional() },
2029
+ { device: import_zod14.z.string().optional() },
1988
2030
  async ({ device }) => {
1989
2031
  try {
1990
2032
  const client = await registry.getClient(device);
@@ -1998,7 +2040,7 @@ function registerScheduleTools(server, registry) {
1998
2040
  server.tool(
1999
2041
  "get_schedule",
2000
2042
  "Retrieve a single schedule object by name.",
2001
- { name: import_zod13.z.string(), device: import_zod13.z.string().optional() },
2043
+ { name: import_zod14.z.string(), device: import_zod14.z.string().optional() },
2002
2044
  async ({ name, device }) => {
2003
2045
  try {
2004
2046
  const client = await registry.getClient(device);
@@ -2012,14 +2054,14 @@ function registerScheduleTools(server, registry) {
2012
2054
  }
2013
2055
 
2014
2056
  // src/tools/route-policies.ts
2015
- var import_zod14 = require("zod");
2057
+ var import_zod15 = require("zod");
2016
2058
  function registerRoutePolicyTools(server, registry) {
2017
2059
  server.tool(
2018
2060
  "list_route_policies",
2019
2061
  "List static/policy-based routes with their destination, gateway, interface, and metric. Useful for understanding how traffic is routed off the appliance.",
2020
2062
  {
2021
- ip_version: import_zod14.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
2022
- device: import_zod14.z.string().optional()
2063
+ ip_version: import_zod15.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
2064
+ device: import_zod15.z.string().optional()
2023
2065
  },
2024
2066
  async ({ ip_version, device }) => {
2025
2067
  try {
@@ -2112,6 +2154,38 @@ function createHttpServer(factory, o) {
2112
2154
  });
2113
2155
  }
2114
2156
 
2157
+ // src/package-info.ts
2158
+ var import_node_fs = require("fs");
2159
+ var import_node_path = require("path");
2160
+ var packageJson = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(__dirname, "..", "package.json"), "utf8"));
2161
+ var packageName = packageJson.name ?? "sonicwall-api-mcp-server";
2162
+ var packageVersion = packageJson.version ?? "0.0.0";
2163
+
2164
+ // src/strict-tools.ts
2165
+ var import_zod16 = require("zod");
2166
+ function isSchema(value) {
2167
+ return typeof value === "object" && value !== null && "_def" in value;
2168
+ }
2169
+ function isRawShape(value) {
2170
+ if (typeof value !== "object" || value === null || isSchema(value)) return false;
2171
+ const values = Object.values(value);
2172
+ return values.length === 0 || values.some(isSchema);
2173
+ }
2174
+ function strictSchema(schema) {
2175
+ if (schema === void 0) return import_zod16.z.object({}).strict();
2176
+ if (isRawShape(schema)) return import_zod16.z.object(schema).strict();
2177
+ if (isSchema(schema) && typeof schema.strict === "function") return schema.strict();
2178
+ return schema;
2179
+ }
2180
+ function enforceStrictToolInputs(server) {
2181
+ const mutable = server;
2182
+ const createRegisteredTool = mutable._createRegisteredTool.bind(server);
2183
+ mutable._createRegisteredTool = (...args) => {
2184
+ args[3] = strictSchema(args[3]);
2185
+ return createRegisteredTool(...args);
2186
+ };
2187
+ }
2188
+
2115
2189
  // src/index.ts
2116
2190
  async function main() {
2117
2191
  let config;
@@ -2131,8 +2205,8 @@ async function main() {
2131
2205
  const registry = new DeviceRegistry(config.profiles);
2132
2206
  const createConfiguredServer = () => {
2133
2207
  const server = new import_mcp.McpServer({
2134
- name: "sonicwall-mcp-server",
2135
- version: "0.8.0",
2208
+ name: packageName,
2209
+ version: packageVersion,
2136
2210
  instructions: `SonicWall NSA MCP server \u2014 full read/write access to SonicWall firewalls via the SonicOS REST API.
2137
2211
 
2138
2212
  ## Device targeting
@@ -2160,6 +2234,7 @@ The SonicOS REST API is configuration-focused. Connection/flow ("traffic") logs
2160
2234
  ## Concurrent sessions
2161
2235
  SonicOS allows only ONE concurrent API session per appliance. If a session error occurs, an existing admin or API session may need to be ended first.`
2162
2236
  });
2237
+ enforceStrictToolInputs(server);
2163
2238
  registerSystemTools(server, registry);
2164
2239
  registerAddressObjectTools(server, registry);
2165
2240
  registerAddressGroupTools(server, registry);
@@ -2181,8 +2256,8 @@ SonicOS allows only ONE concurrent API session per appliance. If a session error
2181
2256
  await createConfiguredServer().connect(new import_stdio.StdioServerTransport());
2182
2257
  } else if (transport === "http") {
2183
2258
  const host = process.env["SONICWALL_HTTP_HOST"] ?? "127.0.0.1";
2184
- const port = Number.parseInt(process.env["SONICWALL_HTTP_PORT"] ?? "3000", 10);
2185
- createHttpServer(createConfiguredServer, { host, port, serverName: "@teamnetwork-nz/sonicwall-api-mcp-server", bearerToken: process.env["SONICWALL_HTTP_BEARER_TOKEN"], allowedHosts: process.env["SONICWALL_HTTP_ALLOWED_HOSTS"]?.split(",").map((v) => v.trim()).filter(Boolean), allowedOrigins: process.env["SONICWALL_HTTP_ALLOWED_ORIGINS"]?.split(",").map((v) => v.trim()).filter(Boolean), maxBodyBytes: Number.parseInt(process.env["SONICWALL_HTTP_MAX_BODY_BYTES"] ?? "1048576", 10) }).listen(port, host, () => process.stderr.write(`sonicwall-mcp: HTTP listening on ${host}:${port}/mcp
2259
+ const port = parsePositiveInt("SONICWALL_HTTP_PORT", process.env["SONICWALL_HTTP_PORT"], 3e3, 65535);
2260
+ createHttpServer(createConfiguredServer, { host, port, serverName: packageName, bearerToken: process.env["SONICWALL_HTTP_BEARER_TOKEN"], allowedHosts: process.env["SONICWALL_HTTP_ALLOWED_HOSTS"]?.split(",").map((v) => v.trim()).filter(Boolean), allowedOrigins: process.env["SONICWALL_HTTP_ALLOWED_ORIGINS"]?.split(",").map((v) => v.trim()).filter(Boolean), maxBodyBytes: parsePositiveInt("SONICWALL_HTTP_MAX_BODY_BYTES", process.env["SONICWALL_HTTP_MAX_BODY_BYTES"], 1048576, 16777216) }).listen(port, host, () => process.stderr.write(`sonicwall-mcp: HTTP listening on ${host}:${port}/mcp
2186
2261
  `));
2187
2262
  } else {
2188
2263
  process.stderr.write(
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/strict-tools.ts
22
+ var strict_tools_exports = {};
23
+ __export(strict_tools_exports, {
24
+ enforceStrictToolInputs: () => enforceStrictToolInputs
25
+ });
26
+ module.exports = __toCommonJS(strict_tools_exports);
27
+ var import_zod = require("zod");
28
+ function isSchema(value) {
29
+ return typeof value === "object" && value !== null && "_def" in value;
30
+ }
31
+ function isRawShape(value) {
32
+ if (typeof value !== "object" || value === null || isSchema(value)) return false;
33
+ const values = Object.values(value);
34
+ return values.length === 0 || values.some(isSchema);
35
+ }
36
+ function strictSchema(schema) {
37
+ if (schema === void 0) return import_zod.z.object({}).strict();
38
+ if (isRawShape(schema)) return import_zod.z.object(schema).strict();
39
+ if (isSchema(schema) && typeof schema.strict === "function") return schema.strict();
40
+ return schema;
41
+ }
42
+ function enforceStrictToolInputs(server) {
43
+ const mutable = server;
44
+ const createRegisteredTool = mutable._createRegisteredTool.bind(server);
45
+ mutable._createRegisteredTool = (...args) => {
46
+ args[3] = strictSchema(args[3]);
47
+ return createRegisteredTool(...args);
48
+ };
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ enforceStrictToolInputs
53
+ });
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/write-gate.ts
22
+ var write_gate_exports = {};
23
+ __export(write_gate_exports, {
24
+ readWriteEnabled: () => readWriteEnabled
25
+ });
26
+ module.exports = __toCommonJS(write_gate_exports);
27
+ function readWriteEnabled(canonicalName, legacy, env = process.env) {
28
+ const canonical = env[canonicalName];
29
+ if (canonical !== void 0) return canonical.toLowerCase() === "true";
30
+ if (!legacy || env[legacy.name] === void 0) return false;
31
+ process.stderr.write(`[deprecated] ${legacy.name} is deprecated; use ${canonicalName}=true to enable writes.
32
+ `);
33
+ const value = env[legacy.name].toLowerCase();
34
+ return legacy.readonlySemantics ? value === "false" : value === "true";
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ readWriteEnabled
39
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamnetwork-nz/sonicwall-api-mcp-server",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "MCP server for SonicWall NSA appliance configuration — objects, rules, NAT, routing, and GeoIP lookup",
5
5
  "keywords": [
6
6
  "mcp",
@@ -41,8 +41,8 @@
41
41
  "node": ">=18"
42
42
  },
43
43
  "dependencies": {
44
- "@modelcontextprotocol/sdk": "^1.10.0",
45
- "zod": "^3.23.0"
44
+ "@modelcontextprotocol/sdk": "^1.29.0",
45
+ "zod": "^3.25.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^20.0.0",