diff --git a/crates/chat-cli/src/mcp_client/client.rs b/crates/chat-cli/src/mcp_client/client.rs index 36f667ef03..dc1fc1dd2f 100644 --- a/crates/chat-cli/src/mcp_client/client.rs +++ b/crates/chat-cli/src/mcp_client/client.rs @@ -346,7 +346,7 @@ impl McpClientService { ); let new_transport = - get_http_transport(&os_clone, true, &url, Some(auth_client.auth_client.clone()), &*messenger_dup).await?; + get_http_transport(&os_clone, &url, Some(auth_client.auth_client.clone()), &*messenger_dup).await?; match new_transport { HttpTransport::WithAuth((new_transport, new_auth_client)) => { @@ -363,7 +363,7 @@ impl McpClientService { // case we would need to have user go through the auth flow // again let new_transport = - get_http_transport(&os_clone, true, &url, None, &*messenger_dup).await?; + get_http_transport(&os_clone, &url, None, &*messenger_dup).await?; match new_transport { HttpTransport::WithAuth((new_transport, new_auth_client)) => { @@ -519,7 +519,7 @@ impl McpClientService { Ok(Transport::Stdio((tokio_child_process, child_stderr))) }, TransportType::Http => { - let http_transport = get_http_transport(os, false, url, None, messenger).await?; + let http_transport = get_http_transport(os, url, None, messenger).await?; Ok(Transport::Http(http_transport)) }, diff --git a/crates/chat-cli/src/mcp_client/oauth_util.rs b/crates/chat-cli/src/mcp_client/oauth_util.rs index d7b3b50bbd..f284265cf0 100644 --- a/crates/chat-cli/src/mcp_client/oauth_util.rs +++ b/crates/chat-cli/src/mcp_client/oauth_util.rs @@ -168,7 +168,6 @@ fn get_scopes() -> &'static [&'static str] { pub async fn get_http_transport( os: &Os, - delete_cache: bool, url: &str, auth_client: Option>, messenger: &dyn Messenger, @@ -179,10 +178,6 @@ pub async fn get_http_transport( let cred_full_path = cred_dir.join(format!("{key}.token.json")); let reg_full_path = cred_dir.join(format!("{key}.registration.json")); - if delete_cache && cred_full_path.is_file() { - tokio::fs::remove_file(&cred_full_path).await?; - } - let reqwest_client = reqwest::Client::default(); let probe_resp = reqwest_client.get(url.clone()).send().await?; match probe_resp.status() {