McMahon served during the Second Boer War and on 9 October 1899 was seconded to the general staff for service as an aide-de-camp (ADC) to an infantry major-general. He was present at the 11 October Relief of Ladysmith and the 15 December Battle of Colenso. McMahon held the position of ADC until appointed as brigade major of the 6th Infantry Brigade on 29 April 1900. He served in operations in the Orange River Colony and was seriously wounded in action during operations in the Tugela Heights. He was mentioned in dispatches for his service by General Redvers Buller on 30 March 1900.