@@ -189,6 +189,7 @@ impl ClientHandler for FullClientHandler {
189189
190190const CIMD_CLIENT_METADATA_URL : & str = "https://conformance-test.local/client-metadata.json" ;
191191const REDIRECT_URI : & str = "http://localhost:3000/callback" ;
192+ const SCOPE_STEP_UP_INITIAL_SCOPES : & [ & str ] = & [ "mcp:basic" ] ;
192193const SCOPE_STEP_UP_ESCALATED_SCOPES : & [ & str ] = & [ "mcp:basic" , "mcp:write" ] ;
193194
194195/// Perform the headless OAuth authorization-code flow.
@@ -320,11 +321,10 @@ async fn run_auth_scope_step_up_client(
320321 server_url : & str ,
321322 _ctx : & ConformanceContext ,
322323) -> anyhow:: Result < ( ) > {
323- // First auth
324324 let mut oauth = OAuthState :: new ( server_url, None ) . await ?;
325325 oauth
326326 . start_authorization_with_metadata_url (
327- & [ ] ,
327+ SCOPE_STEP_UP_INITIAL_SCOPES ,
328328 REDIRECT_URI ,
329329 Some ( "conformance-client" ) ,
330330 Some ( CIMD_CLIENT_METADATA_URL ) ,
@@ -351,7 +351,9 @@ async fn run_auth_scope_step_up_client(
351351 StreamableHttpClientTransportConfig :: with_uri ( server_url) ,
352352 ) ;
353353
354- let client = BasicClientHandler . serve ( transport) . await ?;
354+ let client = BasicClientHandler
355+ . serve_with_lifecycle ( transport, conformance_lifecycle ( ) )
356+ . await ?;
355357
356358 let tools = client. list_tools ( Default :: default ( ) ) . await ?;
357359 tracing:: debug!( "Listed {} tools" , tools. tools. len( ) ) ;
@@ -398,10 +400,12 @@ async fn run_auth_scope_step_up_client(
398400 auth_client2,
399401 StreamableHttpClientTransportConfig :: with_uri ( server_url) ,
400402 ) ;
401- let client2 = BasicClientHandler . serve ( transport2) . await ?;
402- let _ = client2
403+ let client2 = BasicClientHandler
404+ . serve_with_lifecycle ( transport2, conformance_lifecycle ( ) )
405+ . await ?;
406+ client2
403407 . call_tool ( call_tool_params ( tool. name . clone ( ) , args) )
404- . await ;
408+ . await ? ;
405409 client2. cancel ( ) . await . ok ( ) ;
406410 return Ok ( ( ) ) ;
407411 }
@@ -859,7 +863,7 @@ async fn run_basic_client(server_url: &str) -> anyhow::Result<()> {
859863}
860864
861865async fn run_tools_call_client ( server_url : & str , ctx : & ConformanceContext ) -> anyhow:: Result < ( ) > {
862- run_tools_call_client_with_lifecycle ( server_url, ctx, ClientLifecycleMode :: Initialize ) . await
866+ run_tools_call_client_with_lifecycle ( server_url, ctx, conformance_lifecycle ( ) ) . await
863867}
864868
865869async fn run_discover_tools_call_client (
@@ -930,7 +934,17 @@ fn conformance_protocol_version() -> ProtocolVersion {
930934 std:: env:: var ( "MCP_CONFORMANCE_PROTOCOL_VERSION" )
931935 . ok ( )
932936 . and_then ( |version| serde_json:: from_value ( Value :: String ( version) ) . ok ( ) )
933- . unwrap_or ( ProtocolVersion :: V_2026_07_28 )
937+ . unwrap_or ( ProtocolVersion :: V_2025_11_25 )
938+ }
939+
940+ fn conformance_lifecycle ( ) -> ClientLifecycleMode {
941+ if conformance_protocol_version ( ) . as_str ( ) >= ProtocolVersion :: V_2026_07_28 . as_str ( ) {
942+ ClientLifecycleMode :: Discover {
943+ preferred_versions : preferred_protocol_versions ( ) ,
944+ }
945+ } else {
946+ ClientLifecycleMode :: Initialize
947+ }
934948}
935949
936950/// Preferred protocol versions for discover-lifecycle negotiation: the
0 commit comments