Mr. McCarthy announced his decision to retire at the end of the month in a statement on Wednesday.