@teamnetwork-nz/sonicwall-api-mcp-server 0.7.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/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,18 +1896,18 @@ 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) {
1861
1903
  try {
1862
1904
  return await client.get(path);
1863
- } catch (error) {
1864
- if (error instanceof APIError && (error.status === 400 || error.status === 404)) {
1865
- lastError = error;
1905
+ } catch (error2) {
1906
+ if (error2 instanceof APIError && (error2.status === 400 || error2.status === 404)) {
1907
+ lastError = error2;
1866
1908
  continue;
1867
1909
  }
1868
- throw error;
1910
+ throw error2;
1869
1911
  }
1870
1912
  }
1871
1913
  throw lastError;
@@ -1874,40 +1916,40 @@ 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);
1881
1923
  const result = await getWithFallback(client, ["log/categories", "reporting/log/categories"]);
1882
1924
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
1883
- } catch (error) {
1884
- return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true };
1925
+ } catch (error2) {
1926
+ return { content: [{ type: "text", text: `Error: ${error2.message}` }], isError: true };
1885
1927
  }
1886
1928
  }
1887
1929
  );
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);
1895
1937
  const result = await getWithFallback(client, ["log/events", "reporting/log/events"]);
1896
1938
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
1897
- } catch (error) {
1898
- return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true };
1939
+ } catch (error2) {
1940
+ return { content: [{ type: "text", text: `Error: ${error2.message}` }], isError: true };
1899
1941
  }
1900
1942
  }
