openai/codex · error · anyhow::Error

OAuth login is only supported for streamable HTTP servers.

Error message

OAuth login is only supported for streamable HTTP servers.

What it means

Error "OAuth login is only supported for streamable HTTP servers." thrown in openai/codex.

Source

Thrown at codex-rs/cli/src/mcp_cmd.rs:555

        scopes,
        oauth_client_registration,
    } = login_args;
    let client_registration = oauth_client_registration
        .map(McpOAuthClientRegistration::from)
        .unwrap_or_default();

    let Some(server) = mcp_servers.get(&name) else {
        bail!("No MCP server named '{name}' found.");
    };

    let (url, http_headers, env_http_headers) = match &server.transport {
        McpServerTransportConfig::StreamableHttp {
            url,
            http_headers,
            env_http_headers,
            ..
        } => (url.clone(), http_headers.clone(), env_http_headers.clone()),
        _ => bail!("OAuth login is only supported for streamable HTTP servers."),
    };

    // Standalone `mcp login` runs OAuth from the local CLI process; execution
    // environment routing belongs to app-server and session MCP flows.
    let http_client: Arc<dyn HttpClient> = Arc::new(
        RouteAwareHttpClient::new(config.http_client_factory()).with_tls_backend_fallback(),
    );
    let http_client = apply_http_headers_helper(http_client, server, config.cwd.to_path_buf())
        .map_err(anyhow::Error::msg)?;
    let explicit_scopes = (!scopes.is_empty()).then_some(scopes);
    let discovered_scopes = if explicit_scopes.is_none() && server.scopes.is_none() {
        discover_supported_scopes(
            &server.transport,
            Arc::clone(&http_client),
            OAuthDiscoveryTimeout::LOCAL,
            StreamableHttpRedirectMode::Legacy,
        )
        .await

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/cli/src/mcp_cmd.rs:555 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/e49a43154dcde7dc. Report an issue: GitHub.