In view of the rapid proliferation of water infrastructures worldwide, balancing human and ecosystem needs for water resources is a critical environmental challenge of global significance. While there is abundant literature on the environmental impacts of individual water infrastructures, little attention has been paid to their cumulative effects in river networks, which may have basin-to-global impacts on freshwater ecology. Here we developed a methodological framework based on Pareto frontier analysis for optimizing trade-offs between water withdrawal and ecological indicators. We applied this framework to a mountainous Ecuadorian headwater river network that is part of a continental water transfer for supply and demand management to optimize ecological conditions and the operation of 11 water intake structures used to provide potable water to the city of Quito. We found that the current water intake configuration has an important effect on the total length of fifth-order stream sections (65% reduction compared to premanaged condition) and isolates 70.9% of the headwater stream length. The Pareto frontier analysis identified water intake portfolios (i.e., different combinations of intake sites) that decreased ecological impacts by 7.8% points (pp) and 13.0 pp for connectivity and stream order change, respectively, while meeting Quito's water demands. Additional portfolios accounting for monthly variability in water demand and resources further decrease the ecological impact up to 9.6 pp in connectivity and 13.4 pp in stream order. These eco-friendly portfolios suggest that adaptive management at basin level may help optimize water withdrawal to fulfill urban demands while preserving ecological integrity.