69
70
public attachSseClient(_req: http.IncomingMessage, res: http.ServerResponse): void {
72
>
'Content-Type': 'text/event-stream',
73
>
'Cache-Control': 'no-cache, no-transform',
74
>
'Connection': 'keep-alive',
75
>
});
76
>
77
>
res.write(': connected\n\n');
78
>
this._sseClients.add(res);
79
>
this._logService.info(`[McpGateway][session ${this.id}] SSE client attached (total: ${this._sseClients.size})`);
80
>
81
>
res.on('close', () => {
82
>
this._sseClients.delete(res);
83
>
this._logService.info(`[McpGateway][session ${this.id}] SSE client detached (total: ${this._sseClients.size})`);
84
>
});
85
>
}
86
87
public async handleIncoming(message: JsonRpcMessage | JsonRpcMessage[]): Promise<JsonRpcResponse[]> {