He was the youngest son of John MacMahon, comptroller of the Port of Limerick, and his second wife Mary Stackpoole, daughter of James Stackpoole. He had a full brother, Sir William MacMahon, 1st Baronet, Master of the Rolls in Ireland, and an elder half-brother, Sir John McMahon, 1st Baronet, Private Secretary to the Prince Regent from 1811 to 1817. He had at least one sister, who married a Mr O'Halloran: her daughter, whose first name is uncertain, was the first wife of the writer and politician Richard Lalor Sheil. She died in childbirth in 1822.
While Thomas and William were both gifted men, their early careers were hampered by their relatively humble social origins, and there is little doubt that their half-brother's political influence greatly assisted them in their rise to prominence.