McNally, who last year received the Tony Award for Lifetime Achievement in the Theatre, died in a hospital in Sarasota, Florida, according to his publicist, Matt Polk.
He was a lung cancer survivor and had a lung disease called chronic obstructive pulmonary disease (COPD), Polk said.
McNally won two Tony Awards for writing the books for the musicals “Ragtime” in 1998 and “Kiss of the Spider Woman” in 1993.
He won two more for his plays “Love! Valour! Compassion!” and “Master Class.”
McNally, who was married to Broadway producer Tom Kirdahy, was openly gay and often wrote about the lives of gay men in his plays.
Actors mourned his loss on Twitter.