openai/codex · error · StartupOutcomeError

MCP startup failed

Error message

MCP startup failed: {error}

What it means

StartupOutcomeError::Failed variant: MCP server startup completed with an error. Because anyhow::Error is not Clone, the original error is rendered into `error` at capture time; consumers (e.g. listed_tools fallback for Codex Apps) branch on this variant to decide cache fallback.

Solutions

  1. Inspect the reported underlying error, fix the MCP server command or environment, and retry startup.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/codex-mcp/src/rmcp_client.rs:588 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/803a18d85d9c1c24. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/codex-mcp/src/rmcp_client.rs:588

        {
            Some(startup_tools)
        } else {
            match self.client().await {
                Ok(client) => Some(client.listed_tools()),
                Err(_) if self.is_codex_apps_mcp_server => self.cached_tools(),
                Err(_) => None,
            }
        }
    }
}

#[derive(Debug, Clone, thiserror::Error)]
pub(crate) enum StartupOutcomeError {
    #[error("MCP startup cancelled")]
    Cancelled,
    // We can't store the original error here because anyhow::Error doesn't implement
    // `Clone`.
    #[error("MCP startup failed: {error}")]
    Failed {
        error: String,
        is_authentication_required: bool,
    },
}

impl StartupOutcomeError {
    pub(crate) fn is_authentication_required(&self) -> bool {
        match self {
            Self::Cancelled => false,
            Self::Failed {
                error,
                is_authentication_required,
            } => *is_authentication_required || error.contains("Auth required"),
        }
    }
}

View on GitHub (pinned to 339751715c)