McHugh was born in Philadelphia, but spent most of his adult life in New York City. He attended Brooklyn Technical High School and Mount St. Mary's University, from which he earned a Bachelor of Science degree in 1960. He then attended the Villanova University School of Law, earning his Juris Doctor in 1963.
After several years of private practice in Ithaca, New York, he became the district attorney of Tompkins County from 1969 until 1973. For the next two years, he was a member of the state Democratic Committee.
McHugh was elected to the U.S. House in 1974, defeating his opponent, then-Binghamton Mayor Al Libous, a Republican, in the general election. McHugh won the 1974 election with 83,562 votes, while Libous placed second with 68,273 votes. He became the first Democrat to represent this district since 1915.
McHugh served in the House from January 3, 1975 until January 3, 1993. Although he was an avid civil rights supporter and member of the liberal wing of the Democratic Party, McHugh was known for his bipartisanship. McHugh was a member of the House Select Committee on Children, Youth, and Families during his final ten years in Congress. He had previously served on the Veterans' Affairs, Agricultural, and Interior Committees.
In 1992, McHugh chose not to run for reelection.
McHugh is currently a resident of Leesburg, Virginia. After retiring from the House, he originally worked as the vice president of Cornell University. He is employed by the World Bank. He also serves on the board of directors of free-enterprise advisory services firm, FTI Consulting.
Matthew has 3 daughters: Alanna, Kelli, and Meg. He also has eight grandchildren: Meghan (Alanna's daughter), Elizabeth (Kelli's daughter), Jack (Meg's son), Allison (Meg's daughter), Ryan (Meg's son), Eileen (Kelli's daughter), Grace (Meg's daughter), and Patrick (Kelli's son).