fix: STDIO transport stdout flush and MCP notification handling
- Wait for stdout.write callback before process.exit in STDIO transport to prevent truncation of large responses (e.g. grafana tools/list) - Handle MCP notification methods (notifications/initialized, etc.) in router instead of returning "Method not found" error - Use -p shorthand in config claude output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,9 +61,10 @@ proc.stdout.on('data', d => {
|
||||
const msg = JSON.parse(line);
|
||||
if (msg.id === 2) {
|
||||
responded = true;
|
||||
process.stdout.write(JSON.stringify(msg));
|
||||
proc.kill();
|
||||
process.exit(0);
|
||||
process.stdout.write(JSON.stringify(msg), () => {
|
||||
proc.kill();
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user