With the increasing environmental degradation, bacterial contamination is threatening human health. Thus, it is crucial to develop an efficient and safe antimicrobial strategy. In this work, the polyacrylonitrile (PAN) nanofiber membranes contained Co/Zn-metal organic framework (Co/Zn-MOF@PAN) were fabricated via electrospinning technique and surface modified method. The optimal preparation condition for nanofiber membranes were further regulated by adjusting 2-methylimidazole (2-MIM) concentration and secondary growth time. The antibacterial activity of Co/Zn-MOF@PAN against Escherichia coli (E. coli) and Staphylococcus aureus (S. aureus) were determined by turbidimetry and plate colony-counting methods. As the 2-MIM concentration and secondary growth time increased, the hydrophilicity and surface roughness of Co/Zn-MOF@PAN nanofiber membranes increased. In addition, when the 2-MIM concentration was 0.16 mol/L, the Co/Zn-MOF@PAN nanofiber membranes had an antibacterial rate of over 99% against E. coli and S. aureus., and the minimum inhibitory concentration (MIC) value of Co/Zn-MOF@PAN nanofiber membranes was 0.75 mg/mL. It could be indicated that Co/Zn-MOF@PAN nanofiber membranes exhibited an excellent antibacterial effect. The main antibacterial mechanism of nanofiber membranes was that ROS produced by MOFs could destroy the physiological activities of the bacteria lead to death. The Co/Zn-MOF@PAN nanofiber membranes will have a wide range of applications value in the fields of antibacterial packaging materials and sterilization of water resources.