{"record":{"id":"d16041253980a743","repo":"tinyhumansai/openhuman","slug":"unsupported-mcp-protocol-version-negotiated-by-ser","errorCode":null,"errorMessage":"unsupported MCP protocol version negotiated by server: {version}","messagePattern":"unsupported MCP protocol version negotiated by server: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/mcp/http_client/client.rs","lineNumber":660,"sourceCode":"\n    async fn fetch_authorization_server_metadata(\n        &self,\n        issuer: &str,\n    ) -> anyhow::Result<AuthorizationServerMetadata> {\n        let trimmed = issuer.trim_end_matches('/');\n        let oidc = format!(\"{trimmed}/.well-known/openid-configuration\");\n        if let Ok(metadata) = self.fetch_json::<AuthorizationServerMetadata>(&oidc).await {\n            return Ok(metadata);\n        }\n        let oauth = format!(\"{trimmed}/.well-known/oauth-authorization-server\");\n        self.fetch_json::<AuthorizationServerMetadata>(&oauth).await\n    }\n\n    fn validate_protocol_version(&self, version: &str) -> anyhow::Result<()> {\n        if SUPPORTED_PROTOCOL_VERSIONS.contains(&version) {\n            Ok(())\n        } else {\n            anyhow::bail!(\"unsupported MCP protocol version negotiated by server: {version}\");\n        }\n    }\n\n    fn reset_session(&self) {\n        let mut state = self.state.lock();\n        state.initialized = false;\n        state.session_id = None;\n        state.initialize = None;\n        state.cached_tools.clear();\n        state.negotiated_protocol_version = LATEST_PROTOCOL_VERSION.to_string();\n    }\n}\n\n#[derive(Debug, Clone)]\nstruct RequestOptions {\n    initialize: bool,\n    method_header: Option<&'static str>,\n    name_header: Option<String>,","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/mcp/http_client/client.rs#L642-L678","documentation":"During HTTP initialize handshake the server negotiated a `protocolVersion` that is not in `SUPPORTED_PROTOCOL_VERSIONS` (accepted: `2024-11-05`, `2025-03-26`, `2025-06-18`, `2025-11-25`), so the client refuses to continue on that session. MCP version negotiation expects the server to echo a supported client version or pick one it supports; an unknown version means the two builds cannot talk safely.","triggerScenarios":"Connecting to an MCP server built against a newer (or much older) spec revision than this client supports; a server that ignores the client's offered version and replies with its own unsupported one; a broken gateway rewriting the initialize result.","commonSituations":"Server updated ahead of the client after a spec revision ships; experimental/custom MCP servers using draft version strings; version strings with different formatting (e.g. a bare date without the `YYYY-MM-DD` shape).","solutions":["Check the version string in the error against the supported list — if the server is newer, update OpenHuman to a build supporting that revision.","If you control the server, configure/pin it to negotiate one of the supported versions (ideally echo the client's offered `protocolVersion`).","Verify the initialize response is not being mangled by a proxy.","If the server is hopelessly incompatible, use a stdio wrapper or a bridging gateway that translates versions."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.initialize().await {\n    Err(e) if e.to_string().contains(\"unsupported MCP protocol version\") => {\n        // mark server incompatible: disable and surface an upgrade hint\n        registry.disable(server_name)?;\n    }\n    other => other,\n}","preventionTips":["Keep the client updated when adopting servers built against newer MCP spec revisions.","Pin server versions in lockstep with the client's supported protocol versions.","Log the negotiated version at initialize so mismatches are diagnosable later."],"tags":["mcp","http","protocol-version","compatibility"],"backgroundTag":"protocol-version-mismatch","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}