Class AsyncMcpAnnotationProviders

java.lang.Object
org.springframework.ai.mcp.annotation.spring.AsyncMcpAnnotationProviders

public final class AsyncMcpAnnotationProviders extends Object
Author:
Christian Tzolov
  • Method Details

    • loggingSpecifications

      public static List<AsyncLoggingSpecification> loggingSpecifications(List<Object> loggingObjects)
    • samplingSpecifications

      public static List<AsyncSamplingSpecification> samplingSpecifications(List<Object> samplingObjects)
    • elicitationSpecifications

      public static List<AsyncElicitationSpecification> elicitationSpecifications(List<Object> elicitationObjects)
    • progressSpecifications

      public static List<AsyncProgressSpecification> progressSpecifications(List<Object> progressObjects)
    • elicitationProvider

      public static AsyncMcpElicitationProvider elicitationProvider(List<Object> elicitationObjects)
      The provider of the elicitation handlers of the given objects. One provider creates the handlers for the legacy clients and those for the clients of the 2026-07-28 ("modern") MCP revision from the same callbacks.
      Parameters:
      elicitationObjects - the objects with the @McpElicitation methods
      Returns:
      the elicitation provider
      Since:
      2.1.0
    • progressProvider

      public static AsyncMcpProgressProvider progressProvider(List<Object> progressObjects)
      The provider of the progress handlers of the given objects. One provider creates the handlers for the legacy clients and those for the clients of the 2026-07-28 ("modern") MCP revision from the same callbacks.
      Parameters:
      progressObjects - the objects with the @McpProgress methods
      Returns:
      the progress provider
      Since:
      2.1.0
    • toolSpecifications

      public static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification> toolSpecifications(List<Object> toolObjects)
    • statelessToolSpecifications

      public static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncToolSpecification> statelessToolSpecifications(List<Object> toolObjects)
    • modernTools

      public static List<io.modelcontextprotocol.modern.server.feature.McpAsyncTool> modernTools(List<Object> toolObjects)
      Since:
      2.1.0
    • modernTools

      public static List<io.modelcontextprotocol.modern.server.feature.McpAsyncTool> modernTools(List<Object> toolObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      Parameters:
      jsonMapper - the server's mapper, used for the tool schemas and for converting MRTR input responses, or null for the SDK default
      Since:
      2.1.0
    • modernPrompts

      public static List<io.modelcontextprotocol.modern.server.feature.McpAsyncPrompt> modernPrompts(List<Object> promptObjects)
      Since:
      2.1.0
    • modernPrompts

      public static List<io.modelcontextprotocol.modern.server.feature.McpAsyncPrompt> modernPrompts(List<Object> promptObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      Parameters:
      jsonMapper - the server's mapper, used for converting MRTR input responses, or null for the SDK default
      Since:
      2.1.0
    • modernPrompts

      public static List<io.modelcontextprotocol.modern.server.feature.McpAsyncPrompt> modernPrompts(List<Object> promptObjects, List<Object> completeObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      The prompts of the @McpPrompt methods, each with the completion handler of the @McpComplete(prompt = ...) method that names it.
      Parameters:
      completeObjects - the beans with @McpComplete methods
      jsonMapper - the server's mapper, used for converting MRTR input responses, or null for the SDK default
      Throws:
      IllegalStateException - if a @McpComplete method names a prompt that no @McpPrompt method defines
      Since:
      2.1.0
    • modernResources

      public static List<AsyncResourceRegistration> modernResources(List<Object> resourceObjects)
      Since:
      2.1.0
    • modernResources

      public static List<AsyncResourceRegistration> modernResources(List<Object> resourceObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      Parameters:
      jsonMapper - the server's mapper, used for converting MRTR input responses, or null for the SDK default
      Since:
      2.1.0
    • modernResourceTemplates

      public static List<AsyncResourceTemplateRegistration> modernResourceTemplates(List<Object> resourceObjects)
      Since:
      2.1.0
    • modernResourceTemplates

      public static List<AsyncResourceTemplateRegistration> modernResourceTemplates(List<Object> resourceObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      Parameters:
      jsonMapper - the server's mapper, used for converting MRTR input responses, or null for the SDK default
      Since:
      2.1.0
    • modernResourceTemplates

      public static List<AsyncResourceTemplateRegistration> modernResourceTemplates(List<Object> resourceObjects, List<Object> completeObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper)
      The resource templates of the @McpResource methods, each with the completion handler of the @McpComplete(uri = ...) method that names its URI template.
      Parameters:
      completeObjects - the beans with @McpComplete methods
      jsonMapper - the server's mapper, used for converting MRTR input responses, or null for the SDK default
      Throws:
      IllegalStateException - if a @McpComplete method names a URI that no @McpResource template defines, such as the URI of a static resource
      Since:
      2.1.0
    • completeSpecifications

      public static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncCompletionSpecification> completeSpecifications(List<Object> completeObjects)
    • statelessCompleteSpecifications

      public static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncCompletionSpecification> statelessCompleteSpecifications(List<Object> completeObjects)
    • promptSpecifications

      public static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncPromptSpecification> promptSpecifications(List<Object> promptObjects)
    • statelessPromptSpecifications

      public static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncPromptSpecification> statelessPromptSpecifications(List<Object> promptObjects)
    • resourceSpecifications

      public static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceSpecification> resourceSpecifications(List<Object> resourceObjects)
    • statelessResourceSpecifications

      public static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncResourceSpecification> statelessResourceSpecifications(List<Object> resourceObjects)
    • resourceTemplateSpecifications

      public static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceTemplateSpecification> resourceTemplateSpecifications(List<Object> resourceObjects)
    • statelessResourceTemplateSpecifications

      public static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncResourceTemplateSpecification> statelessResourceTemplateSpecifications(List<Object> resourceObjects)
    • resourceListChangedSpecifications

      public static List<AsyncResourceListChangedSpecification> resourceListChangedSpecifications(List<Object> resourceListChangedObjects)
    • resourceListChangedProvider

      public static AsyncMcpResourceListChangedProvider resourceListChangedProvider(List<Object> resourceListChangedObjects)
      The provider of the resource list changed handlers of the given objects. One provider creates the handlers for the legacy clients and those for the clients of the 2026-07-28 ("modern") MCP revision from the same callbacks.
      Parameters:
      resourceListChangedObjects - the objects with the @McpResourceListChanged methods
      Returns:
      the resource list changed provider
      Since:
      2.1.0
    • toolListChangedSpecifications

      public static List<AsyncToolListChangedSpecification> toolListChangedSpecifications(List<Object> toolListChangedObjects)
    • toolListChangedProvider

      public static AsyncMcpToolListChangedProvider toolListChangedProvider(List<Object> toolListChangedObjects)
      The provider of the tool list changed handlers of the given objects. One provider creates the handlers for the legacy clients and those for the clients of the 2026-07-28 ("modern") MCP revision from the same callbacks.
      Parameters:
      toolListChangedObjects - the objects with the @McpToolListChanged methods
      Returns:
      the tool list changed provider
      Since:
      2.1.0
    • promptListChangedSpecifications

      public static List<AsyncPromptListChangedSpecification> promptListChangedSpecifications(List<Object> promptListChangedObjects)
    • promptListChangedProvider

      public static AsyncMcpPromptListChangedProvider promptListChangedProvider(List<Object> promptListChangedObjects)
      The provider of the prompt list changed handlers of the given objects. One provider creates the handlers for the legacy clients and those for the clients of the 2026-07-28 ("modern") MCP revision from the same callbacks.
      Parameters:
      promptListChangedObjects - the objects with the @McpPromptListChanged methods
      Returns:
      the prompt list changed provider
      Since:
      2.1.0