Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

acp: Only pass enabled MCP servers to agent (#43467)

Bennet Bo Fenner94f9b8585969
diff --git a/crates/project/src/context_server_store.rs b/crates/project/src/context_server_store.rs
index 342a59ab7d5..59bef36f065 100644
--- a/crates/project/src/context_server_store.rs
+++ b/crates/project/src/context_server_store.rs
@@ -199,12 +199,12 @@ impl ContextServerStore {
)
}
- /// Returns all configured context server ids, regardless of enabled state.
+ /// Returns all configured context server ids, excluding the ones that are disabled
pub fn configured_server_ids(&self) -> Vec<ContextServerId> {
self.context_server_settings
- .keys()
- .cloned()
- .map(ContextServerId)
+ .iter()
+ .filter(|(_, settings)| settings.enabled())
+ .map(|(id, _)| ContextServerId(id.clone()))
.collect()
}