The liver-expressed antimicrobial peptide 2 (LEAP2) is gaining recognition for its immune regulatory functions beyond direct antimicrobial activity. In this study, we investigated the role of mudskipper (Boleophthalmus pectinirostris) LEAP2 (BpLEAP2) in enhancing the survival, gut health, and immune resilience against Edwardsiella tarda infection. Pre-oral delivery of BpLEAP2 significantly improved survival rates and mitigated infection-induced damage to the gut, as evidenced by preserved villus length and goblet cell count. Analysis of gut microbial communities using 16S rRNA sequencing revealed that pre-oral delivery of BpLEAP2 increased microbial diversity, evenness, and the abundance of beneficial genera such as Pseudoalteromonas and Shewanella, while reducing pathogenic genera like Pseudorhodobacter. Metabolomic profiling showed that BpLEAP2 altered the gut metabolite composition, significantly increasing levels of bile acids and amino acids, which are known to support gut health and immune responses. Correlation analysis demonstrated strong positive associations between BpLEAP2-induced microbial shifts and increased metabolites involved in amino acid metabolism. These findings suggest that BpLEAP2 promotes intestinal homeostasis by modulating gut microbiota composition and enhancing beneficial metabolite production, ultimately improving gut barrier integrity and conferring resistance against E. tarda infection. This study highlights the potential application of BpLEAP2 in enhancing disease resilience in aquaculture species, offering a promising strategy for sustainable aquaculture practices.