This study examines the impact of capital market openness on corporate green total factor productivity (GTFP) using a quasi-natural experiment based on the Shanghai-Hong Kong and Shenzhen-Hong Kong Stock Connect policies. Employing a multi-period difference-in-differences (DID) approach, the findings reveal that capital market openness significantly enhances corporate GTFP through two primary mechanisms: strengthening firms’ green financial resources and technological innovation (green “hard strength”) and improving corporate environmental governance, green information disclosure, and managerial green expertise (green “soft strength”). Further heterogeneity analysis suggests that firms with greater institutional investor engagement, higher market competition, and non-state ownership exhibit stronger responses. These results provide policy insights into leveraging financial liberalization to drive corporate sustainability and green economic growth. This study highlights the role of financial markets in supporting global carbon neutrality and sustainable development goals.