Improving agricultural green total factor productivity is important for achieving high-quality economic development and the SDGs. Digital inclusive finance, which combines the advantages of digital technology and inclusive finance, represents a new scheme that can ease credit constraints and information ambiguity in agricultural production. First, this study focused on agro-ecological functions; we incorporated total agricultural carbon sequestration and emissions extraction into the evaluation system and used the mixed-direction-distance function to calculate agricultural green total factor productivity. Then, based on panel data from 31 provinces in China collected from 2011 to 2021, we used the two-way fixed effect model, the interactive fixed effect, and the plausibly exogenous variable method to test the impact of digital financial inclusion on agricultural green total factor productivity, and its mechanism of action. The panel-corrected standard error and fixed effect Driscoll–Kraay methods were used to account for the unobserved heterogeneity and cross-section dependence in the panel data. The results showed that digital financial inclusion can significantly improve agricultural green total factor productivity. This conclusion remained valid following robustness tests using the spatial econometric model and the method of changing explanatory variables. Digital financial inclusion can improve agricultural green total factor productivity by facilitating the transfer of agricultural land. Sound digital infrastructure and strict green credit policies enhance the role of digital inclusive finance in promoting the green development of agriculture. These conclusions could help the financial sector to formulate flexible, accurate, reasonable, and appropriate financial policies and products that would support agriculture, and enhance the role of digital inclusive finance in promoting sustainable agricultural development.