GLEN JEAN, W.Va. — President Trump looked out Monday evening at the sea of Boy Scouts who were gathered in a remote field, far away from the travails of the capital, and declared that he would not talk about politics.

“Who the hell wants to speak about politics when I’m in front of the Boy Scouts?” he asked.

It turned out he did, at least a little.

Amid standard testimonials to hard work and American values, Mr. Trump launched into a speech to the scouts replete with classic Trumpian jabs at opponents and the “fake media.” He harkened back to his “incredible” election and jokingly told his health secretary that if he failed to deliver enough votes in Tuesday’s health care vote, “you’re fired.”

With an estimated 40,000 scouts, volunteers and others on hand, it was certainly the largest crowd Mr. Trump had seen since his inauguration, and a highly supportive one. As anyone who followed last year’s election knows, Mr. Trump is no boy scout — but he boasted that 10 members of his Cabinet were, including some he brought with him.