@@ -623,6 +623,7 @@ impl AuthorizationSession {
623623 mut auth_manager : AuthorizationManager ,
624624 scopes : & [ & str ] ,
625625 redirect_uri : & str ,
626+ client_name : Option < & str > ,
626627 ) -> Result < Self , AuthError > {
627628 // set redirect uri
628629 let config = OAuthClientConfig {
@@ -634,7 +635,7 @@ impl AuthorizationSession {
634635
635636 // try to dynamic register client
636637 let config = match auth_manager
637- . register_client ( "MCP Client" , redirect_uri)
638+ . register_client ( client_name . unwrap_or ( "MCP Client" ) , redirect_uri)
638639 . await
639640 {
640641 Ok ( config) => config,
@@ -793,6 +794,7 @@ impl OAuthState {
793794 & mut self ,
794795 scopes : & [ & str ] ,
795796 redirect_uri : & str ,
797+ client_name : Option < & str > ,
796798 ) -> Result < ( ) , AuthError > {
797799 if let OAuthState :: Unauthorized ( mut manager) = std:: mem:: replace (
798800 self ,
@@ -802,7 +804,8 @@ impl OAuthState {
802804 let metadata = manager. discover_metadata ( ) . await ?;
803805 manager. metadata = Some ( metadata) ;
804806 debug ! ( "start session" ) ;
805- let session = AuthorizationSession :: new ( manager, scopes, redirect_uri) . await ?;
807+ let session =
808+ AuthorizationSession :: new ( manager, scopes, redirect_uri, client_name) . await ?;
806809 * self = OAuthState :: Session ( session) ;
807810 Ok ( ( ) )
808811 } else {
0 commit comments