Developer builds file-based MCP health-check hook to stop overnight batch failures
A developer automating workflows with Claude Code repeatedly lost overnight batch jobs when MCP servers timed out or returned errors, leaving nothing completed by morning. MCP servers handle tool calls such as browser operations and API requests for Claude Code, and any server failure halts the entire session. The core problem was that different HTTP error codes — such as 429 rate limits and 503 outages — were treated identically, causing wasteful retry loops. The fix involved a pre-tool hook that probes server health and routes responses to one of three strategies: immediate block, backoff retry, or reconnect and re-probe. Results are stored in a file-based cache outside Claude's context window, so health state persists even after session compaction and prevents repeated calls to servers already known to be down.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in