Class SyncModernMcpCompleteProvider

java.lang.Object
org.springframework.ai.mcp.annotation.provider.complete.SyncModernMcpCompleteProvider

public class SyncModernMcpCompleteProvider extends Object
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 Details

    • SyncModernMcpCompleteProvider

      public SyncModernMcpCompleteProvider(List<Object> completeObjects)
  • 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

      protected Method[] doGetClassMethods(Object bean)