Class AsyncMcpResourceProvider

java.lang.Object
org.springaicommunity.mcp.provider.resource.AsyncMcpResourceProvider

public class AsyncMcpResourceProvider extends Object
Provider for asynchronous MCP resource methods. This provider creates resource specifications for methods annotated with McpResource that are designed to work with McpAsyncServerExchange and return reactive types.
Author:
Christian Tzolov
  • Constructor Details

    • AsyncMcpResourceProvider

      public AsyncMcpResourceProvider(List<Object> resourceObjects)
      Create a new AsyncMcpResourceProvider.
      Parameters:
      resourceObjects - the objects containing methods annotated with McpResource
  • Method Details

    • getResourceSpecifications

      public List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceSpecification> getResourceSpecifications()
      Get the async resource specifications.
      Returns:
      the list of async resource specifications
    • getResourceTemplateSpecifications

      public List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceTemplateSpecification> getResourceTemplateSpecifications()
    • doGetClassMethods

      protected Method[] doGetClassMethods(Object bean)
    • doGetMcpResourceAnnotation

      protected McpResource doGetMcpResourceAnnotation(Method method)