He was born at Enniskillen, County Fermanagh, Ireland, the third son of farmer John Magee and educated at Trinity College, Dublin, where he was elected fellow in 1788. He was ordained into the Church of Ireland in 1790. Two sermons, preached in the college chapel in 1798 and 1799, form the basis of his Discourses on the Scriptural Doctrines of Atonement and Sacrifice (1801), a polemic against Unitarian theology, which was answered by Lant Carpenter.
He was appointed professor of mathematics and senior fellow of Trinity in 1800, but resigned in 1812 to undertake the charge of the livings of Cappagh, County Tyrone, and Killyleagh, County Down. He was elected a Fellow of the Royal Society in 1813 as "a gentleman of high distinction for mathematical & philosophical knowledge & Author of several works of importance".