MacGillivray began his career as a reserve team goalkeeper for Harrogate Railway Athletic, eventually earning a move to Stalybridge Celtic in 2011. After making four appearances for Stalybridge in an injury–hit season, MacGillivray joined Harrogate Town in August 2012. 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. He was linked with moves to a number of Football League clubs during this time.
Despite agreeing a two–year deal with Harrogate in November 2012, MacGillivray joined League One side Walsall on 13 June 2014 on an initial one-year deal after the two clubs agreed a compensation package. 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. On 20 May 2015, MacGillivray signed a new one-year contract with the club. 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. 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.
On 5 July 2017, MacGillivray joined fellow League One side Shrewsbury Town on a free transfer on a one-year deal. He was offered a new contract by Shrewsbury at the end of the 2017–18 season.
Portsmouth
On 4 June 2018, League One club Portsmouth announced that MacGillivray had signed on a two-year deal. 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. 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. Portsmouth went on to win the shootout 5–4.