Class SyncMcpAnnotationProviders

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

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

    • toolSpecifications

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

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

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

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

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

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

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

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

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

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

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

      public static List<io.modelcontextprotocol.modern.server.feature.McpSyncTool> 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.McpSyncPrompt> modernPrompts(List<Object> promptObjects)
      Since:
      2.1.0
    • modernPrompts

      public static List<io.modelcontextprotocol.modern.server.feature.McpSyncPrompt> 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.McpSyncPrompt> 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<SyncResourceRegistration> modernResources(List<Object> resourceObjects)
      Since:
      2.1.0
    • modernResources

      public static List<SyncResourceRegistration> 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<SyncResourceTemplateRegistration> modernResourceTemplates(List<Object> resourceObjects)
      Since:
      2.1.0
    • modernResourceTemplates

      public static List<SyncResourceTemplateRegistration> 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<SyncResourceTemplateRegistration> 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
    • loggingSpecifications

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

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

      public static List<SyncElicitationSpecification> elicitationSpecifications(List<Object> elicitationObjects)
    • elicitationProvider

      public static SyncMcpElicitationProvider 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
    • progressSpecifications

      public static List<SyncProgressSpecification> progressSpecifications(List<Object> progressObjects)
    • progressProvider

      public static SyncMcpProgressProvider 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
    • toolListChangedSpecifications

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

      public static SyncMcpToolListChangedProvider 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
    • resourceListChangedSpecifications

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

      public static SyncMcpResourceListChangedProvider resourceListChangedProvider(List<Object> resourceListChangedObjects)
      The provider of the resource list changed handlers of the given objects, for the clients of both protocols.
      Parameters:
      resourceListChangedObjects - the objects with the @McpResourceListChanged methods
      Returns:
      the resource list changed provider
      Since:
      2.1.0
    • promptListChangedSpecifications

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

      public static SyncMcpPromptListChangedProvider promptListChangedProvider(List<Object> promptListChangedObjects)
      The provider of the prompt list changed handlers of the given objects, for the clients of both protocols.
      Parameters:
      promptListChangedObjects - the objects with the @McpPromptListChanged methods
      Returns:
      the prompt list changed provider
      Since:
      2.1.0