{"record":{"id":"b68141bbd4896583","repo":"Kuberwastaken/claurst","slug":"mcp-server-http-from-legacy-sse-transport","errorCode":null,"errorMessage":"MCP server '{}': HTTP {} from legacy SSE transport: {}","messagePattern":"MCP server '(.+?)': HTTP (.+?) from legacy SSE transport: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/mcp/src/rmcp_backend.rs","lineNumber":445,"sourceCode":"    serde_json::from_str(data).map_err(|e| {\n        anyhow::anyhow!(\n            \"MCP server '{}': failed to parse legacy SSE JSON payload: {}\",\n            server_name,\n            e\n        )\n    })\n}\n\nasync fn handle_legacy_sse_http_response(\n    server_name: String,\n    response: reqwest::Response,\n    incoming_tx: mpsc::UnboundedSender<rmcp::service::RxJsonRpcMessage<RoleClient>>,\n    background_tasks: Arc<StdMutex<Vec<JoinHandle<()>>>>,\n) -> anyhow::Result<()> {\n    let status = response.status();\n    if !status.is_success() && status != reqwest::StatusCode::ACCEPTED {\n        let body = response.text().await.unwrap_or_default();\n        anyhow::bail!(\n            \"MCP server '{}': HTTP {} from legacy SSE transport: {}\",\n            server_name,\n            status,\n            body\n        );\n    }\n\n    if status == reqwest::StatusCode::ACCEPTED {\n        return Ok(());\n    }\n\n    if transport::is_event_stream_response(&response) {\n        let server_name_for_task = server_name.clone();\n        let task = tokio::spawn(async move {\n            if let Err(e) = transport::process_sse_response(response, |_, data| {\n                if data.trim().is_empty() {\n                    return Ok(());\n                }","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/mcp/src/rmcp_backend.rs#L427-L463","documentation":"After the SSE stream is established, JSON-RPC messages are POSTed to the server's message endpoint. This guard accepts 2xx and 202 Accepted, but any other non-success status on a POST response is fatal and reported with the server name, status, and body.","triggerScenarios":"handle_legacy_sse_http_response (reached from send and the message-queue handlers) receives an HTTP response whose status is neither success nor 202 ACCEPTED.","commonSituations":"Message endpoint URL became stale after a server restart; auth token expired mid-session (401); server rate-limiting (429); endpoint path wrong in proxy config (404); server crash returning 5xx.","solutions":["Reconnect the MCP session so a fresh endpoint event updates the POST URL","Refresh OAuth credentials (re-run auth) if the status is 401/403","Back off and retry if the status is 429, honoring any Retry-After header","Inspect the body for 5xx and check server/proxy health"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.send(msg).await {\n    Err(e) if e.to_string().contains(\"from legacy SSE transport: HTTP\") => {\n        // 401/403: refresh credentials; 429: back off; 5xx: reconnect session\n    }\n    other => other?,\n}","preventionTips":["Reconnect the session after any server restart to refresh the POST endpoint","Refresh OAuth tokens before they expire during long sessions","Implement backoff on 429 and surface 5xx bodies to server operators"],"tags":["mcp","sse","http","jsonrpc"],"backgroundTag":"http-error-response","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}