Mike Bloomberg, former mayor of New York City, speaks to media after touring the Wind Technology program at Des Moines Area Community College in Ankeny, Iowa, December 4, 2018.

U.S. President Donald Trump would be "quietly worried" if former New York Mayor Mike Bloomberg ends up running for president in the 2020 elections, said former White House official Anthony Scaramucci.

Bloomberg has not declared his candidacy for the 2020 race, but fellow billionaire Warren Buffett told CNBC he would support the former New York mayor for president. Bloomberg, who served three terms as mayor for New York as a Republican and then an independent, registered as a Democrat last year.

"I think the one that the president would be quietly worried about ... would be the mayor, Mike Bloomberg," Scaramucci told CNBC's "Capital Connection" on Tuesday.

Scaramucci said Bloomberg has the "mental discipline" to handle possible challenges posed by Trump, who has in the past resorted to name-calling to throw off his political competitors.

"The president recognizes that [Bloomberg] has that New York toughness, he's very, very rich," said Scaramucci, who worked briefly as a former White House communications director under Trump. "Whoever runs against President Trump will have an internationally recognized nickname for the rest of their lives, so I think someone like Mike Bloomberg is prepared for that and has the mental discipline to handle it."