The development of agroecosystems that can provide multiple ecosystem services with a reduced need of external inputs, requires management practices that foster ecological processes to enhance soil quality and crop productivity. We assessed the direct and indirect impacts of farmers’ management practices on plant diversity, soil quality and crop productivity in coffee and pasture fields belonging to different types of farms: agroecological, conventional, and large-scale. The study was carried out in twelve farms in the Zona da Mata, Brazil. For each of the total of 24 fields (twelve pastures and twelve coffee) we recorded 41 variables associated with management practices, indicators of plant diversity (taxonomical, structural and functional diversity) and soil quality (biological, chemical and physical properties). The direct and indirect effects of management on plant diversity, soil quality and in the case of coffee, crop productivity, were assessed using structural equation models. In the case of pastures, we found that increased plant diversity due to agroecological management resulted in higher soil quality, probably due to higher soil litter cover and plant structural heterogeneity. Yet, practices presented in the agroecological farms also had a direct negative effect on soil quality, which indicates that increased plant diversity in pastures needs to be combined with other agroecological management practices than currently adopted. In the case of coffee, we show that despite the higher weeding intensity and higher use of external inputs in large-scale and conventional coffee farming systems, these practices did not result in increased soil quality or coffee productivity as compared to agroecological systems. In contrast, agroecological coffee management was associated with increased plant diversity, which, in turn, was positively associated with soil microbial biomass carbon. Our results highlight a causal pathway of agroecological management leading to increased plant diversity and, in turn, maintenance or increase in soil quality. While no causal link between agroecological coffee management and coffee productivity could be demonstrated, the biodiversity-mediated pathway resulted in similar coffee productivity in agroecological farms as compared to conventionally managed farms, which relied on pesticides and higher inputs of chemical fertilizers. We conclude that agroecological practices can be efficient to maintain satisfactory crop yields and soil fertility without the need of intensive use of external inputs and weeding.