Escherichia coli is one of the most important microbial cell factories, but infection by bacteriophages in the environment may have a huge impact on its application in industrial production. Here, we developed a mobile CRISPR-Cas9 based anti-phage system for bacteriophages defense in E. coli. Two conjugative plasmids pGM1 (phosphoglucomutase 1) and pGM2 carrying one and two guide RNAs, respectively, were designed to defend against a filamentous phage. The results showed that the pGM1 and pGM2 could decrease the phage infection rate to 1.6% and 0.2% respectively in infected cells. For preventing phage infection in E. coli, the pGM2 decreased the phage infection rate to 0.1%, while pGM1 failed to block phage infection. Sequence verification revealed that point mutations in protospacer or protospacer adjacent motif sequences of the phage genome caused loss of the defense function. These results support the potential application of MCBAS in E. coli cell factories to defend against phage infections.