@@ -743,11 +743,11 @@ async def handle_sse(scope: Scope, receive: Receive, send: Send):
743743 if self ._token_verifier :
744744 # Determine resource metadata URL
745745 resource_metadata_url = None
746- if self .settings .auth and self .settings .auth .authorization_servers :
746+ if self .settings .auth and self .settings .auth .resource_server_url :
747747 from pydantic import AnyHttpUrl
748748
749749 resource_metadata_url = AnyHttpUrl (
750- str (self .settings .auth .issuer_url ).rstrip ("/" ) + "/.well-known/oauth-protected-resource"
750+ str (self .settings .auth .resource_server_url ).rstrip ("/" ) + "/.well-known/oauth-protected-resource"
751751 )
752752
753753 # Auth is enabled, wrap the endpoints with RequireAuthMiddleware
@@ -785,13 +785,13 @@ async def sse_endpoint(request: Request) -> Response:
785785 )
786786 )
787787 # Add protected resource metadata endpoint if configured as RS
788- if self .settings .auth and self .settings .auth .authorization_servers :
788+ if self .settings .auth and self .settings .auth .resource_server_url :
789789 from mcp .server .auth .routes import create_protected_resource_routes
790790
791791 routes .extend (
792792 create_protected_resource_routes (
793- resource_url = self .settings .auth .issuer_url ,
794- authorization_servers = self .settings .auth .authorization_servers ,
793+ resource_url = self .settings .auth .resource_server_url ,
794+ authorization_servers = [ self .settings .auth .issuer_url ] ,
795795 scopes_supported = self .settings .auth .required_scopes ,
796796 )
797797 )
@@ -858,11 +858,11 @@ async def handle_streamable_http(scope: Scope, receive: Receive, send: Send) ->
858858 if self ._token_verifier :
859859 # Determine resource metadata URL
860860 resource_metadata_url = None
861- if self .settings .auth and self .settings .auth .authorization_servers :
861+ if self .settings .auth and self .settings .auth .resource_server_url :
862862 from pydantic import AnyHttpUrl
863863
864864 resource_metadata_url = AnyHttpUrl (
865- str (self .settings .auth .issuer_url ).rstrip ("/" ) + "/.well-known/oauth-protected-resource"
865+ str (self .settings .auth .resource_server_url ).rstrip ("/" ) + "/.well-known/oauth-protected-resource"
866866 )
867867
868868 routes .append (
@@ -881,14 +881,14 @@ async def handle_streamable_http(scope: Scope, receive: Receive, send: Send) ->
881881 )
882882
883883 # Add protected resource metadata endpoint if configured as RS
884- if self .settings .auth and self .settings .auth .authorization_servers :
884+ if self .settings .auth and self .settings .auth .resource_server_url :
885885 from mcp .server .auth .handlers .metadata import ProtectedResourceMetadataHandler
886886 from mcp .server .auth .routes import cors_middleware
887887 from mcp .shared .auth import ProtectedResourceMetadata
888888
889889 protected_resource_metadata = ProtectedResourceMetadata (
890- resource = self .settings .auth .issuer_url ,
891- authorization_servers = self .settings .auth .authorization_servers ,
890+ resource = self .settings .auth .resource_server_url ,
891+ authorization_servers = [ self .settings .auth .issuer_url ] ,
892892 scopes_supported = self .settings .auth .required_scopes ,
893893 )
894894 routes .append (
0 commit comments