Class AsyncModernMcpResourceProvider

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

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

    • AsyncModernMcpResourceProvider

      public AsyncModernMcpResourceProvider(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<AsyncResourceRegistration> getResources()
    • getResourceTemplates

      public List<AsyncResourceTemplateRegistration> getResourceTemplates()
    • doGetClassMethods

      protected Method[] doGetClassMethods(Object bean)
    • doGetMcpResourceAnnotation

      protected McpResource doGetMcpResourceAnnotation(Method method)