Add MCP server scopes config and use it as fallback for OAuth login#9647
Merged
Add MCP server scopes config and use it as fallback for OAuth login#9647
scopes config and use it as fallback for OAuth login#9647Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
Author
|
With a config.toml of I'm able to |
gpeal
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
config.tomlinstead of requiring users to always pass--scopeson the CLI. CLI/remote parameters should still override config values.Description
scopes: Option<Vec<String>>toMcpServerConfigandRawMcpServerConfig, and propagate it through deserialization and the built config types.scopesinto the MCP server TOML viaserialize_mcp_server_tableincore/src/config/edit.rsand includescopesin the generated config schema (core/config.schema.json).codex-rs/cli/src/mcp_cmd.rsrun_loginto fall back toserver.scopeswhen the--scopesflag is empty, with explicit CLI scopes still taking precedence.codex-rs/app-server/src/codex_message_processor.rsmcp_server_oauth_loginto useparams.scopes.or_else(|| server.scopes.clone())so the RPC path also respects configured scopes.scopesfield (set toNone) so test code builds with the new struct field.Testing
just write-config-schema(succeeded),just fmt(succeeded), andjust fix -p codex-core,just fix -p codex-cli,just fix -p codex-app-server(succeeded where applicable).cargo test -p codex-cli(passed).cargo test -p codex-core(ran; many tests passed but several failed, including model refresh/403-related tests, shell snapshot/timeouts, and severalunified_execexpectations).cargo test -p codex-app-server(ran; many integration-suite tests failed due to mocked/remote HTTP 401/403 responses and wiremock expectations).If you want, I can split the tests into smaller focused runs or help debug the failing integration tests (they appear to be unrelated to the config change and stem from external HTTP/mocking behaviors encountered during the test runs).
Codex Task