Intestine barrier serves as the front-line of shrimp defense, which rely on its structural integrity, microbial composition, and mucus immune compounds. Mucins are the major organic components of the intestine mucus layer that contribute to the immunity of intestine mucus. In this study, we examined the histological structure, microbial composition, and mucin genes expression in the intestines of Litopenaeus vanmei under three different conditions: control, ammonia stress, and nitrite stress for 72h. H&E stain showed that ammonia and nitrite stress exposure both damaged the intestine mucosal tissue. High-throughput 16S rDNA sequencing revealed that two stresses exposure decreased the bacterial diversity, and altered the composition of intestine microbial. Specifically, the dominant bacterial phyla Bacteroidetes abundance was increased, while Proteobacteria and Planctomycetes were decreased; at the genus level, Formosa abundance was increased and Photobacterium was decreased, opportunistic pathogens including Nautella and Pseudoalteromonas was also increased. Intestine mucus immune genes including mucin-2 and mucin-19 were up-regulated, while mucin-1, mucin-5AC, and mucin-5B were down-regulated in two stress exposure groups. These results revealed that ammonia and nitrite stress harmed the intestine barrier function of L. vannamei by damaging the mucosal tissue, disrupting the composition of intestine microbial, and suppressing the immune function.