{"record":{"id":"98a0e9e7459d6130","repo":"openai/codex","slug":"failed-to-read-mcp-config-for-selected-plugin-pl","errorCode":null,"errorMessage":"failed to read MCP config for selected plugin `{plugin_id}` at `{path}`: {source}","messagePattern":"failed to read MCP config for selected plugin `(.+?)` at `(.+?)`: (.+?)","errorType":"exception","errorClass":"ExecutorPluginMcpProviderError","httpStatus":null,"severity":"error","filePath":"codex-rs/ext/mcp/src/executor_plugin/provider.rs","lineNumber":24,"sourceCode":"use codex_plugin::PluginResourceLocator;\nuse codex_plugin::ResolvedPlugin;\nuse codex_plugin::ResolvedPluginLocation;\nuse codex_plugin::manifest::PluginManifestMcpServers;\nuse codex_utils_path_uri::PathUri;\nuse codex_utils_path_uri::PathUriParseError;\nuse std::io;\nuse 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 {","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/ext/mcp/src/executor_plugin/provider.rs#L6-L42","documentation":"ExecutorPluginMcpProvider::load reads the plugin's MCP config — the manifest's paths.mcp_servers file, or the default <plugin_root>/.mcp.json. ReadConfig wraps the io error. Note the asymmetry: NotFound on the DEFAULT .mcp.json returns Ok(vec![]) (no servers), so ReadConfig means either the manifest-declared path failed, or a non-NotFound error (permissions, transport) hit the default path.","triggerScenarios":"Manifest declares paths.mcp_servers pointing at a missing or unreadable file; or the default .mcp.json exists but reading it fails with permission or executor transport errors.","commonSituations":"Plugin manifest references an MCP config that is not shipped; wrong file mode bits inside the plugin environment; remote executor environment unreachable.","solutions":["Confirm the file at the printed path exists and is readable in the plugin environment.","If the plugin has no MCP servers, remove the paths.mcp_servers manifest entry — an absent default .mcp.json loads as empty.","Fix the manifest path or repackage the plugin.","Check executor environment connectivity when the io source is a transport error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match mcp_provider.load(&plugin).await {\n    Ok(servers) => servers,\n    Err(ExecutorPluginMcpProviderError::ReadConfig { plugin_id, path, source }) => {\n        tracing::warn!(%plugin_id, %path, %source, \"plugin MCP config unreadable; skipping\");\n        Vec::new()\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Only declare paths.mcp_servers in the manifest when the file actually ships.","Remember NotFound on the default .mcp.json is fine — it loads as zero servers.","Fix file modes inside plugin environments during packaging."],"tags":["rust","mcp","plugin","config","io","codex"],"backgroundTag":"config-file-unreadable","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}