@@ -8,7 +8,10 @@ export abstract class MCPClient {
88 abstract getConfigPath ( ) : Promise < string > ;
99 abstract getServerPropertyName ( ) : string ;
1010 abstract isServerInstalled ( ) : Promise < boolean > ;
11- abstract addServer ( apiKey : string ) : Promise < { success : boolean } > ;
11+ abstract addServer (
12+ apiKey : string ,
13+ selectedFeatures ?: string [ ] ,
14+ ) : Promise < { success : boolean } > ;
1215 abstract removeServer ( ) : Promise < { success : boolean } > ;
1316 abstract isClientSupported ( ) : Promise < boolean > ;
1417}
@@ -24,8 +27,12 @@ export abstract class DefaultMCPClient extends MCPClient {
2427 return 'mcpServers' ;
2528 }
2629
27- getServerConfig ( apiKey : string , type : 'sse' | 'streamable-http' ) {
28- return getDefaultServerConfig ( apiKey , type ) ;
30+ getServerConfig (
31+ apiKey : string ,
32+ type : 'sse' | 'streamable-http' ,
33+ selectedFeatures ?: string [ ] ,
34+ ) {
35+ return getDefaultServerConfig ( apiKey , type , selectedFeatures ) ;
2936 }
3037
3138 async isServerInstalled ( ) : Promise < boolean > {
@@ -47,13 +54,17 @@ export abstract class DefaultMCPClient extends MCPClient {
4754 }
4855 }
4956
50- async addServer ( apiKey : string ) : Promise < { success : boolean } > {
51- return this . _addServerType ( apiKey , 'sse' ) ;
57+ async addServer (
58+ apiKey : string ,
59+ selectedFeatures ?: string [ ] ,
60+ ) : Promise < { success : boolean } > {
61+ return this . _addServerType ( apiKey , 'sse' , selectedFeatures ) ;
5262 }
5363
5464 async _addServerType (
5565 apiKey : string ,
5666 type : 'sse' | 'streamable-http' ,
67+ selectedFeatures ?: string [ ] ,
5768 ) : Promise < { success : boolean } > {
5869 try {
5970 const configPath = await this . getConfigPath ( ) ;
@@ -70,7 +81,11 @@ export abstract class DefaultMCPClient extends MCPClient {
7081 existingConfig = jsonc . parse ( configContent ) || { } ;
7182 }
7283
73- const newServerConfig = this . getServerConfig ( apiKey , type ) ;
84+ const newServerConfig = this . getServerConfig (
85+ apiKey ,
86+ type ,
87+ selectedFeatures ,
88+ ) ;
7489 const typedConfig = existingConfig as Record < string , any > ;
7590 if ( ! typedConfig [ serverPropertyName ] ) {
7691 typedConfig [ serverPropertyName ] = { } ;
0 commit comments