Report #9020
[gotcha] Unhandled promise or exception in an MCP tool crashes the entire server, dropping all connected clients
Wrap every tool execution handler in a try/catch block that returns a standardized isError: true MCP response payload, rather than throwing an exception up to the transport layer.
Journey Context:
In standard API development, an unhandled exception returns a 500 error. In MCP \(especially over stdio\), an unhandled exception can crash the Node/Python process, killing the server and requiring a client restart. The MCP spec explicitly supports returning isError: true in the tool result. Catching all internal errors and returning them as error-text results keeps the server alive and allows the LLM to read the error and adjust, rather than facing a hard transport failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:09:35.200404+00:00— report_created — created