Vargas was taken to a hospital by Royals head trainer Nick Kenney after he became ill overnight at the team's hotel.
"He started having some severe discomfort about 4 o'clock [ET] in the morning and Nick took him in," Yost said. "They gave him a CT scan and, of course, that's what came up."
Vargas apparently was unaffected during his start on Tuesday night in a 4-3 loss to Tampa Bay. He went 5 2/3 innings and appeared to be fine immediately after the game.
The Royals don't know how long the surgery might cause Vargas to be out, but it certainly eliminates him from Sunday's start against the Detroit Tigers at Kauffman Stadium. Left-hander Bruce Chen is likely to take his spot.
"Probably Bruce, but we'll look at it," Yost said.
Vargas' surgery deals a blow to the Royals' pitching rotation. Signed as a free agent in the offseason, Vargas had become the rotation's most consistent performer with an 8-4 record and a 3.31 ERA in 19 starts.
Three times this season, Vargas pitched seven shutout innings in victories, twice against Minnesota and once against Seattle. Of his 19 outings, 14 were quality starts.
Vargas is expected to return to Kansas City on Friday, but when he'll return to pitching is an open question.
"I have no idea right now," Yost said.
Vargas' surgery came on the same day that left fielder Alex Gordon and third baseman Mike Moustakas were both scratched from the starting lineup. Gordon has a sprained right wrist and Moustakas has the flu.
All of this with five games left before the All-Star break, including four against the first-place Tigers.
"It's disappointing that it all comes at once when we're trying to finish up strong," Yost said. "And we will, we'll figure out a way to cover it."