Class McpRequiredCapabilities

java.lang.Object
org.springframework.ai.mcp.annotation.common.McpRequiredCapabilities

public final class McpRequiredCapabilities extends Object
Helper for the requiredCapabilities attribute of @McpTool, @McpPrompt and @McpResource, which only the 2026-07-28 ("modern") MCP server enforces.
Since:
2.1.0
Author:
Christian Tzolov
  • Method Details

    • warnIfIgnored

      public static void warnIfIgnored(Method method, String annotation, McpClientCapability[] required)
      Logs a warning when a method served by a legacy (pre 2026-07-28) server declares required client capabilities, because the legacy servers check the capabilities the client sent at initialization and the attribute is silently dropped.
      Parameters:
      method - the annotated method
      annotation - the simple name of the annotation, for the message
      required - the annotation's requiredCapabilities