Class SyncModernMcpCompleteProvider
java.lang.Object
org.springframework.ai.mcp.annotation.provider.complete.SyncModernMcpCompleteProvider
Creates the completion handlers of a 2026-07-28 ("modern") MCP server from methods
annotated with
McpComplete. Each method is served by a
SyncModernMcpCompleteMethodCallback.
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
McpSyncPrompt.withCompletionHandler or
SyncResourceTemplateRegistration.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
-
SyncModernMcpCompleteProvider
-
-
Method Details
-
getPromptCompletions
public Map<String,io.modelcontextprotocol.modern.server.feature.McpSyncCompletionHandler> 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.McpSyncCompletionHandler> getResourceCompletions()The handlers of the@McpComplete(uri = ...)methods, keyed by URI template.- Throws:
IllegalArgumentException- if two methods complete the same URI template
-
doGetClassMethods
-