Miami receives minor league righty Franklin Sanchez and a player to be named or cash.
The Mets also claimed right-hander William Woods off waivers from National League East rival Atlanta.
The 27-year-old Hernandez went 3-6 with a 6.35 ERA in 20 appearances for the Marlins this year, including 10 starts. He gave up 19 home runs in 62 innings, with 60 strikeouts and 22 walks.
Over five major league seasons with Miami, he was 10-21 with a 5.04 ERA in 90 games (48 starts).
Brigham, 30, was 0-1 with a 3.38 ERA and one save in 16 relief outings for the Marlins this season. He struck out 28 and walked 10 in 24 innings.
In four big league seasons with Miami, Brigham is 3-7 with a 4.52 ERA and two saves. He has appeared in 53 games, making four starts.
Both pitchers are eligible for arbitration this winter.
The 23-year-old Woods made his major league debut this season, throwing two shutout innings in two outings for the Braves. He was 2-9 with a 4.60 ERA in 59 games (18 starts) over four minor league seasons in Atlanta's organization.
All three newcomers offer depth as the Mets rebuild their pitching staff following a playoff loss to San Diego in the wild-card round.
In the bullpen, nearly all of the team's top relievers besides Drew Smith became free agents, including Adam Ottavino, Seth Lugo, Trevor May, Joely Rodríguez, Mychal Givens, Trevor Williams and Tommy Hunter.
All-Star closer Edwin Díaz returned on a $102 million, five-year contract.
The 22-year-old Sanchez was 2-2 with a 3.79 ERA in 17 combined games (seven starts) for Low-A St. Lucie and High-A Brooklyn this year. He had 42 strikeouts and 21 walks in 35 innings.
The 6-foot-6 right-hander also pitched in the Arizona Fall League for top minor league prospects, compiling an 11.05 ERA in seven relief outings.