As MLB free agency opens Nov. 4, here is a ranking of the top 30 free agents, along with predictions — based on team needs, budgets and rumblings in the marketplace — of where each player will sign and for how much.

1. Max Scherzer, RHP

Prediction: Cubs — eight years, $200 million

The Cubs are ready for liftoff.

2. Jon Lester, LHP

Prediction: Cubs — six years, $140 million

This is more obvious than the Scherzer projection, given Lester’s connection with his former Red Sox general manager Theo Epstein.

3. James Shields, RHP

Prediction: Red Sox — five years, $100 million

Boston needs to upgrade its starting rotation.

4. Yasmany Tomas, OF

Prediction: Phillies — seven years, $90 million

Philadelphia desperately needs an infusion of young power, and this Cuban slugger fits the bill.

5. Russell Martin, C

Prediction: Rangers — four years, $60 million

Texas can benefit from his bat, his work with pitchers and his clubhouse leadership.

6. Pablo Sandoval, 3B

Prediction: Red Sox — five years, $100 million

The Kung Fu Panda can play third base now and replace David Ortiz down the road.

7. Victor Martinez, DH-1B

Prediction: Tigers — four years, $60 million

Does Detroit value him too much to let him leave?

8. Hanley Ramirez, SS

Prediction: Dodgers — four years, $64 million

The Dodgers can slide him over to third base after another year or two.

9. Nelson Cruz, OF

Prediction: Orioles — four years, $64 million

Baltimore really, really wants to retain him.

10. Melky Cabrera, OF

Prediction: Mariners — five years, $70 million

Could Melky’s old pal Robinson Cano recruit him to the Pacific Northwest?

11. Ervin Santana, RHP

Prediction: Giants — five years, $75 million

San Francisco wants to get a high-end starting pitcher but won’t participate in the Scherzer-Lester-Shields sweepstakes.

12. Chase Headley, 3B

Prediction: Yankees — three years, $48 million

He and the Yankees loved each other’s company, so as long as Alex Rodriguez doesn’t get in the way …

13. David Robertson, RHP

Prediction: Yankees — three years, $39 million

He’s only the second closer to receive the market-chilling qualifying offer, following the Yankees’ Rafael Soriano two years ago.

14. Andrew Miller, LHP

Prediction: Yankees — four years, $28 million

He won’t cost a draft pick, and he’d be part of a Yankees plan this winter to spread their resources around.

15. Hiroki Kuroda, RHP

Prediction: Retirement

Teams still would be interested in him, but will the soon-to-be 40-year-old be interested in them?

16. Brandon McCarthy, RHP

Prediction: Yankees — three years, $36 million

Like Headley, he quickly won over Yankees people — and quickly elevated his market — upon arriving in the Bronx.

17. Colby Rasmus, OF

Prediction: Blue Jays — two years, $24 million

He always has been a tough talent to quantify, and now he’ll get the truest test.

18. Francisco Liriano, LHP

Prediction: Rangers — three years, $37.5 million

The Rangers need starting pitching, and Liriano’s groundball tendencies make him a good fit at hitter-friendly Globe Life Park in Arlington.

19. Jed Lowrie, SS

Prediction: Athletics — three years, $27 million

Oakland, having traded shortstop prospect Addison Russell to the Cubs for Jeff Samardzija, pays up to keep its incumbent.

20. Nick Markakis, OF

Prediction: Orioles — four years, $54 million

Roch Kubatko of MASN first reported that Markakis was working with Baltimore to stay put.

21. Michael Cuddyer, OF

Prediction: Rockies — one year, $15.3 million

He could be the first player to accept his team’s qualifying offer, which Colorado extended to him Monday, in the three years of this process.

22. Asdrubal Cabrera, IF

Prediction: Nationals — two years, $23 million

He blended in well with Washington’s veterans, so he’ll stay put.

23. Torii Hunter, OF

Prediction: Royals — two years, $22 million

He’ll bring some pizzazz — and help fill the DH void left by the departing Billy Butler — to the reigning AL champions.

24. Jake Peavy, RHP

Prediction: Giants — one year, $10 million

He really would like to stay with his old manager Bruce Bochy, and he’ll show his commitment by taking a discount.

25. Nori Aoki, OF

Prediction: Rangers — three years, $24 million

Texas needs outfield help after declining to exercise Alex Rios’ team option.

26. Justin Masterson, RHP

Prediction: White Sox — two years, $18 million

The White Sox are looking for right-handed starting pitching help and know Masterson well from his time with the rival Indians.

27. Jason Hammel, RHP

Prediction: Twins — three years, $30 million

The Twins are in the starting pitching market again after bringing in Phil Hughes and Ricky Nolasco last winter.

28. Adam LaRoche, 1B

Prediction: Pirates — two years, $25 million

Since Ike Davis didn’t get it done for Pittsburgh, some help at first base is needed, and LaRoche could rejoin his old team and enjoy success this time.

29. Stephen Drew, SS

Prediction: Yankees — one year, $7 million

The Yankees will put their faith in the idea that, with a regular spring training, Drew can hit closer to his 2013 numbers than his 2014 fiasco.

30. Alex Rios, OF

Prediction: Reds — one year, $7 million

The Reds need to replace righty-hitting outfielder Ryan Ludwick, and Rios needs to rebuild his value on a short-term deal.