openai/codex · error

originating MCP tool is disabled by app configuration

Error message

originating MCP tool is disabled by app configuration

What it means

Policy check in ResourceOrigin::read: the AppToolPolicyEvaluator evaluated the app configuration layer stack and determined the originating tool is disabled by policy, so the resource read is rejected.

Solutions

  1. Enable the tool in the app configuration before using it.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/codex-mcp/src/resource_origin.rs:296 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/f818f6f23dda07a6. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/codex-mcp/src/resource_origin.rs:296

                .and_then(|meta| meta.get("requires_explicit_link_id"))
                .and_then(serde_json::Value::as_bool)
                == Some(true)
        {
            anyhow::bail!("originating MCP tool requires an explicit account link");
        }

        let annotations = tool_info.tool.annotations.as_ref();
        if !AppToolPolicyEvaluator::new(&binding.config().config_layer_stack)
            .policy(AppToolPolicyInput {
                connector_id: Some(&self.connector_id),
                tool_name: tool_info.tool.name.as_ref(),
                tool_title: tool_info.tool.title.as_deref(),
                destructive_hint: annotations.and_then(|value| value.destructive_hint),
                open_world_hint: annotations.and_then(|value| value.open_world_hint),
            })
            .enabled
        {
            anyhow::bail!("originating MCP tool is disabled by app configuration");
        }

        let meta = serde_json::from_value(serde_json::json!({
            "threadId": thread_id,
            "x-codex-turn-metadata": {
                "mcp_request_meta": {
                    "selected_connector_ids": [&self.connector_id],
                    "link_id": &self.link_id,
                }
            },
        }))?;
        binding
            .read_resource(
                CODEX_APPS_MCP_SERVER_NAME,
                ReadResourceRequestParams::new(uri).with_meta(meta),
            )
            .await
    }

View on GitHub (pinned to 339751715c)