Annotation Interface McpLogging
Annotation for methods that handle logging message notifications from MCP servers. This
annotation is applicable only for MCP clients.
Methods annotated with this annotation can be used to consume logging messages from MCP servers. The methods can have one of two signatures:
- A single parameter of type
LoggingMessageNotification - Three parameters of types
LoggingLevel,String(logger), andString(data)
For synchronous consumers, the method must have a void return type. For asynchronous
consumers, the method can have either a void return type or return Mono<Void>.
Example usage:
@McpLogging
public void handleLoggingMessage(LoggingMessageNotification notification) {
// Handle the notification
}
@McpLogging
public void handleLoggingMessageWithParams(LoggingLevel level, String logger, String data) {
// Handle the logging message
}
- Author:
- Christian Tzolov
- See Also:
-
McpSchema.LoggingMessageNotificationMcpSchema.LoggingLevel
-
Required Element Summary
Required Elements
-
Element Details
-
clients
String[] clientsUsed as connection or clients identifier to select the MCP clients, the logging consumer is associated with. At least one client identifier must be specified.
-