@solongate/proxy 0.5.1 → 0.5.2

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
@@ -569,8 +569,10 @@ function isAlreadyProtected(server) {
569
569
  }
570
570
  return false;
571
571
  }
572
- function wrapServer(server, policy) {
573
- const result = {
572
+ function wrapServer(server, policy, apiKey) {
573
+ const env = { ...server.env ?? {} };
574
+ env.SOLONGATE_API_KEY = apiKey;
575
+ return {
574
576
  command: "npx",
575
577
  args: [
576
578
  "-y",
@@ -581,12 +583,9 @@ function wrapServer(server, policy) {
581
583
  "--",
582
584
  server.command,
583
585
  ...server.args ?? []
584
- ]
586
+ ],
587
+ env
585
588
  };
586
- if (server.env && Object.keys(server.env).length > 0) {
587
- result.env = { ...server.env };
588
- }
589
- return result;
590
589
  }
591
590
  async function prompt(question) {
592
591
  const rl = createInterface({ input: process.stdin, output: process.stderr });
@@ -899,7 +898,7 @@ async function main() {
899
898
  const newConfig = { mcpServers: {} };
900
899
  for (const name of serverNames) {
901
900
  if (toProtect.includes(name)) {
902
- newConfig.mcpServers[name] = wrapServer(config.mcpServers[name], options.policy);
901
+ newConfig.mcpServers[name] = wrapServer(config.mcpServers[name], options.policy, apiKey);
903
902
  } else {
904
903
  newConfig.mcpServers[name] = config.mcpServers[name];
905
904
  }
package/dist/init.js CHANGED
@@ -65,8 +65,10 @@ function isAlreadyProtected(server) {
65
65
  }
66
66
  return false;
67
67
  }
68
- function wrapServer(server, policy) {
69
- const result = {
68
+ function wrapServer(server, policy, apiKey) {
69
+ const env = { ...server.env ?? {} };
70
+ env.SOLONGATE_API_KEY = apiKey;
71
+ return {
70
72
  command: "npx",
71
73
  args: [
72
74
  "-y",
@@ -77,12 +79,9 @@ function wrapServer(server, policy) {
77
79
  "--",
78
80
  server.command,
79
81
  ...server.args ?? []
80
- ]
82
+ ],
83
+ env
81
84
  };
82
- if (server.env && Object.keys(server.env).length > 0) {
83
- result.env = { ...server.env };
84
- }
85
- return result;
86
85
  }
87
86
  async function prompt(question) {
88
87
  const rl = createInterface({ input: process.stdin, output: process.stderr });
@@ -601,7 +600,7 @@ async function main() {
601
600
  const newConfig = { mcpServers: {} };
602
601
  for (const name of serverNames) {
603
602
  if (toProtect.includes(name)) {
604
- newConfig.mcpServers[name] = wrapServer(config.mcpServers[name], options.policy);
603
+ newConfig.mcpServers[name] = wrapServer(config.mcpServers[name], options.policy, apiKey);
605
604
  } else {
606
605
  newConfig.mcpServers[name] = config.mcpServers[name];
607
606
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "MCP security proxy — protect any MCP server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
5
5
  "type": "module",
6
6
  "bin": {