As environmental challenges escalate, green development is crucial for sustainability. This study analyzes China's county-level agricultural green total factor productivity using SBM and ML index, introducing a comprehensive index to quantify the impact of different types of environmental regulations on productivity. The findings reveal the following: baseline analysis reveals that comprehensive environmental regulation notably boosts agricultural green total factor productivity (AGTFP), with regulatory intensity positively linked to productivity growth. Other factors like policy intervention, industrial structure, savings levels, and per capita GDP also favorably impact productivity. All three types of regulations, command, incentive, and voluntary type, substantially enhance AGTFP. The mediating effect test results show that all three types of regulations directly and positively impact AGTFP. Indirect effects vary: command-type regulation's mediating effect through independent R&D is significant, accounting for 39% of the impact. For incentive type, both industry structure upgrading (23.79%) and independent R&D (3.1%) mediate the effect. For voluntary type, technological advancement via independent R&D mediates about 13.0% of the impact. Heterogeneity analysis reveals distinct impacts of different environmental regulations on AGTFP across regions. Command-type regulation is most effective in the west, while in the central region, both command- and incentive-type regulations have similar promotional effects. In the east, incentive- and voluntary-type regulations show stronger impacts. Robustness tests, including endogeneity testing, dependent variable substitution, sample winsorizing, and model substitution, consistently confirm the baseline finding that environmental regulation significantly boosts AGTFP.