Still, Mr. Trump added, “it almost ought to be illegal.”
At other times, he has made clear that he views disloyalty pretty much the way Mr. Gotti would have viewed the decision of his underboss, Sammy Gravano, to cooperate with the government in 1991 and testify against him in the trial that sent him away for life.
Defending the White House counsel, Donald F. McGahn II, after a report in The New York Times that he had spent 30 hours speaking to the special counsel, Robert S. Mueller III, Mr. Trump wrote on Twitter that Mr. McGahn would never sell out his boss like a “John Dean type ‘RAT.’”
Mr. Dean, whose testimony as White House counsel about Watergate helped bring down President Richard M. Nixon, fired back. Mr. Trump, he tweeted, “thinks, acts and sounds like a mob boss.”
“There is nothing presidential about him or his actions,” Mr. Dean added.
Sometimes Mr. Trump’s gangland references can be baffling. This month, he defended Mr. Manafort by comparing him to Al Capone. Mr. Manafort, he suggested, was getting rougher treatment than Capone, whom the president called a “legendary mob boss, killer and ‘Public Enemy Number One.’”
His references are also unlikely to impress prosecutors like Mr. Mueller, for whom the mob is old hat. But they, too, have been struck by the parallels. Mr. Comey, in his recent book, “A Higher Loyalty,” likened his first meeting with the future president at Trump Tower in Manhattan to paying a call to a Mafia don.
“I thought of the New York Mafia social clubs, an image from my days as a Manhattan federal prosecutor in the 1980s and 1990s,” Mr. Comey said. “The Ravenite. The Palma Boys. Café Giardino. I couldn’t shake the picture. And looking back, it wasn’t as odd or dramatic as I thought at the time.”
Mr. Trump, he wrote, seemed to be trying to make Mr. Comey and his colleagues from the intelligence agencies “part of the same family.”