Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Don't run MCP servers for remote projects (#39243)
Conrad Irwin83e5a3033e77
diff --git a/crates/project/src/context_server_store.rs b/crates/project/src/context_server_store.rsindex e4673744da6..e358ddfbf51 100644--- a/crates/project/src/context_server_store.rs+++ b/crates/project/src/context_server_store.rs@@ -472,22 +472,23 @@ impl ContextServerStore {configuration: Arc<ContextServerConfiguration>,cx: &mut Context<Self>,) -> Arc<ContextServer> {- let root_path = self- .project- .read_with(cx, |project, cx| project.active_project_directory(cx))- .ok()- .flatten()- .or_else(|| {- self.worktree_store.read_with(cx, |store, cx| {- store.visible_worktrees(cx).fold(None, |acc, item| {- if acc.is_none() {- item.read(cx).root_dir()- } else {- acc+ let project = self.project.upgrade();+ let mut root_path = None;+ if let Some(project) = project {+ let project = project.read(cx);+ if project.is_local() {+ if let Some(path) = project.active_project_directory(cx) {+ root_path = Some(path);+ } else {+ for worktree in self.worktree_store.read(cx).visible_worktrees(cx) {+ if let Some(path) = worktree.read(cx).root_dir() {+ root_path = Some(path);+ break;}- })- })- });+ }+ }+ }+ };if let Some(factory) = self.context_server_factory.as_ref() {factory(id, configuration)