MacGillivray began his career as a reserve team goalkeeper for Harrogate Railway Athletic,[5] eventually earning a move to Stalybridge Celtic in 2011.[5] After making four appearances for Stalybridge in an injury–hit season,[6] MacGillivray joined Harrogate Town in August 2012.[5] He rejoined Harrogate Railway Athletic on loan for a brief spell in 2012. Following his return from loan, MacGillivray emerged as Harrogate Town's first–choice goalkeeper and made 90 appearances for the club over two seasons in the Conference North.[6] He was linked with moves to a number of Football League clubs during this time.[7]
Walsall
Despite agreeing a two–year deal with Harrogate in November 2012,[7] MacGillivray joined League One side Walsall on 13 June 2014 on an initial one-year deal after the two clubs agreed a compensation package.[8] He acted as a deputy to Richard O'Donnell for much of the 2014–15 season but MacGillivray eventually made his debut for the Saddlers on 25 April 2015, keeping a clean sheet in a 2–0 victory over Oldham Athletic.[9]
On 20 May 2015, MacGillivray signed a new one-year contract with the club.[10] He made eight appearances in total in 2015–16 as Walsall missed out on promotion via the play-offs and was offered a one-year deal at the end of the season.[11][12]
At the end of the 2016–17 season, Walsall and MacGillivray mutually agreed to end his contract after being unable to guarantee the stopper a regular starting place.[13]
Shrewsbury Town
On 5 July 2017, MacGillivray joined fellow League One side Shrewsbury Town on a free transfer on a one-year deal.[14]
He was offered a new contract by Shrewsbury at the end of the 2017–18 season.[15]
Portsmouth
On 4 June 2018, League One club Portsmouth announced that MacGillivray had signed on a two-year deal.[16] MacGillivray made his Portsmouth debut at Fratton Park in their opening league match on 4 August 2018, earning a clean sheet in a 1–0 win over Luton Town.[17] On 31 March 2019, MacGillivray started in goal for Portsmouth in the EFL Trophy final against Sunderland. MacGillivray made a save in the penalty shootout, saving a spot kick from Lee Cattermole.[18] Portsmouth went on to win the shootout 5–4 (2–2 after extra-time).
MacGillivray won Pompey Player of the Season for 2020–21 [19]