Arizona Diamondbacks
On December 4, 2018, MLB's Arizona Diamondbacks signed Kelly to a two-year major league contract. On April 1, 2019, Kelly made his major league debut in a start versus the San Diego Padres. He earned a win and recorded a quality start by totaling six innings while allowing three runs and striking out three. After struggling for much of the season, Diamondbacks' manager Torey Lovullo called Kelly into his office and issued a warning that he was considering sending him down. When Kelly asked why, Lovullo responded by saying, "You are statistically the worst pitcher in the National League." Kelly took this as a challenge to improve. He made some mechanical adjustments and flourished in September by going 4-1 with a 2.18 ERA in his last five starts. Overall in his first season with Arizona, Kelly led the National League in losses with 14 but led the team in wins (13) and innings (183+1⁄3). Kelly began the 2020 season in the rotation before being shut down on September 1 after 5 starts due to a shoulder injury. He returned healthy in 2021 but posted a 7–11 record over 27 starts on a Diamondbacks squad that lost 110 games.
On April 1, 2022, Kelly signed a two-year, $18 million contract extension with the Diamondbacks. He started the 2022 season with a 15-inning scoreless streak, three short of the franchise record to begin a season. Kelly won the National League Pitcher of the Month Award for July 2022 after pitching to a 1.31 ERA in six starts. He also won the National League Player of the Week Award for the week of July 25–31.
In Game 2 of the 2023 World Series, Kelly pitched a historic game. He pitched seven innings, striking out nine batters without allowing a walk. He only allowed three hits and one run. Only seven other pitchers in World Series history had ever pitched seven or more innings with that many strikeouts and no walks. With the Diamondbacks eventually winning the game, Kelly became the first player to win a game in both the World Series and Korean Series. Kelly finished the 2023 postseason with a 3–1 record in four starts with a 2.25 ERA.
In 2024, Kelly once more began the year as part of Arizona's rotation, logging a 2.19 ERA across his first four starts. He was placed on the injured list with a teres major muscle strain in his right shoulder on April 23, 2024. Kelly was transferred to the 60–day injured list on May 2, after it was announced that he would miss more than a month as a result of the injury. He was activated on August 11. Kelly made 13 total starts for Arizona in 2024, posting a 5-1 record and 4.03 ERA with 63 strikeouts across 73+2⁄3 innings pitched.
Kelly made 22 starts for the Diamondbacks in 2025, compiling a 9-6 record and 3.22 ERA with 121 strikeouts across 128.2 innings pitched.