{"record":{"id":"a2489e1be4a30084","repo":"openai/codex","slug":"mcp-servers-server-name-uses-unsupported-bearer","errorCode":null,"errorMessage":"mcp_servers.{server_name} uses unsupported `bearer_token`; set `bearer_token_env_var`.","messagePattern":"mcp_servers\\.(.+?) uses unsupported `bearer_token`; set `bearer_token_env_var`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/config/mod.rs","lineNumber":2205,"sourceCode":"        .try_into()\n        .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))\n}\n\n/// We briefly allowed plain text bearer_token fields in MCP server configs.\n/// We want to warn people who recently added these fields but can remove this after a few months.\nfn ensure_no_inline_bearer_tokens(value: &TomlValue) -> std::io::Result<()> {\n    let Some(servers_table) = value.as_table() else {\n        return Ok(());\n    };\n\n    for (server_name, server_value) in servers_table {\n        if let Some(server_table) = server_value.as_table()\n            && server_table.contains_key(\"bearer_token\")\n        {\n            let message = format!(\n                \"mcp_servers.{server_name} uses unsupported `bearer_token`; set `bearer_token_env_var`.\"\n            );\n            return Err(std::io::Error::new(ErrorKind::InvalidData, message));\n        }\n    }\n\n    Ok(())\n}\n\npub(crate) fn set_project_trust_level_inner(\n    doc: &mut DocumentMut,\n    project_path: &Path,\n    trust_level: TrustLevel,\n) -> anyhow::Result<()> {\n    // Ensure we render a human-friendly structure:\n    //\n    // [projects]\n    // [projects.\"/path/to/project\"]\n    // trust_level = \"trusted\" or \"untrusted\"\n    //\n    // rather than inline tables like:","sourceCodeStart":2187,"sourceCodeEnd":2223,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/config/mod.rs#L2187-L2223","documentation":"Error \"mcp_servers.{server_name} uses unsupported `bearer_token`; set `bearer_token_env_var`.\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/core/src/config/mod.rs:2205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace `bearer_token` with `bearer_token_env_var` referencing an environment variable that holds the token."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}