Magee was elected as a Republican to the Sixty-eighth and Sixty-ninth Congresses. He was an unsuccessful candidate for renomination in 1926. He served as chairman of the Pennsylvania Securities Commission in Harrisburg, Pennsylvania, from 1931 to 1935. He continued the practice of law in Pittsburgh until his death there. Magee was interred in Calvary Cemetery, Pittsburgh, Pennsylvania.