The Mooch comes, the Mooch goes, but the real news, the good news, is that there is now going to be order in the court of Donald Trump.

By agreeing to the wish of new chief of staff Gen. John Kelly that Anthony Scaramucci vacate the premises, President Trump sent a dramatic signal of his personal commitment to changing the ways of his White House.

Other changes are sure to follow in the coming days. There likely will be no more open-door Oval Office gabfests and no more kibitzers loitering in the hallways hoping to catch the president’s eye and scramble his schedule. Oh, and leakers will meet a firing squad at dawn on the White House lawn.

The battle to advance the Trump agenda will be waged in smart, disciplined fashion under a retired four-star general from the Marine Corps.

And not a moment too soon.

Last week was the worst week of the Trump presidency and there was no end to the bleeding in sight. The failure of the ObamaCare repeal led a list of mistakes and setbacks, and Scaramucci, brought in to improve communications, instantly managed to make everything worse with profane, inflammatory comments about White House colleagues.

In the following days, The Post broke the story of Scaramucci’s messy personal life, including the birth of a new son to his soon-to-be-ex-wife, the details of which made his short stint in the White House look relatively normal.

But Trump has troubles of his own, the most significant being a rupture with some congressional Republicans over whether the president could fire special counsel Robert Mueller and Attorney General Jeff Sessions. The fight is simmering now, but if it reaches a summer boil, it could hamper everything he needs to do in Congress and even swamp the push for tax reform.

To clean up that mess, Kelly, in addition to pushing out Scaramucci, apparently put other conditions on his taking the job, the biggest being that everybody in the White House reports to him.

That is exactly the command structure that Bill Clinton adopted after his horrible start as president. He recruited Leon Panetta to be chief of staff, and Panetta has said that he agreed to take the job only if he would be a dictator in charge of everything and everyone who worked in the West Wing.

Clinton said yes, and saved his presidency from irrelevancy. The structure will work for Trump — if he lets Kelly do his job.

Trump, of course, is already notorious for hijacking some of his administration’s accomplishments with angry Twitter outbursts, especially early in the morning. The effect is too often to drive the day’s news stories, and give the media another reason to write about chaos in his administration.

The irony is that while claiming to hate that very same media, Trump is ever ready to feed it red meat. I don’t understand why he feels the need.

While I’m not among those who believe he must surrender his phone, I do believe he has to think more like the leader of the United States rather than a beleaguered tycoon wanting to get something off his chest. Otherwise, he is on the path to being a lonely, failed president.

If staying on message, and staying quiet at other times, seems like too much of a sacrifice, then Trump should make himself familiar with the story of the man he just put in charge of the White House.

Gen. Kelly has spent almost his entire adult life in the military since enlisting in the Marines in 1970 and saw combat duty in Iraq.

His greatest sacrifice was to come, however. In 2010, his 29-year-old son, Robert Kelly, a Marine first lieutenant, was killed when he stepped on a land mine in Afghanistan.

That’s the caliber of sacrifice and commitment to country Kelly represents. His new boss has made a superb choice in giving him command of the White House, but now the boss must uphold his end of the bargain, too.

If he does, Trump will have taken a giant step toward giving his presidency a fresh chance to be great.