Suicidal ideation (SI) is a common symptom of major depressive disorder (MDD), often accompanied by cognitive alterations and emotional dysregulation. However, it is unclear whether cognitive dysfunction in patients with MDD is related to the presence or absence of SI and impaired connectivity within or between large-scale neurocognitive networks. Previous studies have shown that the frontoparietal network (FPN) and default mode network (DMN) are critical for cognitive control and emotional regulation. Participants were 51 MDD patients with suicidal ideation (MDDSI), 52 MDD patients without suicidal ideation (MDDNSI), and 55 healthy controls (HC). Using areas located within FPN and DMN networks as regions of interest (ROIs), we compared the cognitive performance of the three groups and the strength of the resting state functional connections (RSFC) within and between the FPN and DMN networks. Additionally, we examined the correlation between the strength of FC within the FPN and cognitive function in the SI group. Furthermore, network-based statistics (NBS) were used to correct for the strength of FPN and DMN functional connections. The study identified significant cognitive deficits in MDD patients. Reduced strength of FC was observed within the FPN and DMN networks in the SI group compared to the NSI group. In the SI group, the strength of FC within the FPN network was positively correlated with attention/vigilance. These insights underscore the critical roles of the FPN and DMN in the suicidal ideation, shedding light on the cognitively relevant neurobiological characteristics of MDDSI, providing new insights into the neural mechanisms of MDDSI.URL: https://www.chictr.org.cn/bin/project/edit?pid=131537.Registration number: ChiCTR2100049646.