@solongate/proxy 0.27.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -480,7 +480,7 @@ function findConfigFile(explicitPath, createIfMissing = false) {
480
480
  mcpServers: {
481
481
  "filesystem": {
482
482
  command: "npx",
483
- args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
483
+ args: ["-y", "@modelcontextprotocol/server-filesystem@latest", "."]
484
484
  },
485
485
  "playwright": {
486
486
  command: "npx",
@@ -5789,13 +5789,12 @@ var SolonGateProxy = class {
5789
5789
  httpAgentInfo = /* @__PURE__ */ new Map();
5790
5790
  /** Per-request sub-agent info from HTTP headers (transient, overwritten per request) */
5791
5791
  httpSubAgent = null;
5792
+ /** Server label from --agent-name flag (e.g. "filesystem", "playwright") */
5793
+ serverLabel = null;
5792
5794
  constructor(config) {
5793
5795
  this.config = config;
5794
5796
  this.guardConfig = config.advancedDetection ? { ...DEFAULT_INPUT_GUARD_CONFIG, advancedDetection: config.advancedDetection } : DEFAULT_INPUT_GUARD_CONFIG;
5795
- if (config.agentName) {
5796
- this.agentName = config.agentName;
5797
- this.agentId = config.agentName.toLowerCase().replace(/\s+/g, "-");
5798
- }
5797
+ this.serverLabel = config.agentName ?? null;
5799
5798
  this.gate = new SolonGate({
5800
5799
  name: config.name ?? "solongate-proxy",
5801
5800
  apiKey: "sg_test_proxy_internal_00000000",
@@ -6006,12 +6005,21 @@ var SolonGateProxy = class {
6006
6005
  }
6007
6006
  );
6008
6007
  this.server.oninitialized = () => {
6009
- if (!this.agentId && this.server) {
6008
+ if (this.server) {
6010
6009
  const clientVersion = this.server.getClientVersion();
6011
- if (clientVersion?.name) {
6012
- this.agentId = clientVersion.version ? `${clientVersion.name}/${clientVersion.version}` : clientVersion.name;
6013
- this.agentName = clientVersion.name;
6014
- log2(`Agent identified from MCP clientInfo: ${this.agentName} (${this.agentId})`);
6010
+ const clientName = clientVersion?.name ?? null;
6011
+ if (clientName && this.serverLabel) {
6012
+ this.agentId = `${clientName}/${this.serverLabel}`;
6013
+ this.agentName = `${clientName} (${this.serverLabel})`;
6014
+ } else if (clientName) {
6015
+ this.agentId = clientVersion?.version ? `${clientName}/${clientVersion.version}` : clientName;
6016
+ this.agentName = clientName;
6017
+ } else if (this.serverLabel) {
6018
+ this.agentId = this.serverLabel.toLowerCase().replace(/\s+/g, "-");
6019
+ this.agentName = this.serverLabel;
6020
+ }
6021
+ if (this.agentId) {
6022
+ log2(`Agent identified: ${this.agentName} (${this.agentId})`);
6015
6023
  }
6016
6024
  }
6017
6025
  };
@@ -6449,8 +6457,13 @@ ${msg.content.text}`;
6449
6457
  const headerAgentId = req.headers["x-agent-id"];
6450
6458
  const headerAgentName = req.headers["x-agent-name"];
6451
6459
  if (headerAgentId) {
6452
- this.agentId = headerAgentId;
6453
- this.agentName = headerAgentName || headerAgentId;
6460
+ if (this.serverLabel) {
6461
+ this.agentId = `${headerAgentId}/${this.serverLabel}`;
6462
+ this.agentName = `${headerAgentName || headerAgentId} (${this.serverLabel})`;
6463
+ } else {
6464
+ this.agentId = headerAgentId;
6465
+ this.agentName = headerAgentName || headerAgentId;
6466
+ }
6454
6467
  log2(`Agent identified from HTTP headers: ${this.agentName} (${this.agentId})`);
6455
6468
  }
6456
6469
  }
package/dist/init.js CHANGED
@@ -61,7 +61,7 @@ function findConfigFile(explicitPath, createIfMissing = false) {
61
61
  mcpServers: {
62
62
  "filesystem": {
63
63
  command: "npx",
64
- args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
64
+ args: ["-y", "@modelcontextprotocol/server-filesystem@latest", "."]
65
65
  },
66
66
  "playwright": {
67
67
  command: "npx",
package/dist/lib.js CHANGED
@@ -4229,13 +4229,12 @@ var SolonGateProxy = class {
4229
4229
  httpAgentInfo = /* @__PURE__ */ new Map();
4230
4230
  /** Per-request sub-agent info from HTTP headers (transient, overwritten per request) */
4231
4231
  httpSubAgent = null;
4232
+ /** Server label from --agent-name flag (e.g. "filesystem", "playwright") */
4233
+ serverLabel = null;
4232
4234
  constructor(config) {
4233
4235
  this.config = config;
4234
4236
  this.guardConfig = config.advancedDetection ? { ...DEFAULT_INPUT_GUARD_CONFIG, advancedDetection: config.advancedDetection } : DEFAULT_INPUT_GUARD_CONFIG;
4235
- if (config.agentName) {
4236
- this.agentName = config.agentName;
4237
- this.agentId = config.agentName.toLowerCase().replace(/\s+/g, "-");
4238
- }
4237
+ this.serverLabel = config.agentName ?? null;
4239
4238
  this.gate = new SolonGate({
4240
4239
  name: config.name ?? "solongate-proxy",
4241
4240
  apiKey: "sg_test_proxy_internal_00000000",
@@ -4446,12 +4445,21 @@ var SolonGateProxy = class {
4446
4445
  }
4447
4446
  );
4448
4447
  this.server.oninitialized = () => {
4449
- if (!this.agentId && this.server) {
4448
+ if (this.server) {
4450
4449
  const clientVersion = this.server.getClientVersion();
4451
- if (clientVersion?.name) {
4452
- this.agentId = clientVersion.version ? `${clientVersion.name}/${clientVersion.version}` : clientVersion.name;
4453
- this.agentName = clientVersion.name;
4454
- log2(`Agent identified from MCP clientInfo: ${this.agentName} (${this.agentId})`);
4450
+ const clientName = clientVersion?.name ?? null;
4451
+ if (clientName && this.serverLabel) {
4452
+ this.agentId = `${clientName}/${this.serverLabel}`;
4453
+ this.agentName = `${clientName} (${this.serverLabel})`;
4454
+ } else if (clientName) {
4455
+ this.agentId = clientVersion?.version ? `${clientName}/${clientVersion.version}` : clientName;
4456
+ this.agentName = clientName;
4457
+ } else if (this.serverLabel) {
4458
+ this.agentId = this.serverLabel.toLowerCase().replace(/\s+/g, "-");
4459
+ this.agentName = this.serverLabel;
4460
+ }
4461
+ if (this.agentId) {
4462
+ log2(`Agent identified: ${this.agentName} (${this.agentId})`);
4455
4463
  }
4456
4464
  }
4457
4465
  };
@@ -4889,8 +4897,13 @@ ${msg.content.text}`;
4889
4897
  const headerAgentId = req.headers["x-agent-id"];
4890
4898
  const headerAgentName = req.headers["x-agent-name"];
4891
4899
  if (headerAgentId) {
4892
- this.agentId = headerAgentId;
4893
- this.agentName = headerAgentName || headerAgentId;
4900
+ if (this.serverLabel) {
4901
+ this.agentId = `${headerAgentId}/${this.serverLabel}`;
4902
+ this.agentName = `${headerAgentName || headerAgentId} (${this.serverLabel})`;
4903
+ } else {
4904
+ this.agentId = headerAgentId;
4905
+ this.agentName = headerAgentName || headerAgentId;
4906
+ }
4894
4907
  log2(`Agent identified from HTTP headers: ${this.agentName} (${this.agentId})`);
4895
4908
  }
4896
4909
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.27.1",
3
+ "version": "0.28.0",
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": {