@@ -681,29 +681,40 @@ func processMcpMessage(ctx context.Context, body []byte, s *Server, protocolVers
681681}
682682
683683type prmResponse struct {
684- Resource string `json:"resource"`
685- AuthorizationServers []string `json:"authorization_servers"`
684+ Resource string `json:"resource"`
685+ AuthorizationServers []string `json:"authorization_servers"`
686+ ScopesSupported []string `json:"scopes_supported,omitempty"`
687+ BearerMethodsSupported []string `json:"bearer_methods_supported"`
686688}
687689
688690// prmHandler generates the Protected Resource Metadata (PRM) file for MCP Authorization.
689691func prmHandler (s * Server , w http.ResponseWriter , r * http.Request ) {
690692 var servers []string
693+ var scopes []string
691694 for _ , authSvc := range s .ResourceMgr .GetAuthServiceMap () {
692695 cfg := authSvc .ToConfig ()
693696 if genCfg , ok := cfg .(generic.Config ); ok {
694697 if genCfg .McpEnabled {
695698 servers = append (servers , genCfg .AuthURL )
699+ if genCfg .ScopesRequired != nil {
700+ scopes = genCfg .ScopesRequired
701+ }
696702 }
697703 }
698704 }
699705
700706 if servers == nil {
701707 servers = []string {}
702708 }
709+ if scopes == nil {
710+ scopes = []string {}
711+ }
703712
704713 res := prmResponse {
705- Resource : s .toolboxUrl ,
706- AuthorizationServers : servers ,
714+ Resource : s .toolboxUrl ,
715+ AuthorizationServers : servers ,
716+ ScopesSupported : scopes ,
717+ BearerMethodsSupported : []string {"header" },
707718 }
708719
709720 w .Header ().Set ("Content-Type" , "application/json" )
0 commit comments