MCPcopy
hub / github.com/coder/mux / isClosedClientError

Function isClosedClientError

src/node/services/mcpServerManager.ts:36–43  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

34 * MCPClientError is not exported from the SDK, so we match on known message patterns.
35 * Known patterns: "closed client", "Connection closed", "Connection closed unexpectedly". */
36export function isClosedClientError(error: unknown): boolean {
37 const msg = getErrorMessage(error).toLowerCase();
38 return (
39 msg.includes("closed client") ||
40 msg.includes("connection closed") ||
41 msg.includes("not connected")
42 );
43}
44
45const MCP_TOOL_CALL_TIMEOUT_MS = 300_000;
46

Callers 3

onUncaughtErrorMethod · 0.85

Calls 1

getErrorMessageFunction · 0.90

Tested by

no test coverage detected