File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -598,13 +598,23 @@ export class McpHub {
598598 }
599599 await this . notifyWebviewOfServerChanges ( )
600600 }
601+
602+ transport . onclose = async ( ) => {
603+ const connection = this . findConnection ( name , source )
604+ if ( connection ) {
605+ connection . server . status = "disconnected"
606+ }
607+ await this . notifyWebviewOfServerChanges ( )
608+ }
601609 } else {
602- // Correctly placed "unsupported type" else block
603610 // Should not happen if validateServerConfig is correct
604611 throw new Error ( `Unsupported MCP server type: ${ ( configInjected as any ) . type } ` )
605612 }
606- // transport.start assignment moved after all type-specific initializations
607- transport . start = async ( ) => { } // No-op now, .connect() won't fail
613+
614+ // Only override transport.start for stdio transports that have already been started
615+ if ( configInjected . type === "stdio" ) {
616+ transport . start = async ( ) => { }
617+ }
608618
609619 const connection : McpConnection = {
610620 server : {
You can’t perform that action at this time.
0 commit comments