{"record":{"id":"03c3662e7ebf5227","repo":"Hmbown/CodeWhale","slug":"timed-out-waiting-for-mcp-json-rpc-response-from-s","errorCode":null,"errorMessage":"Timed out waiting for MCP JSON-RPC response from server '{}' after {}s","messagePattern":"Timed out waiting for MCP JSON-RPC response from server '(.+?)' after (.+?)s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":2421,"sourceCode":"                Duration::from_secs(self.read_timeout_secs),\n                async {\n                    tokio::select! {\n                        biased;\n                        _ = self.cancel_token.cancelled() => {\n                            anyhow::bail!(\"MCP connection '{}' was cancelled\", self.name)\n                        }\n                        result = self.transport.recv() => result,\n                    }\n                },\n            )\n            .await\n            {\n                Ok(result) => result.inspect_err(|_e| {\n                    self.state = ConnectionState::Disconnected;\n                })?,\n                Err(_) => {\n                    self.state = ConnectionState::Disconnected;\n                    anyhow::bail!(\n                        \"Timed out waiting for MCP JSON-RPC response from server '{}' after {}s\",\n                        self.name,\n                        self.read_timeout_secs\n                    );\n                }\n            };\n            let value: serde_json::Value = match serde_json::from_slice(&bytes) {\n                Ok(value) => value,\n                Err(err) => {\n                    self.state = ConnectionState::Disconnected;\n                    let preview = if self.config.reviewed_plugin.is_some() {\n                        \"<server details suppressed for reviewed plugin>\".to_string()\n                    } else {\n                        invalid_json_preview(&bytes)\n                    };\n                    return Err(err).with_context(|| {\n                        format!(\n                            \"Invalid MCP JSON-RPC message from server '{}': {}\",","sourceCodeStart":2403,"sourceCodeEnd":2439,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L2403-L2439","documentation":"An MCP server did not answer a JSON-RPC request within the connection's configured read timeout (`read_timeout_secs`). The pending `oneshot` receiver returned `Err` (sender dropped) or the future timed out, so the client marks the connection `Disconnected` and aborts with this error. It indicates the server process is hung, slow, or died without responding.","triggerScenarios":"Calling any McpConnection JSON-RPC method (e.g. tools/list, tools/call) when the awaited response channel closes or exceeds `self.read_timeout_secs`; typically because the spawned server process never wrote a response to stdout.","commonSituations":"MCP server binary missing or crashing on startup, server wedged on a slow tool call, overly tight `read_timeout_secs` in the timeouts config, server blocked reading stdin or waiting on an external API.","solutions":["Check the MCP server starts and responds: run its command manually and issue a request over stdio.","Increase `read_timeout_secs` in the MCP timeouts config for that server.","Check server logs/stderr for a crash or hang; fix or reinstall the server binary.","Retry the operation; the connection was set to Disconnected so the next call will reconnect."],"exampleFix":"// before (too-tight timeout in config.toml)\n[mcp.timeouts]\nread_timeout_secs = 2\n// after\n[mcp.timeouts]\nread_timeout_secs = 30","handlingStrategy":"retry","validationCode":"if server_timeouts.read_timeout_secs < 5 {\n    return Err(\"read_timeout_secs too small for MCP server; raise before calling\");\n}","typeGuard":null,"tryCatchPattern":"match connection.call_tool(req).await {\n    Err(e) if e.to_string().contains(\"Timed out waiting for MCP JSON-RPC\") => {\n        // connection is now Disconnected; reconnect and retry once with a larger timeout\n    }\n    other => other?,\n}","preventionTips":["Set read_timeout_secs generously (30s+) for servers that call external APIs.","Verify the server binary launches and answers a tools/list before relying on it.","Monitor server stderr for crashes; a dead process always surfaces as this timeout."],"tags":["mcp","timeout","json-rpc","network"],"backgroundTag":"request-timeout","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}