Governments worldwide have taken unprecedented social distancing and community lockdown measures to halt the COVID-19 epidemic, leaving millions of people restrained in locked-down communities and their mental well-being at risk. This study examines Chinese rural residents' mental health risk under emergency lockdown during the COVID-19 pandemic. It investigates how the environmental, socioeconomic, and behavioral dimensions of community support affect mental health in this emergency context. We also explore whether community support's effectiveness depends on the strictness of lockdown measures implemented and the level of individual perceived COVID-19 infection risk. We collect self-reported mental health risk, community support, and demographics information through a cross-sectional survey of 3892 Chinese rural residents living in small towns and villages. Ordinary least square regressions are employed to estimate the psychological effects of community support. The results suggest that the COVID-19 epidemic and lockdown policies negatively affect psychological well-being, especially for rural females. The capacity for community production has the largest impact on reducing mental health risks, followed by the stability of basic medical services, community cohesion, housing condition, the stability of communications and transportation supply, and the eco-environment. The effectiveness of different community support dimensions depends on the level of lockdown policy implemented and the levels of one's perceived risk of COVID-19 infection. Our study stresses the psychological significance of a healthy living environment, resilient infrastructure and public service system, and community production capacity during the lockdown in rural towns and villages.