Class McpRequiredCapabilities
java.lang.Object
org.springframework.ai.mcp.annotation.common.McpRequiredCapabilities
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 Summary
Modifier and TypeMethodDescriptionstatic voidwarnIfIgnored(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.
-
Method Details
-
warnIfIgnored
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 methodannotation- the simple name of the annotation, for the messagerequired- the annotation'srequiredCapabilities
-