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:
@@ -367,6 +367,17 @@ export class McpRouter {
|
||||
case 'prompts/get':
|
||||
return this.routeNamespacedCall(request, 'name', this.promptToServer);
|
||||
|
||||
// Handle MCP notifications (no response expected, but return empty result if called as request)
|
||||
case 'notifications/initialized':
|
||||
case 'notifications/cancelled':
|
||||
case 'notifications/progress':
|
||||
case 'notifications/roots/list_changed':
|
||||
return {
|
||||
jsonrpc: '2.0',
|
||||
id: request.id,
|
||||
result: {},
|
||||
};
|
||||
|
||||
default:
|
||||
return {
|
||||
jsonrpc: '2.0',
|
||||
|
||||
Reference in New Issue
Block a user