Coffee endophytes have been studied for almost 74 years, and several studies have demonstrated coffee-endophytic fungi with antibacterial and antifungal potential for human and plant pathogens. In this study, we isolated and identified a total of 235 strains of endophytic fungi from coffee leaf tissues collected in four coffee plantations in Pu’er city, Yunnan province, China. Molecular identification was carried out using maximum likelihood phylogenetic analysis of nuclear ribosomal internal transcribed spacer (ITS1-5.8S rDNA-ITS2) sequences, while the colonization rate and the isolation frequency were also calculated. Two pathogenic fungi (Alternaria alternata and Penicillium digitatum) and two pathogenic bacteria (Pseudomonas syringae and Salmonella enterica subsp. enterica) were used for screening the antagonistic activities of 61 strains of coffee-endophytic fungi by a dual-culture test assay while maximum likelihood phylogenetic analysis confirmed their natural classification. This is the first study of coffee-leaf-endophytic fungal diversity in China, and the results revealed that coffee-endophytic fungi from this study belong to the Ascomycota, distributed among two classes, 10 orders, and 17 families. Concurrently, endophytic fungi isolates distributed in Arthrinium, Biscogniauxia, Daldinia, Diaporthe, and Nigrospora showed strong antagonistic activities against the pathogens. For the pathogens Alternaria alternata and Pseudomonas syringae, Nigrospora XCE-7 showed the best inhibitory effects with inhibition rates of 71.76% and 61.11%, respectively. For the pathogen Penicillium digitatum, Daldinia ME-9 showed the best inhibitory effect with a 74.67% inhibition rate, while Biscogniauxia PTE-7 and Daldinia T5E-1-3 showed the best inhibitory effect with a rate of 60.42% against the pathogen Salmonella enterica subsp. enterica. Overall, our study shows the diversity of coffee endophytes in four coffee-growing areas in Pu’er city, Yunnan province, China, and their potential use as biological control agents against two fungal and two bacterial pathogens.