1901
1943
  );
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,17 +1977,28 @@ 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");
1981
+ var SECRET_FIELD = /(?:password|passwd|secret|private_key|pre_shared_key|community)$/i;
1982
+ function redactSecrets(value) {
1983
+ if (Array.isArray(value)) return value.map(redactSecrets);
1984
+ if (!value || typeof value !== "object") return value;
1985
+ return Object.fromEntries(
1986
+ Object.entries(value).map(([key, nested]) => [
1987
+ key,
1988
+ SECRET_FIELD.test(key) ? "[REDACTED]" : redactSecrets(nested)
1989
+ ])
1990
+ );
1991
+ }
1939
1992
  function registerInterfaceTools(server, registry) {
1940
1993
  server.tool(
1941
1994
  "list_interfaces",
1942
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.",
1943
- { device: import_zod12.z.string().optional() },
1996
+ { device: import_zod13.z.string().optional() },
1944
1997
  async ({ device }) => {
1945
1998
  try {
1946
1999
  const client = await registry.getClient(device);
1947
2000
  const result = await client.get("interfaces/ipv4");
1948
- return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
2001
+ return { content: [{ type: "text", text: JSON.stringify(redactSecrets(result), null, 2) }] };
1949
2002
  } catch (e) {
1950
2003
  return { content: [{ type: "text", text: `Error: ${e.message}` }], isError: true };
1951
2004
  }
@@ -1954,12 +2007,12 @@ function registerInterfaceTools(server, registry) {
1954
2007
  server.tool(
1955
2008
  "get_interface",
1956
2009
  'Retrieve a single IPv4 interface by name (e.g. "X0").',
1957
- { name: import_zod12.z.string(), device: import_zod12.z.string().optional() },
2010
+ { name: import_zod13.z.string(), device: import_zod13.z.string().optional() },
1958
2011
  async ({ name, device }) => {
1959
2012
  try {
1960
2013
  const client = await registry.getClient(device);
1961
2014
  const result = await client.get(`interfaces/ipv4/name/${encodeURIComponent(name)}`);
1962
- return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
2015
+ return { content: [{ type: "text", text: JSON.stringify(redactSecrets(result), null, 2) }] };
1963
2016
  } catch (e) {
1964
2017
  return { content: [{ type: "text", text: `Error: ${e.message}` }], isError: true };
1965
2018
  }
@@ -1968,12 +2021,12 @@ function registerInterfaceTools(server, registry) {
1968
2021
  }
1969
2022
 
1970
2023
  // src/tools/schedules.ts
1971
- var import_zod13 = require("zod");
2024
+ var import_zod14 = require("zod");
1972
2025
  function registerScheduleTools(server, registry) {
1973
2026
  server.tool(
1974
2027
  "list_schedules",
1975
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.',
1976
- { device: import_zod13.z.string().optional() },
2029
+ { device: import_zod14.z.string().optional() },
1977
2030
  async ({ device }) => {
1978
2031
  try {
1979
2032
  const client = await registry.getClient(device);
@@ -1987,7 +2040,7 @@ function registerScheduleTools(server, registry) {
1987
2040
  server.tool(
1988
2041
  "get_schedule",
1989
2042
  "Retrieve a single schedule object by name.",
1990
- { name: import_zod13.z.string(), device: import_zod13.z.string().optional() },
2043
+ { name: import_zod14.z.string(), device: import_zod14.z.string().optional() },
1991
2044
  async ({ name, device }) => {
1992
2045
  try {
1993
2046
  const client = await registry.getClient(device);
@@ -2001,14 +2054,14 @@ function registerScheduleTools(server, registry) {
2001
2054
  }
2002
2055
 
2003
2056
  // src/tools/route-policies.ts
2004
- var import_zod14 = require("zod");
2057
+ var import_zod15 = require("zod");
2005
2058
  function registerRoutePolicyTools(server, registry) {
2006
2059
  server.tool(
2007
2060
  "list_route_policies",
2008
2061
  "List static/policy-based routes with their destination, gateway, interface, and metric. Useful for understanding how traffic is routed off the appliance.",
2009
2062
  {
2010
- ip_version: import_zod14.z.enum(["ipv4", "ipv6"]).optional().default("ipv4"),
2011
- 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()
2012
2065
  },
2013
2066
  async ({ ip_version, device }) => {
2014
2067
  try {
@@ -2022,6 +2075,117 @@ function registerRoutePolicyTools(server, registry) {
2022
2075
  );
2023
2076
  }
2024
2077
 
2078
+ // src/http-server.ts
2079
+ var import_node_crypto = require("crypto");
2080
+ var import_node_http = __toESM(require("http"));
2081
+ var import_streamableHttp = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
2082
+ var loopback = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "localhost"]);
2083
+ var send = (res, status, body) => {
2084
+ res.writeHead(status, { "Content-Type": "application/json" }).end(JSON.stringify(body));
2085
+ };
2086
+ var error = (res, status, code, message) => send(res, status, { jsonrpc: "2.0", error: { code, message }, id: null });
2087
+ var matches = (value, expected) => {
2088
+ if (!value?.startsWith("Bearer ")) return false;
2089
+ const supplied = Buffer.from(value.slice(7));
2090
+ const wanted = Buffer.from(expected);
2091
+ return supplied.length === wanted.length && (0, import_node_crypto.timingSafeEqual)(supplied, wanted);
2092
+ };
2093
+ var readBody = (req, limit) => new Promise((resolve, reject) => {
2094
+ const chunks = [];
2095
+ let size = 0;
2096
+ let oversized = false;
2097
+ req.on("data", (chunk) => {
2098
+ size += chunk.length;
2099
+ oversized ||= size > limit;
2100
+ if (!oversized) chunks.push(chunk);
2101
+ });
2102
+ req.on("end", () => {
2103
+ if (oversized) return reject(Object.assign(new Error("Request body too large"), { statusCode: 413 }));
2104
+ try {
2105
+ resolve(JSON.parse(Buffer.concat(chunks).toString("utf8")));
2106
+ } catch {
2107
+ reject(Object.assign(new Error("Invalid JSON body"), { statusCode: 400 }));
2108
+ }
2109
+ });
2110
+ req.on("error", reject);
2111
+ });
2112
+ function validateHttpOptions(o) {
2113
+ if (!Number.isInteger(o.port) || o.port < 1 || o.port > 65535) throw new Error(`Invalid HTTP port: ${o.port}`);
2114
+ if (o.maxBodyBytes !== void 0 && (!Number.isInteger(o.maxBodyBytes) || o.maxBodyBytes < 1)) throw new Error(`Invalid HTTP body limit: ${o.maxBodyBytes}`);
2115
+ if (!loopback.has(o.host) && !o.bearerToken) throw new Error("A bearer token is required when binding beyond loopback");
2116
+ if (!loopback.has(o.host) && !o.allowedHosts?.length) throw new Error("HTTP_ALLOWED_HOSTS is required when binding beyond loopback");
2117
+ }
2118
+ function createHttpServer(factory, o) {
2119
+ validateHttpOptions(o);
2120
+ const hosts = new Set(o.allowedHosts?.map((v) => v.toLowerCase()));
2121
+ const origins = new Set(o.allowedOrigins?.map((v) => v.toLowerCase()));
2122
+ return import_node_http.default.createServer(async (req, res) => {
2123
+ const path = new URL(req.url ?? "/", "http://localhost").pathname;
2124
+ if (path === "/health") return send(res, 200, { status: "ok", server: o.serverName });
2125
+ if (path !== "/mcp") return void res.writeHead(404).end();
2126
+ if (hosts.size && !hosts.has((req.headers.host ?? "").toLowerCase())) return error(res, 403, -32e3, "Host not allowed");
2127
+ if (req.headers.origin && !origins.has(req.headers.origin.toLowerCase())) return error(res, 403, -32e3, "Origin not allowed");
2128
+ if (o.bearerToken && !matches(req.headers.authorization, o.bearerToken)) {
2129
+ res.setHeader("WWW-Authenticate", "Bearer");
2130
+ return error(res, 401, -32001, "Unauthorized");
2131
+ }
2132
+ if (req.method !== "POST") {
2133
+ res.setHeader("Allow", "POST");
2134
+ return error(res, 405, -32e3, "Method not allowed");
2135
+ }
2136
+ const server = factory();
2137
+ const transport = new import_streamableHttp.StreamableHTTPServerTransport({ sessionIdGenerator: void 0 });
2138
+ try {
2139
+ const body = await readBody(req, o.maxBodyBytes ?? 1048576);
2140
+ await server.connect(transport);
2141
+ await transport.handleRequest(req, res, body);
2142
+ res.once("close", () => {
2143
+ void transport.close();
2144
+ void server.close();
2145
+ });
2146
+ } catch (cause) {
2147
+ void transport.close();
2148
+ void server.close();
2149
+ if (!res.headersSent) {
2150
+ const status = cause.statusCode ?? 500;
2151
+ error(res, status, status === 400 ? -32700 : -32603, status < 500 ? cause.message : "Internal server error");
2152
+ }
2153
+ }
2154
+ });
2155
+ }
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
+
2025
2189
  // src/index.ts
2026
2190
  async function main() {
2027
2191
  let config;
@@ -2039,10 +2203,11 @@ async function main() {
2039
2203
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
2040
2204
  }
2041
2205
  const registry = new DeviceRegistry(config.profiles);
2042
- const server = new import_mcp.McpServer({
2043
- name: "sonicwall-mcp-server",
2044
- version: "0.7.0",
2045
- instructions: `SonicWall NSA MCP server \u2014 full read/write access to SonicWall firewalls via the SonicOS REST API.
2206
+ const createConfiguredServer = () => {
2207
+ const server = new import_mcp.McpServer({
2208
+ name: packageName,
2209
+ version: packageVersion,
2210
+ instructions: `SonicWall NSA MCP server \u2014 full read/write access to SonicWall firewalls via the SonicOS REST API.
2046
2211
 
2047
2212
  ## Device targeting
2048
2213
  Use list_devices to discover available appliances and their names. Pass device='<name>' to target a specific appliance; omit it to use the primary/default device.
@@ -2068,28 +2233,35 @@ The SonicOS REST API is configuration-focused. Connection/flow ("traffic") logs
2068
2233
 
2069
2234
  ## Concurrent sessions
2070
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.`
2071
- });
2072
- registerSystemTools(server, registry);
2073
- registerAddressObjectTools(server, registry);
2074
- registerAddressGroupTools(server, registry);
2075
- registerServiceObjectTools(server, registry);
2076
- registerServiceGroupTools(server, registry);
2077
- registerAccessRuleTools(server, registry);
2078
- registerNatPolicyTools(server, registry);
2079
- registerSecurityPolicyTools(server, registry);
2080
- registerGeoIpTools(server, registry);
2081
- registerLogTools(server, registry);
2082
- registerZoneTools(server, registry);
2083
- registerInterfaceTools(server, registry);
2084
- registerScheduleTools(server, registry);
2085
- registerRoutePolicyTools(server, registry);
2236
+ });
2237
+ enforceStrictToolInputs(server);
2238
+ registerSystemTools(server, registry);
2239
+ registerAddressObjectTools(server, registry);
2240
+ registerAddressGroupTools(server, registry);
2241
+ registerServiceObjectTools(server, registry);
2242
+ registerServiceGroupTools(server, registry);
2243
+ registerAccessRuleTools(server, registry);
2244
+ registerNatPolicyTools(server, registry);
2245
+ registerSecurityPolicyTools(server, registry);
2246
+ registerGeoIpTools(server, registry);
2247
+ registerLogTools(server, registry);
2248
+ registerZoneTools(server, registry);
2249
+ registerInterfaceTools(server, registry);
2250
+ registerScheduleTools(server, registry);
2251
+ registerRoutePolicyTools(server, registry);
2252
+ return server;
2253
+ };
2086
2254
  const transport = config.transport;
2087
2255
  if (transport === "stdio") {
2088
- const t = new import_stdio.StdioServerTransport();
2089
- await server.connect(t);
2256
+ await createConfiguredServer().connect(new import_stdio.StdioServerTransport());
2257
+ } else if (transport === "http") {
2258
+ const host = process.env["SONICWALL_HTTP_HOST"] ?? "127.0.0.1";
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
2261
+ `));
2090
2262
  } else {
2091
2263
  process.stderr.write(
2092
- `sonicwall-mcp: transport '${transport}' is not yet supported in the TypeScript version. Use stdio.
2264
+ `sonicwall-mcp: unsupported transport '${transport}'. Use stdio or http.
2093
2265
  `
2094
2266
  );
2095
2267
  process.exit(1);