File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,8 @@ export class Server {
2828 }
2929
3030 async close ( ) : Promise < void > {
31- try {
32- await this . session . serviceProvider ?. close ( true ) ;
33- } catch {
34- // Ignore errors during service provider close
35- }
36- await this . mcpServer ?. close ( ) ;
31+ await this . session . close ( ) ;
32+ await this . mcpServer . close ( ) ;
3733 }
3834
3935 private registerTools ( ) {
Original file line number Diff line number Diff line change @@ -23,4 +23,15 @@ export class Session {
2323 } ) ;
2424 }
2525 }
26+
27+ async close ( ) : Promise < void > {
28+ if ( this . serviceProvider ) {
29+ try {
30+ await this . serviceProvider . close ( true ) ;
31+ } catch ( error ) {
32+ console . error ( "Error closing service provider:" , error ) ;
33+ }
34+ this . serviceProvider = undefined ;
35+ }
36+ }
2637}
You can’t perform that action at this time.
0 commit comments