@trops/dash-core 0.1.64 → 0.1.65

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.
@@ -4954,6 +4954,21 @@ function getShellPath$1() {
4954
4954
  return _shellPath$1;
4955
4955
  }
4956
4956
 
4957
+ /**
4958
+ * Create a clean environment for MCP child processes.
4959
+ * Strips npm_* and ELECTRON_* vars that would force the child
4960
+ * to use Electron's or npm's Node binary instead of the PATH one.
4961
+ */
4962
+ function cleanEnvForChildProcess() {
4963
+ const env = {};
4964
+ for (const [key, value] of Object.entries(process.env)) {
4965
+ if (key.startsWith("npm_") || key.startsWith("ELECTRON_")) continue;
4966
+ env[key] = value;
4967
+ }
4968
+ env.PATH = getShellPath$1();
4969
+ return env;
4970
+ }
4971
+
4957
4972
  /**
4958
4973
  * Active MCP server connections
4959
4974
  * Map<string, { client: Client, transport: Transport, tools: Array, status: string }>
@@ -5066,10 +5081,7 @@ const mcpController$2 = {
5066
5081
  });
5067
5082
  } else {
5068
5083
  // stdio transport (default) - spawn a local child process
5069
- const env = { ...process.env };
5070
- // Ensure full shell PATH is available (Electron GUI apps
5071
- // on macOS don't inherit nvm/homebrew paths)
5072
- env.PATH = getShellPath$1();
5084
+ const env = cleanEnvForChildProcess();
5073
5085
  if (mcpConfig.envMapping && credentials) {
5074
5086
  Object.entries(mcpConfig.envMapping).forEach(
5075
5087
  ([envVar, credentialKey]) => {
@@ -5510,7 +5522,7 @@ const mcpController$2 = {
5510
5522
  runAuth: async (win, mcpConfig, credentials, authCommand) => {
5511
5523
  const { spawn } = require$$5$2;
5512
5524
 
5513
- const env = { ...process.env, PATH: getShellPath$1() };
5525
+ const env = cleanEnvForChildProcess();
5514
5526
 
5515
5527
  // Inject credentials as env vars using the same envMapping as startServer
5516
5528
  if (mcpConfig?.envMapping && credentials) {