When your app breaks, let your agent diagnose and restart it
Ask Claude Code, Codex or any MCP client why your app is down. It reads the diagnosis and the logs, restarts the app when a restart will fix it, and checks that the new instance is serving.
For apps you already run on Open Source Cloud. No dashboard, no log tab, no guessing which button to press.
What you ask for
My app on OSC is down. Find out why, fix it if a restart will, and tell me when it is back.
The agent looks the app up in your account, so it acts on the right one, and then works through four steps.
What the agent does
Diagnose diagnose-my-app
One report: build status, whether the container is running, whether the public URL and the health check answer, the recent startup logs, and the issues found.
Read the logs get-my-app-logs
The full lines, without a level filter first. Filtering on "error" hides most startup output, so a crash at startup can look like an empty log.
Restart, if that will help restart-my-app
A restart pulls the latest commit and starts the container again. A rebuild clears the build cache, for when dependencies changed or a plain restart did not help.
Check the new instance wait-for-app-ready
The agent waits for the new instance, not the old one still serving during the swap, and tells you whether it came up.
The same steps as a machine-readable recipe an agent can follow: /stacks/diagnose-restart-my-app.json
Why the agent does not restart first
A page that answers is not the same as an app that works. We ran the diagnosis on one of our own apps whose build had failed. Its public address still answered, because a loading page holds the port while the app is down. The diagnosis showed the rest: the health check returned an error, and the logs showed the code could not be fetched from its repository, so there was nothing to start.
A restart would have tried to fetch the same code and failed the same way. The useful answer was the cause, and the fix was in the repository. That is the order the agent follows: find the cause, then restart only when a restart can fix it.
Good to know
Expired repository access
If the logs show the repository refusing access, the agent asks you to register a new access token and updates the app with it, which restarts the app on the new token. A plain restart would fail the same way.
Restarting over and over
If the platform warns that the app keeps restarting without a successful start, the agent stops and goes back to the diagnosis.
High availability
On Node.js apps on paid plans, high availability runs a standby instance next to your app. It keeps the old version serving while a new build runs, so a failed build does not take the app down.
Databases and other services
A broken database is a service, not an app. The agent reads its logs, restarts it and checks its status with the service tools.
Once it is running again, keep an eye on it: observability and monitoring.
Frequently asked questions
Which apps does this work for?
Apps you run on Open Source Cloud as My Apps: Node.js, Python, Go, .NET, PHP and WebAssembly, deployed from your git repository. If the thing that broke is a database or another catalog service, the agent uses the matching service tools instead: get-logs-for-instance, restart-service-instance and get-instance-status.
Does Open Source Cloud restart a broken app by itself?
No. This is your agent doing it when you ask. It reads the diagnosis first and restarts only when a restart can fix the cause.
Why not just restart every time?
Because a restart pulls the latest commit from your repository and starts the container again. If the cause is in your code, or the platform cannot clone the repository, a restart fails the same way. It also deploys anything new on the branch, which you may not want in the middle of an incident.
What if the app is down after a rebuild?
A rebuild failure does not come back from the restart call. It shows up afterwards as a failed build status, which is why the agent waits for the new instance and reads the diagnosis again if it fails. On a Node.js app on a paid plan you can turn on high availability, so a failed build keeps the old version serving instead of taking the app down.
How does the agent connect?
Over MCP. In Claude Code, run "claude mcp add --transport http osc https://mcp.osaas.io/mcp" once. Codex, Cursor and other MCP clients connect to the same address.
Does it cost anything extra?
Diagnosing and restarting create no new services, so nothing new starts running. You keep paying for the app you already run. High availability is the one exception: turning it on adds a standby instance. See pricing for plans.
Let your agent handle the next outage
Create a free account, connect your agent over MCP, and ask it what is wrong the next time an app goes down.