Support per-server MCP OAuth callback ports (#38448)

## What changed

- Add `oauth.callback_port` to MCP server configuration and preserve it when
  serializing configuration edits.
- Accept `oauth.callbackPort` from plugin MCP declarations and skill dependency
  metadata.
- Prefer the server-specific callback port over `mcp_oauth_callback_port` for
  CLI login, app-server, plugin installation, executor, and skill dependency
  OAuth flows.

## Testing

- Cover configuration parsing, serialization, and fallback behavior.
- Verify plugin, executor, and skill OAuth registrations use their configured
  callback ports instead of the global port.

GitOrigin-RevId: 7f65e5e7869358307e49779f1b75e8672b607736
This commit is contained in:
willwang-openai authored and copyberry committed 2026-08-13 22:42:12 +00:00
1 parent ca83f7908c
commit 1da59ad257
22 files changed
+205 -37

No files matched your search

+4 -6
View File
@@ -266,12 +266,10 @@ fn normalize_plugin_mcp_server_value(
}
if let Some(JsonValue::Object(mut oauth)) = object.remove("oauth") {
if oauth.remove("callbackPort").is_some() {
let plugin_display = source.display();
warn!(
plugin = %plugin_display,
"plugin MCP server OAuth callbackPort is ignored; Codex uses global MCP OAuth callback settings"
);
if let Some(callback_port) = oauth.remove("callbackPort") {
oauth
.entry("callback_port".to_string())
.or_insert(callback_port);
}
if let Some(client_id) = oauth.remove("clientId") {