Despite pledges by both men that they share the same agenda, tensions between them have deepened since the Senate twice failed to repeal the Affordable Care Act. After the first defeat in July, Mr. Trump tweeted in August: “Can you believe that Mitch McConnell, who has screamed Repeal & Replace for 7 years, couldn’t get it done.”
In another tweet in August, he said, “The only problem I have with Mitch McConnell is that, after hearing Repeal & Replace for 7 years, he failed!”
Privately, Mr. Trump has repeatedly denigrated Mr. McConnell, most recently unloading on the Senate Republican leader during a dinner this month with a group of about a dozen conservative movement leaders in the Blue Room of the White House. According to two people with knowledge of the president’s remarks, he called Mr. McConnell “a weak leader” and said that he remained befuddled at Mr. McConnell’s inability to wrangle the votes needed to repeal the Affordable Care Act.
For his part, Mr. McConnell has been deeply frustrated and rattled by Mr. Trump’s willingness to lash out, even as the Senate leader successfully guided the chamber to confirmation of Mr. Trump’s cabinet and judicial nominations, including the president’s choice of Neil M. Gorsuch to the Supreme Court.
Soon after Mr. Trump took office, Mr. McConnell told associates that the new president had no clear sense of where he stood on most core issues, and he predicted that steering Mr. Trump in one direction or another — and taking the lead on policy — would be relatively easy.
But Mr. McConnell and his aides have since watched Mr. Trump buck the Senate, both publicly and privately.
Mr. Trump has repeatedly hectored Mr. McConnell to scrap Senate rules that require most legislation to clear a 60-vote hurdle before final passage, a demand that the leader has resisted, in part, for fear of a return Democratic control.
Mr. McConnell has also been taken aback by Mr. Bannon’s decision to start a political crusade against establishment Republicans in the Senate by recruiting candidates who could put at risk the party’s control. So far, Mr. Bannon has backed conservative challengers to Senators Jeff Flake of Arizona and Dean Heller of Nevada, and could formally back a challenger to Senator Roger Wicker of Mississippi.
Mr. McConnell said he was focused on keeping the Senate in Republican hands.
“The way you do that is not complicated,” Mr. McConnell said. “You nominate people who can win. Our operating approach will be to support our incumbents.”
Mr. Trump said that Mr. Bannon “has been a friend of mine for a long time” and said that his former strategist was doing “what he thinks is the right thing.”
But with Mr. McConnell standing next to him, the president hinted that he would not entirely support Mr. Bannon’s efforts to throw out of office Republicans who Mr. Bannon does not think are sufficiently supportive of Mr. Trump’s agenda.
“Some of the people he may be looking at, we will see if we can talk him out of that,” the president said.
Advisers to Mr. McConnell said the two men talk more frequently than most people know, and that they have regular telephone conversations on the weekends, including one as recently as Saturday. The two men both recognize that Republicans’ fate in 2018 hinges on whether Congress can pass the tax cuts that Mr. Trump is seeking.
“I feel like they are both under so much pressure to deliver — that’s what causes tension, real or imagined,” said Scott Jennings, a former adviser to Mr. McConnell who remains close to the majority leader. “They need to be able to jointly take something back to the voters next year to sell. I think winning on a major policy initiative like tax reform would allow for a further expansion of their relationship on politics.”
That level of cooperation — which has been so vital to the success for past presidents — was in danger of completely unraveling before Monday’s lunch. Over the objections of some of his advisers, the president had grown increasingly unwilling to set aside his insurgent tendencies to make Washington-style deals with Mr. McConnell.
Mr. Trump’s contempt grew even stronger after he backed Mr. McConnell’s preferred candidate in a special election in Alabama last month. That candidate — Senator Luther Strange — lost the election to Roy S. Moore, a defeat that Mr. Trump took personally.
But on Monday, both men sought to minimize the conflict between them in the interest of sending a signal of unity of purpose that could soothe the despair of allies who fear the feud imperils any hopes for the tax and budget legislation before the end of the year.
“We have the same agenda,” Mr. McConnell said.