"I look forward to a successful treatment and returning to continue the mission that I've started as a member of Congress," the 69-year-old New York Democrat said in a statement.
McCarthy was first elected to the House of Representatives in 1996, three years after her husband was killed in a shooting spree on a Long Island, New York, commuter train.
Her son was also severely injured in the attack, which prompted McCarthy to start a campaign for more stringent gun control that led to her election to Congress.
McCarthy will undergo treatment at the Memorial Sloan-Kettering Cancer Center in New York. Her illness was discovered during a recent annual health exam.
"My doctor ... has told me that I begin my treatment in good physical health and that he looks forward to my return to work after I recover," McCarthy said.
"My family and I will appreciate privacy while I undergo my treatment, she said.
McCarthy serves on the Financial Services Committee and the Education and Workforce Committee in the House.
(Reporting by Doug Palmer; Editing by Doina Chiacu)