Coffee agroforestry systems deliver ecosystem services (ES) critical for rural livelihoods like food but also disservices that constrain livelihoods like fostering coffee-pests. Since such ES are treebased, maximizing ES and limiting constraints requires knowledge on optimizing on-farm tree composition especially trees adapted to local conditions. The study was in three sites along a rainfall gradient in Central Uganda where we: assessed tree diversity in coffee agroforestry; ranked tree suitability for providing ES according to farmers' knowledge; and then proposed an approach for optimizing on-farm tree composition for delivery of ES. We collected data on tree diversity and, farmers' knowledge of tree species and the ES they provide. Farmers ranked ES in order of importance to their livelihoods ('Needs rank') and ranked trees according to suitability for providing ES. Using Bradley Terry modeling, we grouped trees into 'ES groups' according to suitability for providing different ES and ranked 'ES groups' according to tree diversity ('Diversity rank'). Tree-suitability for providing ES and importance of ES to farmers varied with rainfall regime but tree diversity did not match farmers' needs for ES. We propose the FaD-FaN (matching farm tree diversity to farmers' needs) approach for optimizing tree species composition with respect to tree-suitability for farmers' priority ES. Farmers locally prioritize ES needed and identify trees that best serve such ES. The approach then focuses on modifying on-farm tree diversity to match/suit
123Agroforest Syst https://doi.org/10.1007/s10457-017-0172-8 farmers' priority ES. The FaD-FaN approach caters for varying socio-ecological conditions; it's adaptable for other coffee and cocoa-growing areas worldwide.