Escherichia coli is a major etiologic agent of cow mastitis, a condition that results in huge economic losses. There is a lack of an oral vaccine for cow mastitis. Previous studies have confirmed that the outer membrane protein A (OmpA) of E. coli is immunogenic and can be used for vaccine design. In the present study, OmpA was encapsulated into nanoparticles (NP-OmpA) for an oral vaccine for cow mastitis. Methods: OmpA was purified with Ni-NTA flow resin and encapsulated with chitosan (CS) to prepare NP-OmpA nanoparticles. The gastrointestinal tract was simulated in vitro (PBS, pH 1.2) to measure the protein release rate. The optimal preparation conditions for NP-OmpA were determined by analyzing the concentrations of OmpA and CS, magnetic mixing speed, mixing time, and the ratio of tripolyphosphate (TPP)/CS (w/w). NP-OmpA safety was assessed by function factors and histopathological examination of livers and kidneys. The immune activity of NP-OmpA was determined using qRT-PCR to assess immune-related gene expression, leukocyte phagocytosis of Staphylococcus aureus, ELISA to evaluate antiserum titer and immune recognition of E. coli, and the organ index. The immune protection function of NP-OmpA was assessed by the protection rate of NP-OmpA to E. coli in mice, qRT-PCR for inflammation-related gene expression, assay kits for antioxidant factors, and visceral injury in the histopathological sections. Results: NP-OmpA nanoparticles had a diameter of about 700 nm, loading efficiency (LE) of 79.27%, and loading capacity (LC) of 20.31%. The release rate of NP-OmpA (0~96 h) was less than 50% in vitro. The optimal preparation conditions for NP-OmpAs were OmpA protein concentration of 2 mg/mL, CS concentration of 5 mg/mL, TPP/CS (w/w) of 1:1, magnetic mixing speed of 150 r/min, and mixing time of 15 min. Histopathological sections and clinical analytes of uric acid (UA), creatinine (Cr), alanine aminotransferase (ALT), aspartate transaminase (AST), catalase (CAT), glutathione (GSH), and malondialdehyde (MDA) showed NP-OmpA did not damage mice livers or kidneys. NP-OmpA could enhance the immune-related gene expression of IFN-γ and HSP70 in the spleen, liver, and kidney and the leukocyte phagocytosis of S. aureus. The antiserum titer (1:3200) was obtained from mice immunized with NP-OmpA, which had an immune recognition effect to E. coli. The immune protection rate of NP-OmpA was 71.43% (p < 0.05) to E. coli. NP-OmpA could down-regulate the inflammation-related gene expression of TNF-a, IL-6, and IL-10 in the spleen, liver, and kidney, and the antioxidant factors MDA and SOD in the liver, and reduce injury in the liver and kidney of mice induced by E. coli. Conclusions: A novel NP-OmpA nanoparticle was encapsulated, and the optimal preparation conditions were determined. The NP-OmpA was safe and had good immune functions. They are expected to induce a response that resists infection with the major etiologic agent (E. coli) of cow mastitis.