diff --git a/codex-rs/ext/mcp/src/executor_plugin.rs b/codex-rs/ext/mcp/src/executor_plugin.rs index 3597e100d8..12c0a99686 100644 --- a/codex-rs/ext/mcp/src/executor_plugin.rs +++ b/codex-rs/ext/mcp/src/executor_plugin.rs @@ -87,7 +87,14 @@ impl SelectedExecutorPluginMcpContributor { }; let metadata = match plugin { Some(plugin) => { - let servers = self.mcp_provider.load(&plugin).await.unwrap_or_else(|err| { + // MCP server declarations and app connector declarations are separate + // executor-owned files. Read them together so a remote environment only + // pays for the slower read instead of both reads back-to-back. + let (servers, connector_declarations) = tokio::join!( + self.mcp_provider.load(&plugin), + self.connector_provider.load(&plugin) + ); + let servers = servers.unwrap_or_else(|err| { tracing::warn!( selected_root = selected_root.id, error = %err, @@ -95,10 +102,7 @@ impl SelectedExecutorPluginMcpContributor { ); Vec::new() }); - let connector_ids = self - .connector_provider - .load(&plugin) - .await + let connector_ids = connector_declarations .unwrap_or_else(|err| { tracing::warn!( selected_root = selected_root.id,