openai/codex · error · anyhow::Error

unknown MCP server '{server}'

Error message

unknown MCP server '{server}'

What it means

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

Source

Thrown at codex-rs/codex-mcp/src/connection_manager.rs:881

        }
    }

    /// Invoke the tool indicated by the (server, tool) pair.
    #[allow(clippy::too_many_arguments)]
    pub async fn call_tool(
        &self,
        server: &str,
        tool: &str,
        environment_id: Option<&str>,
        arguments: Option<serde_json::Value>,
        meta: Option<serde_json::Value>,
        requested_timeout: Option<Duration>,
        wait_for_server: bool,
    ) -> Result<CallToolResult> {
        let view = self
            .servers
            .get(server)
            .ok_or_else(|| anyhow!("unknown MCP server '{server}'"))?;
        if let Some(environment_id) = environment_id
            && view.metadata.environment_id != environment_id
        {
            bail!(
                "MCP server `{server}` is running in environment `{}`, expected `{environment_id}`",
                view.metadata.environment_id
            );
        }
        if !view.tool_filter.allows(tool) {
            return Err(anyhow!(
                "tool '{tool}' is disabled for MCP server '{server}'"
            ));
        }
        let client = if wait_for_server {
            view.connection
                .client()
                .await
                .context("failed to get client")?

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/codex-mcp/src/connection_manager.rs:881 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/c3563d7562ddf07f. Report an issue: GitHub.