Chains with the SDK's internal onclose handler so its cleanup still runs.
(callback: () => void)
| 243 | |
| 244 | /** Chains with the SDK's internal onclose handler so its cleanup still runs. */ |
| 245 | onClose(callback: () => void): void { |
| 246 | const existingHandler = this.transport.onclose |
| 247 | this.transport.onclose = () => { |
| 248 | existingHandler?.() |
| 249 | callback() |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | getConfig(): McpServerConfig { |
| 254 | return { ...this.config } |