fix: hot-attach to MCP servers that require auth after running .mcp auth <name>

This commit is contained in:
2026-07-17 13:16:25 -06:00
parent 09afdeaf7c
commit f5085a773a
4 changed files with 98 additions and 11 deletions
+20
View File
@@ -698,6 +698,26 @@ pub async fn run_repl_command(
)
.await?;
println!("Authentication saved.");
if ctx.app.config.mcp_server_support {
let app = Arc::clone(&ctx.app.config);
ctx.bootstrap_tools(
app.as_ref(),
true,
abort_signal.clone(),
)
.await?;
if ctx.tool_scope.mcp_runtime.get(server_name).is_some()
{
println!(
"✓ MCP server '{server_name}' started and attached to the current context."
);
} else {
println!(
"MCP server '{server_name}' is not enabled in the current context. \
Run `.mcp enable {server_name}` to attach it."
);
}
}
}
}
}