up-mcp-bridge 1.0.8 → 1.0.10

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.
@@ -18043,7 +18043,7 @@ var Client = class extends Protocol {
18043
18043
  };
18044
18044
 
18045
18045
  // package.json
18046
- var version2 = "1.0.8";
18046
+ var version2 = "1.0.10";
18047
18047
 
18048
18048
  // node_modules/pkce-challenge/dist/index.node.js
18049
18049
  var crypto;
@@ -20151,8 +20151,7 @@ function mcpProxy({
20151
20151
  ignoredTools = [],
20152
20152
  reconnectFn,
20153
20153
  reconnectOptions = { enabled: false, maxAttempts: 5, baseDelayMs: 1e3 },
20154
- serverUrl,
20155
- onLocalClose
20154
+ serverUrl
20156
20155
  }) {
20157
20156
  let transportToClientClosed = false;
20158
20157
  let transportToServerClosed = false;
@@ -20561,12 +20560,8 @@ function mcpProxy({
20561
20560
  return;
20562
20561
  }
20563
20562
  transportToClientClosed = true;
20564
- log("[Lifecycle] Local transport closed (stdin closed by client)");
20565
20563
  debugLog("Local transport closed, closing remote transport");
20566
20564
  currentTransportToServer.close().catch(onServerError);
20567
- if (onLocalClose) {
20568
- onLocalClose();
20569
- }
20570
20565
  };
20571
20566
  transportToClient.onerror = onClientError;
20572
20567
  function onClientError(error2) {
@@ -21039,8 +21034,6 @@ async function parseCommandLineArgs(args, usage) {
21039
21034
  }
21040
21035
  function setupSignalHandlers(cleanup) {
21041
21036
  let isShuttingDown = false;
21042
- const initialPpid = process.ppid;
21043
- log(`[Lifecycle] Parent PID: ${initialPpid}, My PID: ${process.pid}`);
21044
21037
  const gracefulShutdown = async (signal) => {
21045
21038
  if (isShuttingDown) {
21046
21039
  log(`[Shutdown] Already shutting down, ignoring ${signal}`);
@@ -21059,50 +21052,9 @@ function setupSignalHandlers(cleanup) {
21059
21052
  };
21060
21053
  process.on("SIGINT", () => gracefulShutdown("SIGINT"));
21061
21054
  process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
21062
- process.on("SIGHUP", () => gracefulShutdown("SIGHUP"));
21063
- const parentWatchdog = setInterval(() => {
21064
- const currentPpid = process.ppid;
21065
- if (currentPpid !== initialPpid) {
21066
- log(`[Watchdog] Parent PID changed from ${initialPpid} to ${currentPpid} - parent died!`);
21067
- clearInterval(parentWatchdog);
21068
- gracefulShutdown("parent-died");
21069
- }
21070
- }, 500);
21071
21055
  process.stdin.resume();
21072
21056
  process.stdin.on("end", () => gracefulShutdown("stdin-end"));
21073
21057
  process.stdin.on("close", () => gracefulShutdown("stdin-close"));
21074
- process.stdin.on("error", (err) => {
21075
- log(`[Lifecycle] stdin error: ${err.message}`);
21076
- gracefulShutdown("stdin-error");
21077
- });
21078
- const stdinReadableCheck = setInterval(() => {
21079
- if (!process.stdin.readable) {
21080
- log("[Lifecycle] stdin is no longer readable");
21081
- clearInterval(stdinReadableCheck);
21082
- gracefulShutdown("stdin-not-readable");
21083
- }
21084
- }, 100);
21085
- process.on("disconnect", () => gracefulShutdown("disconnect"));
21086
- process.stdout.on("error", (err) => {
21087
- log(`[Lifecycle] stdout error: ${err.message}`);
21088
- if (err.message.includes("EPIPE") || err.message.includes("write after end")) {
21089
- gracefulShutdown("stdout-epipe");
21090
- }
21091
- });
21092
- process.on("uncaughtException", (err) => {
21093
- log(`[Lifecycle] Uncaught exception: ${err.message}`);
21094
- gracefulShutdown("uncaught-exception");
21095
- });
21096
- process.on("unhandledRejection", (reason) => {
21097
- log(`[Lifecycle] Unhandled rejection: ${reason}`);
21098
- gracefulShutdown("unhandled-rejection");
21099
- });
21100
- process.on("beforeExit", (code) => {
21101
- log(`[Lifecycle] beforeExit with code ${code}`);
21102
- if (!isShuttingDown) {
21103
- gracefulShutdown("beforeExit");
21104
- }
21105
- });
21106
21058
  }
21107
21059
  function getServerUrlHash(serverUrl, authorizeResource, headers) {
21108
21060
  const parts = [serverUrl];
package/dist/client.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  parseCommandLineArgs,
13
13
  setupSignalHandlers,
14
14
  version
15
- } from "./chunk-UOG5UZOF.js";
15
+ } from "./chunk-J5JYXDXQ.js";
16
16
 
17
17
  // src/client.ts
18
18
  import { EventEmitter } from "events";
package/dist/proxy.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  parseCommandLineArgs,
12
12
  setupSignalHandlers,
13
13
  version
14
- } from "./chunk-UOG5UZOF.js";
14
+ } from "./chunk-J5JYXDXQ.js";
15
15
 
16
16
  // src/proxy.ts
17
17
  import { EventEmitter } from "events";
@@ -164,22 +164,7 @@ async function runProxy(serverUrl, callbackPort, headers, transportStrategy = "h
164
164
  ignoredTools,
165
165
  reconnectFn,
166
166
  reconnectOptions,
167
- serverUrl,
168
- onLocalClose: async () => {
169
- log("[Shutdown] Local transport closed, initiating cleanup...");
170
- try {
171
- await remoteTransport.close();
172
- if (server) {
173
- server.close();
174
- }
175
- process.stdout.end();
176
- log("[Shutdown] Cleanup complete, exiting with code 0");
177
- process.exit(0);
178
- } catch (error) {
179
- log("[Shutdown] Error during cleanup:", error);
180
- process.exit(1);
181
- }
182
- }
167
+ serverUrl
183
168
  });
184
169
  await localTransport.start();
185
170
  log("Local STDIO server running");
@@ -194,7 +179,6 @@ async function runProxy(serverUrl, callbackPort, headers, transportStrategy = "h
194
179
  if (server) {
195
180
  server.close();
196
181
  }
197
- process.stdout.end();
198
182
  };
199
183
  setupSignalHandlers(cleanup);
200
184
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "up-mcp-bridge",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Remote proxy for MCP with auto-reconnect support. Fork of mcp-remote with transparent server restart handling.",
5
5
  "keywords": [
6
6
  "mcp",