zeroclaw-labs/zeroclaw · error · anyhow::Error

MCP server returned HTTP {}

Error message

MCP server returned HTTP {}

What it means

Error "MCP server returned HTTP {}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-tools/src/mcp_transport.rs:1181

        lifecycle.mark_outcome_unknown(epoch_guard.epoch());
        let resp = req
            .send()
            .await
            .context("HTTP request to MCP server failed")?;
        drop(epoch_guard);

        if !resp.status().is_success() {
            let status = resp.status();
            if self.session_id.lock().is_some()
                && (status == reqwest::StatusCode::NOT_FOUND || status == reqwest::StatusCode::GONE)
            {
                return Err(McpTransportError::StaleSession {
                    status: status.as_u16(),
                }
                .into());
            }
            lifecycle.mark_completed();
            bail!("MCP server returned HTTP {}", status);
        }

        self.update_session_id_from_headers(resp.headers());

        if request.id.is_none() {
            return finish_response(
                request,
                lifecycle,
                JsonRpcResponse {
                    jsonrpc: crate::mcp_protocol::JSONRPC_VERSION.to_string(),
                    id: None,
                    result: None,
                    error: None,
                },
            );
        }

        let is_sse = resp

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Check the MCP server's HTTP status; verify the endpoint URL and authentication.

When it happens

Trigger: Thrown at crates/zeroclaw-tools/src/mcp_transport.rs:1181 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/2501660b1b7aeb8a. Report an issue: GitHub.