B vitamins are essential for human life and their disorders can cause a variety of diseases. Solid-phase extraction (SPE) coupled to LC-MS/MS is a preferred technique for determining multiple B vitamins, however, their complexity in real biological matrices makes it hard to achieve satisfactory recovery and accuracy when simultaneous detection. In this study, a novel automated multi-cycle magnetic SPE (MSPE) coupled to the LC-MS/MS method was established using a mixed-mode anion exchange magnetic adsorbent for the simultaneous extraction of six functional B vitamins, including methylmalonic acid, riboflavin, pantothenic acid, 4-pyridoxic acid, folic acid, and 5-methyltetrahydrofolate. After three consecutive MSPE cycles, the recoveries of all analytes were between 51.5% and 89.6%. The method exhibited excellent sensitivity and linearity, with a dynamic range of 200-fold (R > 0.99 for all analytes), exceptional accuracy (ranging between 95.4% and 105.6%) and precision (with RSDs ≤ 6.2%) without significant matrix effects or interferences. Compared to manual SPE method, the automated multi-cycle MSPE method has better feasibility and greater vitamin coverage. It shows a high correlation with the manual method for the detection of 5-methyltetrahydrofolate and folate (R > 0.99). A study of patients from the gastroenterology department showed that those undergoing surgery and those with malignancies may be at risk of folate deficiency. In addition, patients with hyperhomocystinemia had higher levels of methylmalonic acid and lower levels of 5-methyltetrahydrofolate, which correlated with homocysteine levels (R = 0.404 and -0.311, respectively) and showed dose-response relationships. This method is highly automated and cost-effective, with minimal systematic error, making it suitable for the analysis of clinical samples.