INNER CODE UNIT · JavaScript

Promise

bvisible/mcp-ssh-manager · src/index.js:473

  return new Promise((resolve, reject) => {
    const child = spawn(cmd, {
      shell: true,
      stdio: ['pipe', 'pipe', 'pipe']
    });

    // Cast: Node accepts a {readable, writable} pair here, but the bundled
    // types only model the stream/iterable overloads.
    const socket = Duplex.from(/** @type {any} */ ({
      readable: child.stdout,
      writable: child.stdin,
      allowHalfOpen: false
    }));

    // Forward proxy stderr to the MCP server's stderr for debugging
    child.stderr.on('data', (chunk) => {
      process.stderr.write(`[proxy-command] ${chunk}`);
    });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…