-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
Milestone
Description
const transport = new StdioClientTransport({
command: argv.command,
args: argv.args,
env: process.env as Record<string, string>,
stderr: 'pipe',
});
const client = new Client(
{
name: "mcp-proxy",
version: "1.0.0",
},
{
capabilities: {},
},
);Here, transport.stderr is gonna be null, which is a problem if the intent is to capture the error messages at the start time.
A somewhat workaround is something like this:
let stderrOutput = '';
try {
console.info('connecting to the MCP server...');
const connectionPromise = client.connect(transport);
transport?.stderr?.on('data', (chunk) => {
stderrOutput += chunk.toString();
});
await connectionPromise;
console.info('connected to the MCP server');
} catch (error) {
console.error('could not connect to the MCP server', error, prefixLines(stderrOutput, '> '));
await setTimeout(1000);
process.exit(1);
}I've used it here punkpeye/mcp-proxy@4933267
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on