Build1 distinct publisher3 min readUpdated
One operator's fix for 2 a.m. MCP outages is a hook that writes the verdict to a file, because compaction throws away whatever the model learned about a dead server.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The design detail worth stealing is where the decision gets made. The hook attaches to two Claude Code events, documented in the script's own header comment: PreToolUse, which probes the MCP server before the tool runs, and PostToolUseFailure, which marks the result [13]. The probe is a plain HTTP check, and its outcome routes to one of three actions: block immediately, retry after backoff, or run a reconnect command and probe again [7]. The verdict then goes to `~/.claude/mcp-health-cache.json`, and on the following turn the hook reads that file and refuses the call outright until `nextRetryAt` has passed, without spending a probe to confirm what it already knows [8][10].
That last part is the whole trick. A long session gets its conversation history compacted, and a note from earlier saying a server was down does not survive into the compacted context, so the agent goes back to calling something it has already established is unhealthy [9]. The author says he tried the obvious alternative first, a system prompt instructing the model to try another approach on error. It handles a single error acceptably. When failures arrive back to back, the model spends heavily on trying, and by the next turn it is aimed at the same dead server again [11].
The status-code half of the problem is separate and just as expensive. He describes a 429 that stopped the run, a re-call thirty seconds later, another 429, and a loop with no exit [5]. At that interval a stuck loop makes 120 attempts an hour against a server that has already said no [16]. Elsewhere a 503 was treated as if it were a 401, so the run went off and performed a re-authentication that nothing had asked for [6]. MCP's transport layer will retry, but it does not read status codes and switch strategy, and 401 or 403 wants credentials rather than patience [12]. Anyone assuming the protocol covers this is buying retries, not policy.
Read the sourcing honestly: this is one operator's account of his own tooling, and the supporting evidence is autobiographical. He puts the environment at 1.2M yen a month in revenue and says time spent on mechanisms that stop things from stopping returns more over the long run than code written to earn more [14]. At 600K a month, half of the current figure, he believed the opposite, that more tasks meant more income, and revised it after a layoff took the business to zero and he rebuilt [15][17]. There is no outage frequency here and no before-and-after completion rate, so the claim that no overnight batch has been killed by an MCP outage since is his to make and yours to test [2].
What generalises is not the script. It is the observation that an agent's memory of its own failures is stored in the least durable place available [9], and that the fix is a file [18].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
The author describes overnight batch jobs stopped dead by an MCP server timeout, leaving a log full of connection refused messages and no work advanced since the previous evening; one such failure hit a client deliverable generation run.
MCP is the mechanism that lets Claude Code use browser operations, DB lookups and external API calls as tools; from the model's side it looks like calling a tool such as mcp__obsidian__search, while underneath a local process or remote HTTP server is handling it.
When an MCP server stops responding, Claude Code returns the tool call as an error and the flow of the session jams up.
In one failure mode a run was stopped by a 429 rate limit, re-called thirty seconds later, hit another 429, and looped without exit.
In another case a 503 was judged the same as a 401, so the run pointlessly executed a re-authentication flow.
The hook at ~/.claude/scripts/hooks/mcp-health-check.js runs an HTTP probe before Claude Code calls a tool and, depending on the response status, dispatches to block immediately, retry after backoff, or run a reconnect command and re-probe.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Mechanism well specified, outcomes unverified
The technical mechanism is described at an unusually checkable level of detail for a blog post: named script and cache paths, the two hook events quoted from the code comment, exit-code semantics, probe timeout and a full status-code dispatch diagram. But the cluster contains exactly one self-published source, the code itself is not shown, and the effect claims carry no measurements or baseline, so the evidence base supports 'this is what he built' far better than 'this is what it achieves'.
One self-reported operator deployment
Adoption evidence is a single disclosed installation in the author's own environment. There are no third-party users, organizational deployments, repository or download signals, and no indication the pattern has been picked up elsewhere, so measured adoption is essentially n=1.
Modestly overstated beyond n=1
The framing generalizes from one operator's experience to broad conclusions: outages no longer kill batches, prompt-level handling is inferior, and reliability work has higher long-term ROI than revenue features. The mechanism substantiates the diagnosis of compaction-induced amnesia and status-code-blind retries, but the outcome and economic claims outrun the supplied evidence, so claims sit somewhat ahead of what is demonstrated rather than wildly so.
Self-promotional operator narrative
The author's incentives are visible in the text rather than hidden: the post foregrounds his own monthly revenue figures and a layoff-to-rebuild arc alongside his own tooling, which is the standard incentive structure of a solo-operator developer-platform post seeking audience and credibility. No vendor sponsorship, employer relationship or commercial product is disclosed in the source, so the pull is reputational rather than a documented financial conflict.
Confident on mechanism, weak on impact
Confidence is limited by single-source, single-publisher coverage and by the absence of any independent verification or quantitative results. It is well above floor because the mechanism claims are internally consistent, specific and unlikely to be fabricated, and because the failure modes described (compaction dropping health state, transport-only retries) are coherent with how the tool-calling layer is described in the same source.
build
Anthropic's CCAR-F puts a scaled score on "can build agents"1 distinct publisher
build
Config rot has a latency bill: a 70-line weekly audit for agent environments1 distinct publisher
build
255 tool schemas, 91K tokens: pricing the two MCP costs nobody budgets1 distinct publisher
build
When customers build their own features, your permission model becomes the product surface1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 21, 2026