Allow hosted Apps MCP contributions to override the protocol mode (#46019)

## What changed

Add an optional `protocol_mode` to `McpServerContribution::HostedApps` and apply it when registering the server. Preserve the hosted Apps default when no override is provided.

## Testing

Add an integration test that selects MCP `2026-07-28` with the global feature disabled and completes a native user verification flow, including resuming the tool call with the verification response. Extend capability tests to confirm that the override preserves hosted Apps user verification without granting it to ordinary extension registrations.

GitOrigin-RevId: e8662c45f964c00b0bb4503bbcfd8432d7e2fa70
This commit is contained in:
teddywyly-oai authored and copyberry committed 2026-09-16 20:32:52 +00:00
1 parent fc2ea82e7e
commit 6d75b525ea
10 files changed
+224 -29

No files matched your search

@@ -144,7 +144,11 @@ pub enum McpServerContribution {
protocol_mode: crate::McpProtocolMode,
},
/// Registers the controller-owned Apps server under its reserved name.
HostedApps { config: Box<McpServerConfig> },
HostedApps {
config: Box<McpServerConfig>,
/// Overrides the HTTP protocol mode, or uses the hosted Apps default when absent.
protocol_mode: Option<crate::McpProtocolMode>,
},
/// Registers a server declared by a plugin selected for this thread.
SelectedPlugin {
name: String,