Introduction Post-stroke depression (PSD) is one of the common complications after stroke. Trimethylamine-N oxide (TMAO) has been reported to exacerbate brain injury after ischemic stroke, and its expression is positively related to the severity of depressive symptoms. This study was performed to investigate the role and mechanism of TMAO in PSD. Methods The classical stroke model was combined with spatial constraint stress to establish a PSD mouse model, and the effect of TMAO on the depression-like behavior of the PSD mouse model was evaluated using the tail suspension test and the forced swimming test. ELISA was employed to measure the concentration of TMAO and cortisol. RT-qPCR, Western blot, and Immunohistochemistry assay were implemented to determine mRNA and protein expression. Endothelial permeability was assessed using the fluorescein isothiocyanate-dextran permeability assay in vitro. Reactive oxygen species (ROS) level was examined with a ROS detection kit. Results TMAO dose-dependently exacerbated depression-like behavior, induced the activation of the p38/mitogen-activated protein kinase (MAPK) signaling pathway, downregulated the abundance of tight junction proteins, and resulted in the dysregulation of neurotrophic mediators in the PSD mouse model in vivo. Further, TMAO increased endothelial permeability and activated reactive oxygen species-p38/MAPK signaling. By introducing the p38/MAPK pathway inhibitor SB203580, TMAO was found to downregulate the expressions of tight junction proteins and promoted endothelial permeability via p38/MAPK signaling activation. Discussion By activating the ROS-P38/MAPK pathway, TMAO enhanced the permeability of the blood–brain barrier after stroke. These mechanisms resulted in the dysregulation of neurotrophic mediators, ultimately leading to PSD progression.