Class AsyncMcpAnnotationProviders
java.lang.Object
org.springframework.ai.mcp.annotation.spring.AsyncMcpAnnotationProviders
- Author:
- Christian Tzolov
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<io.modelcontextprotocol.server.McpServerFeatures.AsyncCompletionSpecification>completeSpecifications(List<Object> completeObjects) static AsyncMcpElicitationProviderelicitationProvider(List<Object> elicitationObjects) The provider of the elicitation handlers of the given objects.static List<AsyncElicitationSpecification>elicitationSpecifications(List<Object> elicitationObjects) static List<AsyncLoggingSpecification>loggingSpecifications(List<Object> loggingObjects) static List<io.modelcontextprotocol.modern.server.feature.McpAsyncPrompt>modernPrompts(List<Object> promptObjects) static List<io.modelcontextprotocol.modern.server.feature.McpAsyncPrompt>modernPrompts(List<Object> promptObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper) 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@McpPromptmethods, each with the completion handler of the@McpComplete(prompt = ...)method that names it.static List<AsyncResourceRegistration>modernResources(List<Object> resourceObjects) static List<AsyncResourceRegistration>modernResources(List<Object> resourceObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper) modernResourceTemplates(List<Object> resourceObjects) modernResourceTemplates(List<Object> resourceObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper) modernResourceTemplates(List<Object> resourceObjects, List<Object> completeObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper) The resource templates of the@McpResourcemethods, each with the completion handler of the@McpComplete(uri = ...)method that names its URI template.static List<io.modelcontextprotocol.modern.server.feature.McpAsyncTool>modernTools(List<Object> toolObjects) static List<io.modelcontextprotocol.modern.server.feature.McpAsyncTool>modernTools(List<Object> toolObjects, @Nullable io.modelcontextprotocol.json.McpJsonMapper jsonMapper) static AsyncMcpProgressProviderprogressProvider(List<Object> progressObjects) The provider of the progress handlers of the given objects.static List<AsyncProgressSpecification>progressSpecifications(List<Object> progressObjects) promptListChangedProvider(List<Object> promptListChangedObjects) The provider of the prompt list changed handlers of the given objects.promptListChangedSpecifications(List<Object> promptListChangedObjects) static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncPromptSpecification>promptSpecifications(List<Object> promptObjects) resourceListChangedProvider(List<Object> resourceListChangedObjects) The provider of the resource list changed handlers of the given objects.resourceListChangedSpecifications(List<Object> resourceListChangedObjects) static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceSpecification>resourceSpecifications(List<Object> resourceObjects) static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncResourceTemplateSpecification>resourceTemplateSpecifications(List<Object> resourceObjects) static List<AsyncSamplingSpecification>samplingSpecifications(List<Object> samplingObjects) static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncCompletionSpecification>statelessCompleteSpecifications(List<Object> completeObjects) static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncPromptSpecification>statelessPromptSpecifications(List<Object> promptObjects) static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncResourceSpecification>statelessResourceSpecifications(List<Object> resourceObjects) static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncResourceTemplateSpecification>statelessResourceTemplateSpecifications(List<Object> resourceObjects) static List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncToolSpecification>statelessToolSpecifications(List<Object> toolObjects) toolListChangedProvider(List<Object> toolListChangedObjects) The provider of the tool list changed handlers of the given objects.toolListChangedSpecifications(List<Object> toolListChangedObjects) static List<io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification>toolSpecifications(List<Object> toolObjects)
-
Method Details
-
loggingSpecifications
-
samplingSpecifications
-
elicitationSpecifications
public static List<AsyncElicitationSpecification> elicitationSpecifications(List<Object> elicitationObjects) -
progressSpecifications
-
elicitationProvider
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@McpElicitationmethods- Returns:
- the elicitation provider
- Since:
- 2.1.0
-
progressProvider
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@McpProgressmethods- Returns:
- the progress provider
- Since:
- 2.1.0
-
toolSpecifications
-
statelessToolSpecifications
-
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, ornullfor 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, ornullfor 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@McpPromptmethods, each with the completion handler of the@McpComplete(prompt = ...)method that names it.- Parameters:
completeObjects- the beans with@McpCompletemethodsjsonMapper- the server's mapper, used for converting MRTR input responses, ornullfor the SDK default- Throws:
IllegalStateException- if a@McpCompletemethod names a prompt that no@McpPromptmethod defines- Since:
- 2.1.0
-
modernResources
- 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, ornullfor 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, ornullfor 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@McpResourcemethods, each with the completion handler of the@McpComplete(uri = ...)method that names its URI template.- Parameters:
completeObjects- the beans with@McpCompletemethodsjsonMapper- the server's mapper, used for converting MRTR input responses, ornullfor the SDK default- Throws:
IllegalStateException- if a@McpCompletemethod names a URI that no@McpResourcetemplate defines, such as the URI of a static resource- Since:
- 2.1.0
-
completeSpecifications
-
statelessCompleteSpecifications
-
promptSpecifications
-
statelessPromptSpecifications
-
resourceSpecifications
-
statelessResourceSpecifications
-
resourceTemplateSpecifications
-
statelessResourceTemplateSpecifications
-
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@McpResourceListChangedmethods- 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@McpToolListChangedmethods- 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@McpPromptListChangedmethods- Returns:
- the prompt list changed provider
- Since:
- 2.1.0
-