Given the context, the positive relationship Mr. West enjoys with Mr. Trump is glaring, particularly because Mr. West has been vocal about how past presidents handled relations with African-Americans.

Mr. West once accused President George W. Bush on live television of not caring about black people, and he openly criticized President Barack Obama, who repeatedly called the rapper a “jackass.”

Mr. Trump, who has used vulgar language to disparage a number of majority-black communities and countries, has not been the subject of Mr. West’s critiques.

Mr. West has long appeared to be fascinated with the possibilities of the presidential platform: In 2015, he seemed to enjoy provoking the public into believing he was interested in a 2020 run. And in December 2016, after he was hospitalized for a “psychiatric emergency,” Mr. West visited Mr. Trump, then the president-elect, at Trump Tower in Manhattan. Hope Hicks, Mr. Trump’s spokeswoman at the time, said Mr. West had requested the meeting.

On Wednesday, the White House had no further details on whether the two had been in regular contact since then.

“We’ve been friends for a long time,” Mr. Trump told reporters after the Trump Tower meeting. Asked what he and Mr. West talked about, Mr. Trump responded: “Life. We discussed life.”

The bond between the two — and speculation over Mr. West’s mental health — apparently alarmed his wife, Kim Kardashian West, who was a vocal supporter of the Clinton campaign and has openly criticized Mr. Trump’s handling of major events, including hurricane response in Puerto Rico.