public class McpSyncServerExchange extends Object
| Constructor and Description |
|---|
McpSyncServerExchange(McpAsyncServerExchange exchange)
Create a new synchronous exchange with the client using the provided asynchronous
implementation as a delegate.
|
| Modifier and Type | Method and Description |
|---|---|
McpSchema.ElicitResult |
createElicitation(McpSchema.ElicitRequest elicitRequest)
Creates a new elicitation.
|
McpSchema.CreateMessageResult |
createMessage(McpSchema.CreateMessageRequest createMessageRequest)
Create a new message using the sampling capabilities of the client.
|
McpSchema.ClientCapabilities |
getClientCapabilities()
Get the client capabilities that define the supported features and functionality.
|
McpSchema.Implementation |
getClientInfo()
Get the client implementation information.
|
McpSchema.ListRootsResult |
listRoots()
Retrieves the list of all roots provided by the client.
|
McpSchema.ListRootsResult |
listRoots(String cursor)
Retrieves a paginated list of roots provided by the client.
|
void |
loggingNotification(McpSchema.LoggingMessageNotification loggingMessageNotification)
Send a logging message notification to the client.
|
Object |
ping()
Sends a synchronous ping request to the client.
|
void |
progressNotification(McpSchema.ProgressNotification progressNotification)
Sends a notification to the client that the current progress status has changed for
long-running operations.
|
String |
sessionId()
Provides the Session ID
|
McpTransportContext |
transportContext()
Provides the
McpTransportContext associated with the transport layer. |
public McpSyncServerExchange(McpAsyncServerExchange exchange)
exchange - The asynchronous exchange to delegate to.public String sessionId()
public McpSchema.ClientCapabilities getClientCapabilities()
public McpSchema.Implementation getClientInfo()
public McpTransportContext transportContext()
McpTransportContext associated with the transport layer. For
HTTP transports it can contain the metadata associated with the HTTP request that
triggered the processing.public McpSchema.CreateMessageResult createMessage(McpSchema.CreateMessageRequest createMessageRequest)
createMessageRequest - The request to create a new messageMcpSchema.CreateMessageRequest,
McpSchema.CreateMessageResult,
Sampling
Specificationpublic McpSchema.ElicitResult createElicitation(McpSchema.ElicitRequest elicitRequest)
elicitRequest - The request to create a new elicitationMcpSchema.ElicitRequest,
McpSchema.ElicitResult,
Elicitation
Specificationpublic McpSchema.ListRootsResult listRoots()
public McpSchema.ListRootsResult listRoots(String cursor)
cursor - Optional pagination cursor from a previous list requestpublic void loggingNotification(McpSchema.LoggingMessageNotification loggingMessageNotification)
loggingMessageNotification - The logging message to sendpublic void progressNotification(McpSchema.ProgressNotification progressNotification)
progressNotification - The progress notification to sendpublic Object ping()
Copyright © 2025. All rights reserved.