[MCP] Add an enabled config field (#4917)

This lets users more easily toggle MCP servers.
This commit is contained in:
Gabriel Peal
2025-10-08 13:24:51 -07:00
committed by GitHub
parent e896db1180
commit d3820f4782
9 changed files with 155 additions and 14 deletions

View File

@@ -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());