The 29-year-old Australia international has put pen to paper on a two-year deal after his contract with Boro was terminated by mutual consent.
McDonald is new Lions boss Steve Lomas' sixth summer signing and could get his first taste of action in Saturday's testimonial for skipper Paul Robinson, against Rayo Vallecano at The Den.
Lomas told the club's website: "I've watched Scott throughout his career and he has a proven track record, scoring at better than one in three games over a long period.
"He works hard for the team, links play well and can operate in different formations.
"The great thing from our point of view is that he's hungry to do well. He's got his eye on next summer's World Cup for Australia and knows that to get into the squad he needs to be scoring goals for Millwall."