After Biloxi's 2015 season ended, the Brewers promoted López to the major leagues.[4] He made his major league debut on September 29, 2015.[6] In 2016, López began the season with the Colorado Springs Sky Sox of the Triple–APacific Coast League, but struggled, pitching to a 6.81 ERA in 17 games started. He was demoted to Biloxi.[7] López pitched for the Puerto Rican national baseball team in the 2017 World Baseball Classic. In the 2017 season, López returned to Biloxi. He pitched to a 4.61 ERA as a starting pitcher, and then became a relief pitcher, and had a 3.62 ERA in that role. He made one appearance for the Brewers in 2017, pitching two innings and allowing one run on four hits on June 29.[8]
During the 2017–18 offseason, López pitched for the Águilas Cibaeñas of the Dominican Professional Baseball League.[8] López began the 2018 season with Colorado Springs. The Brewers again promoted him to the major leagues on April 11.[9] He made one appearance, on April 16, before being returned to Colorado Springs on April 17.[10]
Kansas City Royals
On July 27, 2018, López, along with teammate Brett Phillips, was traded to the Kansas City Royals for Mike Moustakas.[11] On September 8, in his seventh major league start, López flirted with a perfect game as he retired 24 consecutive Minnesota Twins batters in order over eight innings.[12] In the ninth inning, López surrendered a leadoff walk to Max Kepler and a hit to Robbie Grossman before walking off the mound at Target Field to a standing ovation. He became the first pitcher in Royals history to bring a perfect game into the ninth inning, besting Bret Saberhagen's seven-inning attempt vs. the Seattle Mariners. He was designated for assignment on August 7, 2020.
Baltimore Orioles
On August 9, 2020, the Baltimore Orioles claimed López off of waivers.[13] López ended the 2020 season with a 6.69 ERA and 28 strikeouts to partner with a 2–2 record over 10 appearances.[14] On August 21, 2021, after going 3–14 with a 6.35 ERA in 25 starts, Lopez was moved to the bullpen.[15]
In 2022, the Orioles shifted López into the closer role.[16] After pitching to a 1.62 ERA with 17 saves in 40 games during the first half of the season,[17] López represented the Orioles at the 2022 Major League Baseball All-Star Game.[18]
On January 13, 2023, López agreed to a one-year, $3.525 million contract with the Twins, avoiding salary arbitration.[20]
Miami Marlins
On July 26, 2023, López was traded to the Miami Marlins in exchange for Dylan Floro.[21] In 12 appearances for the Marlins, he struggled immensely to a 9.26 ERA with 8 strikeouts in 11+2⁄3 innings pitched. On September 2, he was optioned to the Triple–A Jacksonville Jumbo Shrimp after Johnny Cueto was activated from the injured list.[22]
Baltimore Orioles (second stint)
On September 2, 2023, López was claimed off waivers by the Baltimore Orioles.[23][24] In 12 appearances for Baltimore, he posted a 5.25 ERA with 14 strikeouts in 12 innings pitched. On September 30, López was designated for assignment by the Orioles.[25] He cleared waivers and elected free agency on October 5, 2023.[26]
New York Mets
On December 14, 2023, López signed a one-year, $2 million contract with the New York Mets.[27] On May 29, 2024, López was ejected in the eighth inning of a 10–3 loss to the Los Angeles Dodgers by the third base umpire. While walking off the field, he threw his glove into the stands and untucked his shirt. In a postgame interview, López seemingly called the Mets "the worst team in all of fucking MLB."[28] He was designated for assignment by the Mets the next day.[29] On June 5, López was released by the team.[30] In 28 games for the Mets, he compiled a 3.76 ERA with 19 strikeouts across 26+1⁄3 innings pitched.[31]
Chicago Cubs
On June 11, 2024, López signed a minor league contract with the Chicago Cubs.[32] He made three scoreless appearances for the Triple–A Iowa Cubs, striking out one batter in 2+2⁄3 innings. On June 28, the Cubs selected López's contract, adding him to their major league roster.[33] On November 1, the Cubs elected López to become a free agent.[34]
Washington Nationals
On January 11, 2025, López signed a one-year, $3 million contract with the Washington Nationals.[35]