@agimon-ai/mcp-proxy 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require("./src-DMlOlvPm.cjs");
2
+ const require_src = require("./src-Dyzi_Dyb.cjs");
3
3
  let node_fs = require("node:fs");
4
4
  let node_fs_promises = require("node:fs/promises");
5
5
  let js_yaml = require("js-yaml");
@@ -1224,6 +1224,10 @@ async function resolveStdioHttpEndpoint(config, options, resolvedConfigPath) {
1224
1224
  ownedRuntimeServerId: runtime.reusedExistingRuntime ? void 0 : runtime.serverId
1225
1225
  };
1226
1226
  }
1227
+ async function rediscoverStdioHttpEndpoint(config, options, resolvedConfigPath) {
1228
+ const { endpoint } = await resolveStdioHttpEndpoint(config, options, resolvedConfigPath);
1229
+ return endpoint;
1230
+ }
1227
1231
  async function startStdioHttpTransport(config, options, resolvedConfigPath, proxyDefaults) {
1228
1232
  let ownedRuntimeServerId;
1229
1233
  const keepAlive = proxyDefaults?.keepAlive ?? false;
@@ -1231,7 +1235,10 @@ async function startStdioHttpTransport(config, options, resolvedConfigPath, prox
1231
1235
  const resolvedEndpoint = await resolveStdioHttpEndpoint(config, options, resolvedConfigPath);
1232
1236
  ownedRuntimeServerId = resolvedEndpoint.ownedRuntimeServerId;
1233
1237
  const { endpoint } = resolvedEndpoint;
1234
- await startServer(new require_src.StdioHttpTransportHandler({ endpoint }, createStdioSafeLogger()), async () => {
1238
+ await startServer(new require_src.StdioHttpTransportHandler({
1239
+ endpoint,
1240
+ resolveEndpoint: async () => await rediscoverStdioHttpEndpoint(config, options, resolvedConfigPath)
1241
+ }, createStdioSafeLogger()), async () => {
1235
1242
  if (keepAlive || !ownedRuntimeServerId) return;
1236
1243
  await new require_src.StopServerService().stop({
1237
1244
  serverId: ownedRuntimeServerId,
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as DefinitionsCacheService, D as version, T as findConfigFile, b as RuntimeStateService, d as StdioHttpTransportHandler, f as StdioTransportHandler, m as HttpTransportHandler, n as createServer, o as createProxyIoCContainer, p as SseTransportHandler, r as createSessionServer, t as TRANSPORT_MODE, u as initializeSharedServices, v as StopServerService, w as generateServerId } from "./src-pCtALj-B.mjs";
2
+ import { C as DefinitionsCacheService, D as version, T as findConfigFile, b as RuntimeStateService, d as StdioHttpTransportHandler, f as StdioTransportHandler, m as HttpTransportHandler, n as createServer, o as createProxyIoCContainer, p as SseTransportHandler, r as createSessionServer, t as TRANSPORT_MODE, u as initializeSharedServices, v as StopServerService, w as generateServerId } from "./src-BWTZjdu-.mjs";
3
3
  import { constants, existsSync, readFileSync } from "node:fs";
4
4
  import { access, writeFile } from "node:fs/promises";
5
5
  import yaml from "js-yaml";
@@ -1222,6 +1222,10 @@ async function resolveStdioHttpEndpoint(config, options, resolvedConfigPath) {
1222
1222
  ownedRuntimeServerId: runtime.reusedExistingRuntime ? void 0 : runtime.serverId
1223
1223
  };
1224
1224
  }
1225
+ async function rediscoverStdioHttpEndpoint(config, options, resolvedConfigPath) {
1226
+ const { endpoint } = await resolveStdioHttpEndpoint(config, options, resolvedConfigPath);
1227
+ return endpoint;
1228
+ }
1225
1229
  async function startStdioHttpTransport(config, options, resolvedConfigPath, proxyDefaults) {
1226
1230
  let ownedRuntimeServerId;
1227
1231
  const keepAlive = proxyDefaults?.keepAlive ?? false;
@@ -1229,7 +1233,10 @@ async function startStdioHttpTransport(config, options, resolvedConfigPath, prox
1229
1233
  const resolvedEndpoint = await resolveStdioHttpEndpoint(config, options, resolvedConfigPath);
1230
1234
  ownedRuntimeServerId = resolvedEndpoint.ownedRuntimeServerId;
1231
1235
  const { endpoint } = resolvedEndpoint;
1232
- await startServer(new StdioHttpTransportHandler({ endpoint }, createStdioSafeLogger()), async () => {
1236
+ await startServer(new StdioHttpTransportHandler({
1237
+ endpoint,
1238
+ resolveEndpoint: async () => await rediscoverStdioHttpEndpoint(config, options, resolvedConfigPath)
1239
+ }, createStdioSafeLogger()), async () => {
1233
1240
  if (keepAlive || !ownedRuntimeServerId) return;
1234
1241
  await new StopServerService().stop({
1235
1242
  serverId: ownedRuntimeServerId,
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-DMlOlvPm.cjs");
2
+ const require_src = require("./src-Dyzi_Dyb.cjs");
3
3
  exports.ConfigFetcherService = require_src.ConfigFetcherService;
4
4
  exports.DefinitionsCacheService = require_src.DefinitionsCacheService;
5
5
  exports.DescribeToolsTool = require_src.DescribeToolsTool;
package/dist/index.d.cts CHANGED
@@ -1187,6 +1187,7 @@ declare class StdioTransportHandler implements TransportHandler {
1187
1187
  //#region src/transports/stdio-http.d.ts
1188
1188
  interface StdioHttpProxyTransportConfig {
1189
1189
  endpoint: URL;
1190
+ resolveEndpoint?: () => Promise<URL>;
1190
1191
  }
1191
1192
  /**
1192
1193
  * Transport that serves MCP over stdio and forwards MCP requests to an HTTP endpoint.
@@ -1194,7 +1195,8 @@ interface StdioHttpProxyTransportConfig {
1194
1195
  * connection is lost (e.g. backend crash + restart).
1195
1196
  */
1196
1197
  declare class StdioHttpTransportHandler implements TransportHandler {
1197
- private readonly endpoint;
1198
+ private endpoint;
1199
+ private readonly resolveEndpoint?;
1198
1200
  private stdioProxyServer;
1199
1201
  private stdioTransport;
1200
1202
  private httpClient;
package/dist/index.d.mts CHANGED
@@ -1187,6 +1187,7 @@ declare class StdioTransportHandler implements TransportHandler {
1187
1187
  //#region src/transports/stdio-http.d.ts
1188
1188
  interface StdioHttpProxyTransportConfig {
1189
1189
  endpoint: URL;
1190
+ resolveEndpoint?: () => Promise<URL>;
1190
1191
  }
1191
1192
  /**
1192
1193
  * Transport that serves MCP over stdio and forwards MCP requests to an HTTP endpoint.
@@ -1194,7 +1195,8 @@ interface StdioHttpProxyTransportConfig {
1194
1195
  * connection is lost (e.g. backend crash + restart).
1195
1196
  */
1196
1197
  declare class StdioHttpTransportHandler implements TransportHandler {
1197
- private readonly endpoint;
1198
+ private endpoint;
1199
+ private readonly resolveEndpoint?;
1198
1200
  private stdioProxyServer;
1199
1201
  private stdioTransport;
1200
1202
  private httpClient;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { C as DefinitionsCacheService, E as ConfigFetcherService, S as createProxyLogger, T as findConfigFile, _ as DescribeToolsTool, a as createProxyContainer, b as RuntimeStateService, c as createStdioHttpTransportHandler, d as StdioHttpTransportHandler, f as StdioTransportHandler, g as SearchListToolsTool, h as UseToolTool, i as createHttpTransportHandler, l as createStdioTransportHandler, m as HttpTransportHandler, n as createServer, p as SseTransportHandler, r as createSessionServer, s as createSseTransportHandler, t as TRANSPORT_MODE, u as initializeSharedServices, v as StopServerService, w as generateServerId, x as McpClientManagerService, y as SkillService } from "./src-pCtALj-B.mjs";
1
+ import { C as DefinitionsCacheService, E as ConfigFetcherService, S as createProxyLogger, T as findConfigFile, _ as DescribeToolsTool, a as createProxyContainer, b as RuntimeStateService, c as createStdioHttpTransportHandler, d as StdioHttpTransportHandler, f as StdioTransportHandler, g as SearchListToolsTool, h as UseToolTool, i as createHttpTransportHandler, l as createStdioTransportHandler, m as HttpTransportHandler, n as createServer, p as SseTransportHandler, r as createSessionServer, s as createSseTransportHandler, t as TRANSPORT_MODE, u as initializeSharedServices, v as StopServerService, w as generateServerId, x as McpClientManagerService, y as SkillService } from "./src-BWTZjdu-.mjs";
2
2
  export { ConfigFetcherService, DefinitionsCacheService, DescribeToolsTool, HttpTransportHandler, McpClientManagerService, RuntimeStateService, SearchListToolsTool, SkillService, SseTransportHandler, StdioHttpTransportHandler, StdioTransportHandler, StopServerService, TRANSPORT_MODE, UseToolTool, createHttpTransportHandler, createProxyContainer, createProxyLogger, createServer, createSessionServer, createSseTransportHandler, createStdioHttpTransportHandler, createStdioTransportHandler, findConfigFile, generateServerId, initializeSharedServices };
@@ -25,7 +25,7 @@ import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
25
25
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
26
26
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
27
27
  //#region package.json
28
- var version = "0.10.1";
28
+ var version = "0.10.2";
29
29
  //#endregion
30
30
  //#region src/utils/mcpConfigSchema.ts
31
31
  /**
@@ -4313,6 +4313,7 @@ function isConnectionError(error) {
4313
4313
  */
4314
4314
  var StdioHttpTransportHandler = class {
4315
4315
  endpoint;
4316
+ resolveEndpoint;
4316
4317
  stdioProxyServer = null;
4317
4318
  stdioTransport = null;
4318
4319
  httpClient = null;
@@ -4322,6 +4323,7 @@ var StdioHttpTransportHandler = class {
4322
4323
  RECONNECT_MAX_MS = 3e4;
4323
4324
  constructor(config, logger = console) {
4324
4325
  this.endpoint = config.endpoint;
4326
+ this.resolveEndpoint = config.resolveEndpoint;
4325
4327
  this.logger = logger;
4326
4328
  }
4327
4329
  async start() {
@@ -4392,6 +4394,7 @@ var StdioHttpTransportHandler = class {
4392
4394
  const delay = Math.min(this.RECONNECT_BASE_MS * 2 ** attempt, this.RECONNECT_MAX_MS);
4393
4395
  await new Promise((resolve) => setTimeout(resolve, delay));
4394
4396
  try {
4397
+ if (this.resolveEndpoint) this.endpoint = await this.resolveEndpoint();
4395
4398
  await this.httpClient?.close().catch(() => void 0);
4396
4399
  const client = await this.createAndConnectClient();
4397
4400
  this.httpClient = client;
@@ -48,7 +48,7 @@ let _modelcontextprotocol_sdk_server_sse_js = require("@modelcontextprotocol/sdk
48
48
  let _modelcontextprotocol_sdk_server_stdio_js = require("@modelcontextprotocol/sdk/server/stdio.js");
49
49
  let _modelcontextprotocol_sdk_server_index_js = require("@modelcontextprotocol/sdk/server/index.js");
50
50
  //#region package.json
51
- var version = "0.10.1";
51
+ var version = "0.10.2";
52
52
  //#endregion
53
53
  //#region src/utils/mcpConfigSchema.ts
54
54
  /**
@@ -4336,6 +4336,7 @@ function isConnectionError(error) {
4336
4336
  */
4337
4337
  var StdioHttpTransportHandler = class {
4338
4338
  endpoint;
4339
+ resolveEndpoint;
4339
4340
  stdioProxyServer = null;
4340
4341
  stdioTransport = null;
4341
4342
  httpClient = null;
@@ -4345,6 +4346,7 @@ var StdioHttpTransportHandler = class {
4345
4346
  RECONNECT_MAX_MS = 3e4;
4346
4347
  constructor(config, logger = console) {
4347
4348
  this.endpoint = config.endpoint;
4349
+ this.resolveEndpoint = config.resolveEndpoint;
4348
4350
  this.logger = logger;
4349
4351
  }
4350
4352
  async start() {
@@ -4415,6 +4417,7 @@ var StdioHttpTransportHandler = class {
4415
4417
  const delay = Math.min(this.RECONNECT_BASE_MS * 2 ** attempt, this.RECONNECT_MAX_MS);
4416
4418
  await new Promise((resolve) => setTimeout(resolve, delay));
4417
4419
  try {
4420
+ if (this.resolveEndpoint) this.endpoint = await this.resolveEndpoint();
4418
4421
  await this.httpClient?.close().catch(() => void 0);
4419
4422
  const client = await this.createAndConnectClient();
4420
4423
  this.httpClient = client;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agimon-ai/mcp-proxy",
3
3
  "description": "MCP proxy server package",
4
- "version": "0.10.2",
4
+ "version": "0.10.3",
5
5
  "license": "AGPL-3.0",
6
6
  "keywords": [
7
7
  "mcp",
@@ -28,10 +28,10 @@
28
28
  "js-yaml": "4.1.1",
29
29
  "liquidjs": "10.25.5",
30
30
  "zod": "4.3.6",
31
+ "@agimon-ai/foundation-port-registry": "0.8.0",
31
32
  "@agimon-ai/foundation-process-registry": "0.8.0",
32
- "@agimon-ai/log-sink-mcp": "0.8.0",
33
33
  "@agimon-ai/foundation-validator": "0.5.0",
34
- "@agimon-ai/foundation-port-registry": "0.8.0"
34
+ "@agimon-ai/log-sink-mcp": "0.8.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/js-yaml": "4.0.9",