In this study, rapid and cost-effective biosynthesis of silver nanoparticles (AgNPs) was synthesized by using Piper longum (P. longum) catkin extract. The bioreduction of AgNPs was initially confirmed by using UV-visible spectroscopy which exhibits characteristic absorption peak at 450 nm in 120 s when exposed to sunlight. The phytoconstituents responsible for the reduction of AgNO 3 to Ag NPs were examined using Fourier transform infrared spectroscopy. The crystalline nature of Ag NPs was confirmed using the X-ray diffraction pattern. Morphological studies confirmed the synthesized Ag NPs were monodispersed and spherical in shape with the size ranging from 15 to 40 nm. The zeta potential analysis of the synthesized AgNPs exhibit negative value (− 24.3 mV), which indicates higher stability. Further, the proficiency of the synthesized AgNPs was evaluated against mastitis-causing bacteria. Hence, the Ag NPs showed the maximum zone of inhibition against Staphylococcus aureus (12.45 mm), Pseudomonas aeruginosa (12.34 mm), and Bacillus subtilis (9.75 mm). In addition, the catalytic efficiency of Ag NPs was investigated for the conversion of methyl orange to hydrazine derivatives, methylene blue to leuco methylene blue, and o-nitrophenol to o-aminophenol in 4, 5 and 3 min, respectively. Hence, this study explores the doctrine of green chemistry for the rapid production of AgNPs that act as a potential candidate to alleviate mastitis-causing bacteria and clear up diverse environmental problems.