The news is a big blow to Hull boss Steve Bruce as McGregor has been in outstanding form for City this season.
The Scotland international suffered the injury during last weekend's 2-1 defeat at Everton.
Bruce told the club's official website on Thursday: "We've just found out this morning that Allan is going to be out for five or six weeks.
"As I've said repeatedly, injuries are the one area where we needed to stay fit and healthy and this one couldn't have come at a worse time.
"Allan will be a big miss for us because he has played very, very well and we wish him a speedy recovery."
Steve Harper, signed over the summer after his contract at Newcastle expired, will stand in, starting in this weekend's trip to Tottenham.
Bruce said: "This is the reason we brought Steve in to be fair. He's got an abundance of Premier League experience and we're lucky that we can call upon somebody with his experience."