openai/codex · error · std::io::Error

workload identity is not supported by `codex mcp-server`

Error message

workload identity is not supported by `codex mcp-server`

What it means

reject_workload_identity is a startup guard: workload identity authentication was selected, but `codex mcp-server` does not support it. It fails fast before the server starts so unsupported auth never yields confusing runtime auth failures.

Solutions

  1. Authenticate with a supported method (API key login or ChatGPT login) instead of workload identity
  2. Remove workload identity settings from config/env when launching mcp-server
  3. Track support for workload identity in mcp-server in future releases
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/mcp-server/src/lib.rs:213 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/82b17a54d1ad0562. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/mcp-server/src/lib.rs:213

                }
                Err(e) => error!("Failed to serialize JSON-RPC message: {e}"),
            }
        }

        info!("stdout writer exited (channel closed)");
    });

    // Wait for all tasks to finish.  The typical exit path is the stdin reader
    // hitting EOF which, once it drops `incoming_tx`, propagates shutdown to
    // the processor and then to the stdout task.
    let _ = tokio::join!(stdin_reader_handle, processor_handle, stdout_writer_handle);

    Ok(())
}

fn reject_workload_identity(workload_identity_selected: bool) -> IoResult<()> {
    if workload_identity_selected {
        return Err(std::io::Error::new(
            ErrorKind::Unsupported,
            "workload identity is not supported by `codex mcp-server`",
        ));
    }
    Ok(())
}

#[cfg(test)]
#[path = "workload_identity_tests.rs"]
mod workload_identity_tests;

#[cfg(test)]
mod tests {
    use super::*;
    use codex_config::types::OtelExporterKind;
    use codex_core::config::ConfigBuilder;
    use pretty_assertions::assert_eq;
    use std::collections::HashMap;

View on GitHub (pinned to 339751715c)