McGregor began his career with Scottish club Celtic, coming through the club's youth system alongside Dylan McGeouch who was also a teammate in youth Victory Shield internationals at Under-16 level; at that time McGregor was a pupil at Lochend Community High School in Easterhouse. He scored a hat-trick for Celtic in the 8–0 2012 Scottish Youth Cup Final victory over Queen of the South at Hampden Park. McGregor appeared in four successive Scottish Youth Cup finals between 2010 and 2013, with club winning all of them. He joined English League One club Notts County on a five-month loan in August 2013. He scored on his debut for the "Magpies" on 7 August, in a 3–2 win over Fleetwood Town at Meadow Lane in the First Round of the League Cup. McGregor made his first team debut for Celtic against KR Reykjavík on 15 July 2014 in a Champions League qualifier and he scored the only goal of the game. He also scored against Legia Warsaw and NK Maribor in subsequent qualifying rounds. McGregor made his Scottish Premiership debut against St Johnstone on 13 August 2014 and scored a goal in a 3–0 victory for Celtic. On 29 August 2014, McGregor signed a new five-year contract with Celtic. He made his 100th appearance for the club in a 2–1 win at Dundee on 19 March 2017. McGregor scored in two successive Old Firm victories against Rangers in the space of a week in April 2017. In the 2017 Scottish Cup Final, McGregor started in his usual midfield position but played the majority of the match at left back after an injury to Kieran Tierney. His replacement in midfield, Tom Rogic, scored the winning goal for Celtic. Having previously been on target in qualifying matches, on 31 October 2017 McGregor scored his first goal in the group stages of the Champions League, striking the equaliser at home to Bayern Munich, although the German team responded to claim a 2–1 win. Celtic then dropped into the 2017–18 UEFA Europa League, in which McGregor scored the only goal in the first leg of the last-32 tie with Zenit St Petersburg. On 19 May 2018, McGregor scored the opening goal in the Scottish Cup final. This secured a second consecutive domestic treble for Celtic, the first time this had been done in Scottish football history. McGregor signed a new contract with Celtic in December 2018, which is due to run until the end of the 2022-23 season. He made his 200th Celtic appearance against Hibernian at Easter Road in the same month. In May 2019, he was nominated for the season's PFA Scotland Players' Player of the Year; the award was won by teammate James Forrest. However, McGregor beat Forrest to Celtic's club awards, winning both the official and the players' category accolades. He played more minutes than any other player in world football for club and country 2018–19, as Celtic won a third consecutive treble.
International career
Making his debut in October 2013, McGregor made five appearances and scored one goal for the Scotland national under-21 football team. He was added to the full Scotland squad for the first time in August 2014, soon after he broke into the Celtic first team. In October 2017, McGregor was once again included in the full squad for two 2018 World Cup qualifiers against Slovakia and Slovenia, but remained on the bench during both games. He made his debut a month later, starting in a friendly against the Netherlands.
Personal life
In February 2016 McGregor was stopped by the police and charged with drunk driving, having already been convicted and banned for speeding the previous year; he was later disqualified for a year.