Bar a one-season loan at Notts County earlier in his career, McGregor has spent his entire professional career with Celtic, having come through the club's youth ranks.
McGregor has made 420 appearances for the Hoops, scoring 62 goals and has won 20 trophies with Celtic, including the domestic treble on five occasions.
He was handed the Celtic captaincy after Scott Brown departed in 2021.
The 30-year-old told the club’s official website: “It’s amazing to extend my stay at the club. As I’ve touched on before, this club means so much to me and the success that we’ve had over the past few seasons has cemented that.
“I feel like the club’s in a great place to move forward as well, and when they came and asked me to extend my stay I was absolutely delighted.
“Brendan’s a top manager and I had the pleasure of working with him before and seeing what he did with that group of players, especially a young, hungry group similar to ourselves, and the way he progressed us and took us on.
“His personality around the place gives the building another lift as well, so the club’s in a really strong place.
“We did some great work over the last couple of years but it’s important that we bank that and we continue to move forward because in football you always have to continue your progress and get even better.
“I’m delighted that the manager’s back, I’m delighted that I’m going to be here long-term as well, so here’s to many more successful years.
“I just want it to continue for as long as possible. I’ve spoken before about the trust that the guys have put in me at this club, and I want to repay that every time I go on the pitch.
“They’ve been amazing for myself and for my family. It’s given me a wonderful life and some amazing memories.
“Together with the Celtic fans what we’ve achieved are memories that will stay with me forever, and there’s only one place that I want to play football and that’s here.”