The former skipper was cut from Gregor Townsend's final squad for the tournament in August, but an injury to Dave Cherry at the team hotel saw the forward drafted in to join the squad in France.
"It was a privilege to end my career being part of the 2023 Scotland Rugby World Cup squad and, for now, my rugby story is over.
Former Scotland fullback Chris Paterson said McInally should be proud of what he has achieved.
"It's horrible and it's all happened to one of the best guys you could ever meet - a brilliant bloke.
Scotland are third in Pool B at the World Cup after losing to South Africa in their opener and beating Tonga on Sunday.
Persons:
Scotland's Stuart McInally, Lee Smith, Gregor Townsend's, Dave Cherry, McInally, Chris Paterson, he's, Peter Rutherford, Sonali Paul
Organizations:
Rugby Union, Six Nations, Scotland, England, BT, Calcutta, Scotland Rugby, BBC, South, Tonga, Sunday, Thomson
Locations:
Edinburgh, Scotland, Britain, France, South Africa, Romania, Ireland, Seoul