diff --git a/codex-rs/cli/src/mcp_cmd.rs b/codex-rs/cli/src/mcp_cmd.rs index 93f22e705c5..a50a837a04e 100644 --- a/codex-rs/cli/src/mcp_cmd.rs +++ b/codex-rs/cli/src/mcp_cmd.rs @@ -53,11 +53,11 @@ pub enum McpSubcommand { Remove(RemoveArgs), /// [experimental] Authenticate with a configured MCP server via OAuth. - /// Requires experimental_use_rmcp_client = true in config.toml. + /// Requires [features].rmcp_client = true in config.toml. Login(LoginArgs), /// [experimental] Remove stored OAuth credentials for a server. - /// Requires experimental_use_rmcp_client = true in config.toml. + /// Requires [features].rmcp_client = true in config.toml. Logout(LogoutArgs), } @@ -285,7 +285,7 @@ async fn run_add(config_overrides: &CliConfigOverrides, add_args: AddArgs) -> Re Ok(true) => { if !config.features.enabled(Feature::RmcpClient) { println!( - "MCP server supports login. Add `experimental_use_rmcp_client = true` \ + "MCP server supports login. Add `[features].rmcp_client = true` \ to your config.toml and run `codex mcp login {name}` to login." ); } else { diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rs index 6276d3b6e3c..8300fd1e3c3 100644 --- a/codex-rs/core/src/config/mod.rs +++ b/codex-rs/core/src/config/mod.rs @@ -718,7 +718,6 @@ pub struct ConfigToml { pub experimental_instructions_file: Option, pub experimental_compact_prompt_file: Option, pub experimental_use_unified_exec_tool: Option, - pub experimental_use_rmcp_client: Option, pub experimental_use_freeform_apply_patch: Option, pub experimental_sandbox_command_assessment: Option, /// Preferred OSS provider for local models, e.g. "lmstudio" or "ollama". @@ -1807,10 +1806,12 @@ trust_level = "trusted" #[test] fn legacy_toggles_map_to_features() -> std::io::Result<()> { let codex_home = TempDir::new()?; + let mut entries = BTreeMap::new(); + entries.insert("unified_exec".to_string(), true); + entries.insert("rmcp_client".to_string(), true); + entries.insert("apply_patch_freeform".to_string(), true); let cfg = ConfigToml { - experimental_use_unified_exec_tool: Some(true), - experimental_use_rmcp_client: Some(true), - experimental_use_freeform_apply_patch: Some(true), + features: Some(crate::features::FeaturesToml { entries }), ..Default::default() }; diff --git a/codex-rs/core/src/config/profile.rs b/codex-rs/core/src/config/profile.rs index 3d9e60b8e5f..75b80d0bb04 100644 --- a/codex-rs/core/src/config/profile.rs +++ b/codex-rs/core/src/config/profile.rs @@ -25,7 +25,6 @@ pub struct ConfigProfile { pub experimental_compact_prompt_file: Option, pub include_apply_patch_tool: Option, pub experimental_use_unified_exec_tool: Option, - pub experimental_use_rmcp_client: Option, pub experimental_use_freeform_apply_patch: Option, pub experimental_sandbox_command_assessment: Option, pub tools_web_search: Option, diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs index 687e8b16271..53e5e6e083f 100644 --- a/codex-rs/core/src/features.rs +++ b/codex-rs/core/src/features.rs @@ -190,7 +190,6 @@ impl Features { experimental_sandbox_command_assessment: cfg.experimental_sandbox_command_assessment, experimental_use_freeform_apply_patch: cfg.experimental_use_freeform_apply_patch, experimental_use_unified_exec_tool: cfg.experimental_use_unified_exec_tool, - experimental_use_rmcp_client: cfg.experimental_use_rmcp_client, tools_web_search: cfg.tools.as_ref().and_then(|t| t.web_search), tools_view_image: cfg.tools.as_ref().and_then(|t| t.view_image), ..Default::default() @@ -209,7 +208,6 @@ impl Features { .experimental_use_freeform_apply_patch, experimental_use_unified_exec_tool: config_profile.experimental_use_unified_exec_tool, - experimental_use_rmcp_client: config_profile.experimental_use_rmcp_client, tools_web_search: config_profile.tools_web_search, tools_view_image: config_profile.tools_view_image, }; diff --git a/codex-rs/core/src/features/legacy.rs b/codex-rs/core/src/features/legacy.rs index 4d59f2a9a33..b932b4583a6 100644 --- a/codex-rs/core/src/features/legacy.rs +++ b/codex-rs/core/src/features/legacy.rs @@ -17,10 +17,6 @@ const ALIASES: &[Alias] = &[ legacy_key: "experimental_use_unified_exec_tool", feature: Feature::UnifiedExec, }, - Alias { - legacy_key: "experimental_use_rmcp_client", - feature: Feature::RmcpClient, - }, Alias { legacy_key: "experimental_use_freeform_apply_patch", feature: Feature::ApplyPatchFreeform, @@ -51,7 +47,6 @@ pub struct LegacyFeatureToggles { pub experimental_sandbox_command_assessment: Option, pub experimental_use_freeform_apply_patch: Option, pub experimental_use_unified_exec_tool: Option, - pub experimental_use_rmcp_client: Option, pub tools_web_search: Option, pub tools_view_image: Option, } @@ -82,12 +77,6 @@ impl LegacyFeatureToggles { self.experimental_use_unified_exec_tool, "experimental_use_unified_exec_tool", ); - set_if_some( - features, - Feature::RmcpClient, - self.experimental_use_rmcp_client, - "experimental_use_rmcp_client", - ); set_if_some( features, Feature::WebSearchRequest, diff --git a/docs/config.md b/docs/config.md index 0f0761a3012..242043c9a06 100644 --- a/docs/config.md +++ b/docs/config.md @@ -464,10 +464,11 @@ http_headers = { "HEADER_NAME" = "HEADER_VALUE" } env_http_headers = { "HEADER_NAME" = "ENV_VAR" } ``` -Streamable HTTP connections always use the experimental Rust MCP client under the hood, so expect occasional rough edges. OAuth login flows are gated on the `experimental_use_rmcp_client = true` flag: +Streamable HTTP connections always use the experimental Rust MCP client under the hood, so expect occasional rough edges. OAuth login flows are gated on the `rmcp_client` feature flag: ```toml -experimental_use_rmcp_client = true +[features] +rmcp_client = true ``` After enabling it, run `codex mcp login ` when the server supports OAuth. @@ -491,10 +492,11 @@ When both `enabled_tools` and `disabled_tools` are specified, Codex first restri #### Experimental RMCP client -This flag enables OAuth support for streamable HTTP servers. +This feature enables OAuth support for streamable HTTP servers. ```toml -experimental_use_rmcp_client = true +[features] +rmcp_client = true [mcp_servers.server_name] … diff --git a/docs/example-config.md b/docs/example-config.md index 6061dc88301..333ca849f07 100644 --- a/docs/example-config.md +++ b/docs/example-config.md @@ -229,9 +229,6 @@ enable_experimental_windows_sandbox = false # Use experimental unified exec tool. Default: false experimental_use_unified_exec_tool = false -# Use experimental Rust MCP client (enables OAuth for HTTP MCP). Default: false -experimental_use_rmcp_client = false - # Include apply_patch via freeform editing path (affects default tool set). Default: false experimental_use_freeform_apply_patch = false @@ -320,7 +317,6 @@ experimental_use_freeform_apply_patch = false # experimental_compact_prompt_file = "compact_prompt.txt" # include_apply_patch_tool = false # experimental_use_unified_exec_tool = false -# experimental_use_rmcp_client = false # experimental_use_freeform_apply_patch = false # experimental_sandbox_command_assessment = false # tools_web_search = false