{"record":{"id":"59e2f24670d9b50c","repo":"openai/codex","slug":"failed-to-resolve-mcp-config-path-relative-path","errorCode":null,"errorMessage":"failed to resolve MCP config path `{relative_path}` below selected plugin `{plugin_id}` at `{root}`: {source}","messagePattern":"failed to resolve MCP config path `(.+?)` below selected plugin `(.+?)` at `(.+?)`: (.+?)","errorType":"exception","errorClass":"ExecutorPluginMcpProviderError","httpStatus":null,"severity":"error","filePath":"codex-rs/ext/mcp/src/executor_plugin/provider.rs","lineNumber":31,"sourceCode":"use thiserror::Error;\n\nconst DEFAULT_MCP_CONFIG_FILE: &str = \".mcp.json\";\n\n/// Loads MCP declarations from resolved plugins through their owning executor.\n#[derive(Clone, Copy, Debug, Default)]\npub(super) struct ExecutorPluginMcpProvider;\n\n/// Failure to load an executor plugin's MCP declarations.\n#[derive(Debug, Error)]\npub(super) enum ExecutorPluginMcpProviderError {\n    #[error(\"failed to read MCP config for selected plugin `{plugin_id}` at `{path}`: {source}\")]\n    ReadConfig {\n        plugin_id: String,\n        path: PathUri,\n        #[source]\n        source: io::Error,\n    },\n    #[error(\n        \"failed to resolve MCP config path `{relative_path}` below selected plugin `{plugin_id}` at `{root}`: {source}\"\n    )]\n    InvalidConfigPath {\n        plugin_id: String,\n        root: PathUri,\n        relative_path: &'static str,\n        #[source]\n        source: PathUriParseError,\n    },\n    #[error(\"failed to parse MCP config for selected plugin `{plugin_id}` at `{path}`: {source}\")]\n    ParseConfig {\n        plugin_id: String,\n        path: PathUri,\n        #[source]\n        source: serde_json::Error,\n    },\n}\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/ext/mcp/src/executor_plugin/provider.rs#L13-L49","documentation":"load_from_file_system joins DEFAULT_MCP_CONFIG_FILE ('.mcp.json') onto the plugin root PathUri; a PathUriParseError from that join surfaces as InvalidConfigPath with the root and relative segment. The plugin root itself does not compose with the relative path — a malformed or exotic root locator rather than a user file problem.","triggerScenarios":"A resolved environment plugin whose root PathUri has a scheme or shape that cannot take '.mcp.json' as a child (corrupt registration, unusual remote URI).","commonSituations":"Broken plugin environment registration; hand-edited plugin root locators; version skew between codex-plugin resolution and the path-URI utilities.","solutions":["Inspect the plugin root URI printed as {root} for an invalid scheme or malformed segments.","Re-register or reinstall the plugin environment so the root resolves cleanly.","Report upstream if a valid-looking root reproducibly fails to join."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match mcp_provider.load(&plugin).await {\n    Err(ExecutorPluginMcpProviderError::InvalidConfigPath { plugin_id, root, source }) => {\n        tracing::error!(%plugin_id, %root, %source, \"plugin root cannot host .mcp.json; reinstall plugin\");\n        Vec::new()\n    }\n    r => r?,\n}","preventionTips":["Register plugin environments with well-formed root URIs.","Treat this variant as an installation defect — reinstall rather than retry.","Log root and the PathUriParseError source when reporting upstream."],"tags":["rust","mcp","plugin","path","codex"],"backgroundTag":"path-resolution-failed","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}