McWilliams attended the public schools and Norwich Free Academy.
He graduated from Mercersburg Academy in Pennsylvania in 1910.
He worked in the building industry in Norwich, Connecticut.
During the First World War, he served as a private in the Twentieth Engineers, United States Army, with overseas service, from March 26, 1918, until discharged on July 1, 1919.
He resumed the building business.
He served as a selectman of the town of Norwich, Connecticut from 1935 to 1942.
McWilliams was elected as a Republican to the Seventy-eighth Congress (January 3, 1943 – January 3, 1945).
He was an unsuccessful candidate for reelection in 1944 to the Seventy-ninth Congress.
He was employed at the electric boat division of General Dynamics Corporation, Groton, Connecticut from 1950 to 1960.
He was employed by the city of Norwich, where he resided until his death thereon March 30, 1975.
He was interred in Maplewood Cemetery, Norwich, Connecticut.