{"record":{"id":"e49a43154dcde7dc","repo":"openai/codex","slug":"oauth-login-is-only-supported-for-streamable-http","errorCode":null,"errorMessage":"OAuth login is only supported for streamable HTTP servers.","messagePattern":"OAuth login is only supported for streamable HTTP servers\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/cli/src/mcp_cmd.rs","lineNumber":555,"sourceCode":"        scopes,\n        oauth_client_registration,\n    } = login_args;\n    let client_registration = oauth_client_registration\n        .map(McpOAuthClientRegistration::from)\n        .unwrap_or_default();\n\n    let Some(server) = mcp_servers.get(&name) else {\n        bail!(\"No MCP server named '{name}' found.\");\n    };\n\n    let (url, http_headers, env_http_headers) = match &server.transport {\n        McpServerTransportConfig::StreamableHttp {\n            url,\n            http_headers,\n            env_http_headers,\n            ..\n        } => (url.clone(), http_headers.clone(), env_http_headers.clone()),\n        _ => bail!(\"OAuth login is only supported for streamable HTTP servers.\"),\n    };\n\n    // Standalone `mcp login` runs OAuth from the local CLI process; execution\n    // environment routing belongs to app-server and session MCP flows.\n    let http_client: Arc<dyn HttpClient> = Arc::new(\n        RouteAwareHttpClient::new(config.http_client_factory()).with_tls_backend_fallback(),\n    );\n    let http_client = apply_http_headers_helper(http_client, server, config.cwd.to_path_buf())\n        .map_err(anyhow::Error::msg)?;\n    let explicit_scopes = (!scopes.is_empty()).then_some(scopes);\n    let discovered_scopes = if explicit_scopes.is_none() && server.scopes.is_none() {\n        discover_supported_scopes(\n            &server.transport,\n            Arc::clone(&http_client),\n            OAuthDiscoveryTimeout::LOCAL,\n            StreamableHttpRedirectMode::Legacy,\n        )\n        .await","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/cli/src/mcp_cmd.rs#L537-L573","documentation":"Error \"OAuth login is only supported for streamable HTTP servers.\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/cli/src/mcp_cmd.rs:555 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}