BackgroundEpilepsy is one of the most prevalent serious brain disorders globally, impacting over 70 million individuals. Observational studies have increasingly recognized the impact of plasma lipidome on epilepsy. However, establishing a direct causal link between plasma lipidome and epilepsy remains elusive due to inherent confounders and the complexities of reverse causality. This study aims to investigate the causal relationship between specific plasma lipidome and epilepsy, along with their intermediary mediators.MethodsWe conducted a two-sample Mendelian randomization (MR) and mediation MR analysis to evaluate the causal effects of 179 plasma lipidomes and epilepsy, with a focus on the inflammatory cytokine as a potential mediator based on the genome-wide association study. The primary methodological approach utilized inverse variance weighting, complemented by a range of other estimators. A set of sensitivity analyses, including Cochran’s Q test, I2 statistics, MR-Egger intercept test, MR-PRESSO global test and leave-one-out sensitivity analyses was performed to assess the robustness, heterogeneity and horizontal pleiotropy of results.ResultsOur findings revealed a positive correlation between Phosphatidylcholine (18:1_18:1) levels with epilepsy risk (OR = 1.105, 95% CI: 1.036–1.178, p = 0.002). Notably, our mediation MR results propose Tumor necrosis factor ligand superfamily member 12 levels (TNFSF12) as a mediator of the relationship between Phosphatidylcholine (18,1_18:1) levels and epilepsy risk, explaining a mediation proportion of 4.58% [mediation effect: (b = 0.00455, 95% CI: −0.00120-0.01030), Z = 1.552].ConclusionOur research confirms a genetic causal relationship between Phosphatidylcholine (18:1_18:1) levels and epilepsy, emphasizing the potential mediating role of TNFSF12 and provide valuable insights for future clinical investigations into epilepsy.