This article empirically analyzes the effects of community care on mental health of senior people by using a hierarchical linear model based on China Health and Retirement Longitudinal Study date. The results show that: first of all, the mental health problems of the elderly have been quite serious, and there are significant class differences in the mental health of the elderly, that is, the elderly with agricultural hukou, low income and low education level have a higher degree of mental depression. Secondly, the community care has a significant positive correlation with the mental health level of the elderly. The positive effects of community care on mental health are heterogeneous among different groups, the elderly with agricultural hukou and low income benefit more from community. In the context of aging, economic and health inequality, it is of great significance to strengthen the construction of community care. Finally, the paper puts forward policy suggestions about improving community care for the elderly from community infrastructure construction and community social capital cultivation.