Class SyncModernMcpResourceProvider

java.lang.Object
org.springframework.ai.mcp.annotation.provider.resource.SyncModernMcpResourceProvider

public class SyncModernMcpResourceProvider extends Object
Creates resource and resource template registrations for a 2026-07-28 ("modern") MCP server from methods annotated with McpResource. Each method is served by a SyncModernMcpResourceMethodCallback wrapped in a McpSyncResource that requires the client capabilities listed in McpResource.requiredCapabilities().
Since:
2.1.0
Author:
Christian Tzolov
  • Constructor Details

    • SyncModernMcpResourceProvider

      public SyncModernMcpResourceProvider(List<Object> resourceObjects)
  • Method Details

    • setJsonMapper

      public void setJsonMapper(@Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      Sets the mapper the resource methods convert their MRTR input responses with, normally the server's. Unset, the SDK default is used.
    • getResources

      public List<SyncResourceRegistration> getResources()
    • getResourceTemplates

      public List<SyncResourceTemplateRegistration> getResourceTemplates()
    • doGetClassMethods

      protected Method[] doGetClassMethods(Object bean)
    • doGetMcpResourceAnnotation

      protected McpResource doGetMcpResourceAnnotation(Method method)