Class AsyncModernMcpCompleteProvider
java.lang.Object
org.springframework.ai.mcp.annotation.provider.complete.AsyncModernMcpCompleteProvider
The asynchronous twin of
SyncModernMcpCompleteProvider: creates the completion
handlers of a 2026-07-28 ("modern") MCP server from methods annotated with
McpComplete. Each method is served by an
AsyncModernMcpCompleteMethodCallback.
A handler completes every argument of the prompt or resource template that its
annotation names, and answers only once it is attached to that prompt or template with
McpAsyncPrompt.withCompletionHandler or
AsyncResourceTemplateRegistration.withCompletionHandler. The Spring entry
points attach them to the annotated prompts and templates.
- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Method[]doGetClassMethods(Object bean) The handlers of the@McpComplete(prompt = ...)methods, keyed by prompt name.The handlers of the@McpComplete(uri = ...)methods, keyed by URI template.
-
Constructor Details
-
AsyncModernMcpCompleteProvider
-
-
Method Details
-
getPromptCompletions
public Map<String,io.modelcontextprotocol.modern.server.feature.McpAsyncCompletionHandler> getPromptCompletions()The handlers of the@McpComplete(prompt = ...)methods, keyed by prompt name.- Throws:
IllegalArgumentException- if two methods complete the same prompt
-
getResourceCompletions
public Map<String,io.modelcontextprotocol.modern.server.feature.McpAsyncCompletionHandler> getResourceCompletions()The handlers of the@McpComplete(uri = ...)methods, keyed by URI template.- Throws:
IllegalArgumentException- if two methods complete the same URI template
-
doGetClassMethods
-