Son of a Perthshire farmer, Barclay attended school at Muthill before studying Divinity at the University of St Andrews, with a view to entering the ministry. After a period of ten years as a Church of Scotland minister he went on to study medicine, gaining his MD at the University of Edinburgh in 1796. Barclay went on to be a popular lecturer and was subsequently required to lecture twice daily with one of his many students, Robert Liston, going on to become a lifelong collaborator.
Barclay offered his sizeable personal anatomical collections to the College in 1821, on the understanding that they build a suitable space to accommodate them. After Barclay's death in 1826, the college interred his collection in the upper level of the Playfair Hall when it was completed in 1832; now the Pathology Museum of Surgeons' Hall Museums.