The efficacy of 23 bacterial isolates obtained from surface-sterilized stems and leaves of three medicinal plants (Aloe barbadensis Miller, Artemisia afra, and Moringa oleifera) was investigated in an endeavour to prevent the growth of Mycobacterium bovis using the cross-streak method. Endophytes were isolated by incubating sterile plant materials on nutrient agar at 30 °C for 5 days. Two isolates showing activity were subsequently utilized to produce the extracts. Whole-genome sequencing (WGC) was used to identify the isolates. Secondary metabolites produced after 7 days of growth in nutrient broth were harvested through extraction with ethyl acetate. The extracts were chemically profiled using gas chromatography–high resolution time-of-flight mass spectrometry (GC–HRTOF-MS). NCBI BLAST search results revealed that the isolated endophytes belonged to the Pseudomonas and Enterobacter genera, based on WGC. Two endophytes, Aloe I4 and Aloe I3–I5 from Aloe barbadensis, exhibited potency based on the cross-streak method. The metabolite profiling of the selected endophytes identified 34 metabolites from Aloe I4, including ergotamine, octadecane, L-proline and 143 other metabolites including quinoline and valeramide, which inhibit microbial quorum sensing. These findings suggest that bacterial endophytes from medicinal plants, particularly Aloe barbadensis, hold promise as sources of antimycobacterial agents for human health applications.