The deal on Wednesday brings the Red Sox a potential replacement for closer Jonathan Papelbon, who signed as a free agent with the Philadelphia Phillies. Melancon is a 26-year-old righty who had 20 saves last season with an 8-4 record and 2.78 ERA in 71 relief outings.
Lowrie, 27, played all four infield positions for Boston last year and hit .252 with six homers and 36 RBIs. Weiland, 25, was 0-3 with a 7.66 ERA in seven games, including five starts, last year for Boston.
To make room on their 40-man roster, the Astros designated infielder Brian Bixler for assignment.