Serotonin (5-hydroxytryptamine) is an essential neurotransmitter involved in regulating various behaviors in plant-parasitic nematodes, including locomotion, egg laying, feeding, and mating. However, the functional role of serotonin in root-knot nematode invasion of host plants and the molecular mechanisms underlying feeding behavior remain poorly understood. In this study, we tested the effects of exogenous serotonin and the pharmacological compounds fluoxetine and methiothepin on the feeding behaviors of Meloidogyne graminicola. Our results suggested that M. graminicola possesses an endogenous serotonin signaling pathway and that serotonin plays a crucial role in modulating feeding behaviors in M. graminicola second-stage juveniles. We also identified and cloned the serotonin synthesis enzyme tryptophan hydroxylase (Mg-tph-1) in M. graminicola and investigated the role of endogenous serotonin by generating RNA interference nematodes in Mg-tph-1. Silencing Mg-tph-1 substantially reduced nematode invasion, development, and reproduction. According to the immunostaining results, we speculated that these serotonin immunoreactive cells near the nerve ring in M. graminicola are likely homologous to Caenorhabditis elegans ADFs, NSMs, and RIH serotonergic neurons. Furthermore, we investigated the impact of phytoserotonin on nematode invasion and development in rice by overexpressing OsTDC-3 or supplementing rice plants with tryptamine and found that an increase in phytoserotonin increases nematode pathogenicity. Overall, our study provides insights into the essential role of serotonin in M. graminicola host plant parasitism and proposes that the serotonergic signaling pathway could be a potential target for controlling plant-parasitic nematodes.