public class MissingMcpTransportSession extends Object implements McpLoggableSession
McpLoggableSession which represents a missing stream that would allow the
server to communicate with the client. Specifically, it can be used when a Streamable
HTTP client has not opened a listening SSE stream to accept messages for interactions
unrelated with concurrently running client-initiated requests.| Constructor and Description |
|---|
MissingMcpTransportSession(String sessionId)
Create an instance with the Session ID specified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the session and releases any associated resources.
|
reactor.core.publisher.Mono<Void> |
closeGracefully()
Closes the session and releases any associated resources asynchronously.
|
boolean |
isNotificationForLevelAllowed(McpSchema.LoggingLevel loggingLevel)
Allows checking whether a particular logging level is allowed.
|
reactor.core.publisher.Mono<Void> |
sendNotification(String method,
Object params)
Sends a notification to the model client or server with parameters.
|
<T> reactor.core.publisher.Mono<T> |
sendRequest(String method,
Object requestParams,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
Sends a request to the model counterparty and expects a response of type T.
|
void |
setMinLoggingLevel(McpSchema.LoggingLevel minLoggingLevel)
Set the minimum logging level for the client.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendNotificationpublic MissingMcpTransportSession(String sessionId)
sessionId - session IDpublic <T> reactor.core.publisher.Mono<T> sendRequest(String method, Object requestParams, com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
McpSessionThis method handles the request-response pattern where a response is expected from the client or server. The response type is determined by the provided TypeReference.
sendRequest in interface McpSessionT - the type of the expected responsemethod - the name of the method to be called on the counterpartyrequestParams - the parameters to be sent with the requesttypeRef - the TypeReference describing the expected response typepublic reactor.core.publisher.Mono<Void> sendNotification(String method, Object params)
McpSession
Similar to McpSession.sendNotification(String) but allows sending additional
parameters with the notification.
sendNotification in interface McpSessionmethod - the name of the notification method to be sent to the counterpartyparams - parameters to be sent with the notificationpublic reactor.core.publisher.Mono<Void> closeGracefully()
McpSessioncloseGracefully in interface McpSessionMono that completes when the session has been closed.public void close()
McpSessionclose in interface McpSessionpublic void setMinLoggingLevel(McpSchema.LoggingLevel minLoggingLevel)
McpLoggableSessionsetMinLoggingLevel in interface McpLoggableSessionminLoggingLevel - The minimum logging levelpublic boolean isNotificationForLevelAllowed(McpSchema.LoggingLevel loggingLevel)
McpLoggableSessionisNotificationForLevelAllowed in interface McpLoggableSessionloggingLevel - the level to checkCopyright © 2025. All rights reserved.