Prepare MCP connections for coordinated OAuth refresh (#42128)

## What changed

- Add the under-development `mcp_oauth_refresh_coordination` feature and pin its selected refresh mode to each MCP connection.
- Treat the refresh mode as part of OAuth connection identity so runtime and MCP configuration refreshes reconnect when the mode changes.
- Keep legacy refresh behavior in builds where coordination is unavailable and emit a warning when coordinated mode is selected.

## Testing

- Cover connection replacement when the feature is toggled through both runtime and MCP configuration refresh paths.

GitOrigin-RevId: 89596150f0338e6ede0e712badecea4450831766
This commit is contained in:
Matthew Zeng
2026-09-01 20:26:57 +00:00
committed by copyberry
parent 7730edf62c
commit bd89ce67cc
15 changed files with 232 additions and 3 deletions
+8
View File
@@ -204,6 +204,8 @@ pub enum Feature {
EnableMcpApps,
/// Enable MCP protocol version 2026-07-28 support.
Mcp20260728,
/// Let RMCP coordinate OAuth refresh through the configured credential store.
McpOAuthRefreshCoordination,
/// Removed compatibility flag for the legacy Apps MCP path override.
AppsMcpPathOverride,
/// Removed compatibility flag retained as a no-op now that tool_search is always enabled.
@@ -1251,6 +1253,12 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::McpOAuthRefreshCoordination,
key: "mcp_oauth_refresh_coordination",
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::AppsMcpPathOverride,
key: "apps_mcp_path_override",