Class McpProtectedResourceMetadataCustomizer

java.lang.Object
io.meeds.mcp.server.web.McpProtectedResourceMetadataCustomizer
All Implemented Interfaces:
Consumer<org.springframework.security.oauth2.server.resource.OAuth2ProtectedResourceMetadata.Builder>

@Component public class McpProtectedResourceMetadataCustomizer extends Object implements Consumer<org.springframework.security.oauth2.server.resource.OAuth2ProtectedResourceMetadata.Builder>
The claims of the OAuth 2.0 Protected Resource Metadata document (RFC 9728) of the MCP endpoint. Spring Security's resource server serves that document itself, at /.well-known/oauth-protected-resource/**, ahead of any controller, so the document is customized here and passed to the resource server configuration of each security filter chain.
  • Field Details

    • MCP_SERVER_SCOPES_PROPERTY

      public static final String MCP_SERVER_SCOPES_PROPERTY
      The scopes the authorization server grants for the MCP application, read by OAuthSettingService#getScopes from the same property
      See Also:
  • Constructor Details

    • McpProtectedResourceMetadataCustomizer

      public McpProtectedResourceMetadataCustomizer()
  • Method Details

    • accept

      public void accept(org.springframework.security.oauth2.server.resource.OAuth2ProtectedResourceMetadata.Builder builder)
      Specified by:
      accept in interface Consumer<org.springframework.security.oauth2.server.resource.OAuth2ProtectedResourceMetadata.Builder>