WASHINGTON — President Trump lashed out on Wednesday at the Senate majority leader, Mitch McConnell, Republican of Kentucky, who suggested this week that the president harbored “excessive expectations” about the pace of congressional progress.

“Senator Mitch McConnell said I had ‘excessive expectations,’ but I don’t think so,” Mr. Trump wrote on Twitter on Wednesday afternoon, as he and lawmakers took time away from Washington during the August recess. “After 7 years of hearing Repeal & Replace, why not done?”

The executive scolding followed the president’s bitter disappointment with the Senate’s failure to dismantle the Affordable Care Act last month — and supplied perhaps the most potent evidence yet that Mr. Trump, seething over the lack of major achievements in his first year, will not hesitate to train fire on allies.

Before Mr. Trump’s tweet, he spoke by phone with Mr. McConnell to express his disappointment in the senator’s comments, according to a person with knowledge of the call.