File tree Expand file tree Collapse file tree 3 files changed +15
-14
lines changed
Expand file tree Collapse file tree 3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -336,19 +336,18 @@ impl ApiClient {
336336 }
337337
338338 pub async fn is_mcp_enabled ( & self ) -> Result < bool , ApiClientError > {
339- // let request = self
340- // .client
341- // .get_profile()
342- // .set_profile_arn(self.profile.as_ref().map(|p| p.arn.clone()));
343-
344- // let response = request.send().await?;
345- // let mcp_enabled = response
346- // .profile()
347- // .opt_in_features()
348- // .and_then(|features| features.mcp_configuration())
349- // .is_none_or(|config| matches!(config.toggle(), OptInFeatureToggle::On));
350- // Ok(mcp_enabled)
351- Ok ( false )
339+ let request = self
340+ . client
341+ . get_profile ( )
342+ . set_profile_arn ( self . profile . as_ref ( ) . map ( |p| p. arn . clone ( ) ) ) ;
343+
344+ let response = request. send ( ) . await ?;
345+ let mcp_enabled = response
346+ . profile ( )
347+ . opt_in_features ( )
348+ . and_then ( |features| features. mcp_configuration ( ) )
349+ . is_none_or ( |config| matches ! ( config. toggle( ) , OptInFeatureToggle :: On ) ) ;
350+ Ok ( mcp_enabled)
352351 }
353352
354353 pub async fn create_subscription_token ( & self ) -> Result < CreateSubscriptionTokenOutput , ApiClientError > {
Original file line number Diff line number Diff line change @@ -849,7 +849,7 @@ fn default_schema() -> String {
849849 "https://raw.githubusercontent.com/aws/amazon-q-developer-cli/refs/heads/main/schemas/agent-v1.json" . into ( )
850850}
851851
852- fn is_mcp_ref ( s : & str ) -> bool {
852+ pub fn is_mcp_ref ( s : & str ) -> bool {
853853 // Any tool reference starting with '@' is considered MCP (e.g., "@git", "@git/git_status").
854854 s. starts_with ( '@' )
855855}
Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ impl PersistSubcommand {
9595
9696 let mut new_state: ConversationState = tri ! ( serde_json:: from_str( & contents) , "import from" , & path) ;
9797 std:: mem:: swap ( & mut new_state. tool_manager , & mut session. conversation . tool_manager ) ;
98+ std:: mem:: swap ( & mut new_state. mcp_enabled , & mut session. conversation . mcp_enabled ) ;
99+ std:: mem:: swap ( & mut new_state. model_info , & mut session. conversation . model_info ) ;
98100 std:: mem:: swap (
99101 & mut new_state. context_manager ,
100102 & mut session. conversation . context_manager ,
You can’t perform that action at this time.
0 commit comments