openai/codex · error · anyhow::Error

unknown MCP server '{name}'

Error message

unknown MCP server '{name}'

What it means

Error "unknown MCP server '{name}'" thrown in openai/codex.

Source

Thrown at codex-rs/codex-mcp/src/connection_manager/resources.rs:175

            .with_context(|| format!("resources/read failed for `{server}` ({uri})"))
    }

    pub(crate) async fn client_by_name(
        &self,
        name: &str,
    ) -> Result<(ManagedClient, Option<Duration>)> {
        let (client, timeout, _connection) = self.client_with_connection_by_name(name).await?;
        Ok((client, timeout))
    }

    pub(crate) async fn client_with_connection_by_name(
        &self,
        name: &str,
    ) -> Result<(ManagedClient, Option<Duration>, Arc<McpServerConnection>)> {
        let view = self
            .servers
            .get(name)
            .ok_or_else(|| anyhow!("unknown MCP server '{name}'"))?;
        let connection = Arc::clone(&view.connection);
        let client = connection.client().await.context("failed to get client")?;
        Ok((client, view.tool_timeout, connection))
    }
}

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/codex-mcp/src/connection_manager/resources.rs:175 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/68e9d1555ee8cbfc. Report an issue: GitHub.