Tourism is an important method for the revitalization and utilization of agricultural cultural heritage, with farmers playing a pivotal role in the development of agricultural heritage tourism (AHT). The implementation of AHT from the lens of farmer participation is essential for fostering the sustainable growth of agricultural cultural heritage. Based on 257 questionnaires of farmers in two villages using Anshan Nanguo pear cultivation systems, this study uses structural equation modeling (SEM) to explore the mechanism influencing farmers’ willingness to participate in AHT development. The findings reveal that (1) participation opportunity, participation ability, and identity recognition have significant positive effects on participation in AHT development willingness, while participation motivation has no significant positive effect on participation in AHT development willingness; (2) participation opportunity, participation ability, and identity recognition have significant positive effects on participation motivation; (3) participation motivation has a partial mediating effect among participation opportunity, participation ability, identity recognition, and participation in AHT development willingness. The strategies and recommendations put forth in this article have substantial practical implications for enhancing farmers’ willingness to participate in AHT development. Furthermore, this research contributes to broadening the research perspectives on AHT and promoting the sustainable preservation and tourism utilization of agricultural heritage within community participation frameworks.