John Podesta, a seasoned Democratic strategist who worked outside the White House to increase support for President Joe Biden's climate change strategy.
McCarthy, who has led Biden's efforts to reduce carbon emissions since he took office, will leave the White House on September 16.
The White House announced the changes on Friday, as the administration turns its focus from pressing climate legislation on Capitol Hill to executing environmental policy through federal agencies.
McCarthy's retirement comes after Biden and Democrats secured record financing for climate change mitigation in the Inflation Reduction Act, which was enacted by Congress last month.
As former President Barack Obama's advisor, Podesta handled the administration's climate strategy and programs. He later co-chaired Hillary Clinton's presidential campaign in 2016.
McCarthy, 68, was the Obama administration's administrator of the Environmental Protection Agency and the CEO of the Natural Resources Defense Council until Biden appointed her to his top climate job.