[MCP] Add an enabled config field (#4917)
This lets users more easily toggle MCP servers.
This commit is contained in:
@@ -874,6 +874,12 @@ pub(crate) fn new_mcp_tools_output(
|
||||
names.sort();
|
||||
|
||||
lines.push(vec![" • Server: ".into(), server.clone().into()].into());
|
||||
let status_line = if cfg.enabled {
|
||||
vec![" • Status: ".into(), "enabled".green()].into()
|
||||
} else {
|
||||
vec![" • Status: ".into(), "disabled".red()].into()
|
||||
};
|
||||
lines.push(status_line);
|
||||
|
||||
match &cfg.transport {
|
||||
McpServerTransportConfig::Stdio { command, args, env } => {
|
||||
@@ -899,7 +905,9 @@ pub(crate) fn new_mcp_tools_output(
|
||||
}
|
||||
}
|
||||
|
||||
if names.is_empty() {
|
||||
if !cfg.enabled {
|
||||
lines.push(vec![" • Tools: ".into(), "(disabled)".red()].into());
|
||||
} else if names.is_empty() {
|
||||
lines.push(" • Tools: (none)".into());
|
||||
} else {
|
||||
lines.push(vec![" • Tools: ".into(), names.join(", ").into()].into());
|
||||
|
||||
Reference in New Issue
Block a user