Interface McpServerRequestHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback invoked by
McpDuplexDispatcher to handle a single server-initiated JSON-RPC request
delivered over an MCP client's duplex event-stream channel (for example sampling/createMessage;
illustrative only, as sampling is deprecated per SEP-2577).- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionhandle(JsonRpcRequest request, BeanStore ctx) Handles a single server-initiated request.
-
Method Details
-
handle
Handles a single server-initiated request.- Parameters:
request- The inbound request, with itsparamsleft as the generic, revision-neutral wire representation. Nevernull .ctx- The request-scoped bean store. Nevernull .- Returns:
- The result to return to the server, marshaled as the
resultof the JSON-RPC responseMcpDuplexDispatcherposts back. Can benull . - Throws:
Exception- If handling fails. AnMcpExceptionthrown here propagates to the caller as-is; any other exception is wrapped byMcpDuplexDispatcher.dispatch(JsonRpcRequest, BeanStore)as a-32603internal-errorMcpException.
-