Add per-login MCP OAuth client registration selection (#38052)

## What changed

- Add `--oauth-client-registration` with `auto` and `dcr` choices to `codex mcp add` and `codex mcp login`.
- Add the equivalent optional `clientRegistration` field to `mcpServer/oauth/login` and the generated protocol schemas.
- Keep automatic dynamic client registration as the default, prefer a configured OAuth client ID when present, and apply the selection only to the current login without persisting it in MCP configuration.

## Testing

- Cover dynamic registration and configured-client OAuth flows through the app server.
- Verify the CLI does not persist the per-login registration choice.

GitOrigin-RevId: 653a4a1054ff43c2c5d52ae863b6a96d21692a53
This commit is contained in:
stevenlee-oai authored and copyberry committed 2026-08-11 18:35:03 +00:00
1 parent 965b9f263a
commit 6dc3ac8721
22 files changed
+407 -65

No files matched your search

@@ -2195,6 +2195,7 @@ mod tests {
params: v2::McpServerOauthLoginParams {
name: "server-a".to_string(),
thread_id: None,
client_registration: None,
scopes: None,
timeout_secs: None,
},