@imenam/mcp-gui-interface 1.0.6 → 1.0.8

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.
Files changed (2) hide show
  1. package/dist/src/logger.js +12 -6
  2. package/package.json +1 -1
@@ -41,12 +41,18 @@ export function setupLogging(options) {
41
41
  return;
42
42
  currentProcessLabel = options.processLabel;
43
43
  const resolvedLogDir = options.logDir ?? process.env.MCP_LOG_DIR ?? path.join(process.cwd(), ".mcp-gui", "logs");
44
- fs.mkdirSync(resolvedLogDir, { recursive: true });
45
- const logFilePath = path.join(resolvedLogDir, "server.log");
46
- logStream = fs.createWriteStream(logFilePath, { flags: "a", encoding: "utf8" });
47
- logStream.on("error", (error) => {
48
- originalConsoleError(`Critical: Failed to write to log file: ${serialize(error)}`);
49
- });
44
+ try {
45
+ fs.mkdirSync(resolvedLogDir, { recursive: true });
46
+ const logFilePath = path.join(resolvedLogDir, "server.log");
47
+ logStream = fs.createWriteStream(logFilePath, { flags: "a", encoding: "utf8" });
48
+ logStream.on("error", (error) => {
49
+ logStream = null;
50
+ originalConsoleError(`[LOGGER] Log file write failed, disabling file logging: ${serialize(error)}`);
51
+ });
52
+ }
53
+ catch (error) {
54
+ originalConsoleError(`[LOGGER] Could not initialize log file at "${resolvedLogDir}", disabling file logging: ${serialize(error)}`);
55
+ }
50
56
  ensureConsoleErrorPatched();
51
57
  // Redirect console.log/info/warn to console.error to protect stdout
52
58
  // which is reserved for the MCP JSON-RPC protocol in the MASTER process.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imenam/mcp-gui-interface",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Shared library for MCP GUI lifecycle management — spawning, IPC, proxy registration, logging",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",