| Package | Description |
|---|---|
| io.modelcontextprotocol.client |
| Modifier and Type | Method and Description |
|---|---|
McpClient.SyncSpec |
McpClient.SyncSpec.capabilities(McpSchema.ClientCapabilities capabilities)
Sets the client capabilities that will be advertised to the server during
connection initialization.
|
McpClient.SyncSpec |
McpClient.SyncSpec.clientInfo(McpSchema.Implementation clientInfo)
Sets the client implementation information that will be shared with the server
during connection initialization.
|
McpClient.SyncSpec |
McpClient.SyncSpec.initializationTimeout(Duration initializationTimeout) |
McpClient.SyncSpec |
McpClient.SyncSpec.loggingConsumer(Consumer<McpSchema.LoggingMessageNotification> loggingConsumer)
Adds a consumer to be notified when logging messages are received from the
server.
|
McpClient.SyncSpec |
McpClient.SyncSpec.loggingConsumers(List<Consumer<McpSchema.LoggingMessageNotification>> loggingConsumers)
Adds multiple consumers to be notified when logging messages are received from
the server.
|
McpClient.SyncSpec |
McpClient.SyncSpec.promptsChangeConsumer(Consumer<List<McpSchema.Prompt>> promptsChangeConsumer)
Adds a consumer to be notified when the available prompts change.
|
McpClient.SyncSpec |
McpClient.SyncSpec.requestTimeout(Duration requestTimeout)
Sets the duration to wait for server responses before timing out requests.
|
McpClient.SyncSpec |
McpClient.SyncSpec.resourcesChangeConsumer(Consumer<List<McpSchema.Resource>> resourcesChangeConsumer)
Adds a consumer to be notified when the available resources change.
|
McpClient.SyncSpec |
McpClient.SyncSpec.roots(List<McpSchema.Root> roots)
Sets the root URIs that this client can access.
|
McpClient.SyncSpec |
McpClient.SyncSpec.roots(McpSchema.Root... roots)
Sets the root URIs that this client can access, using a varargs parameter for
convenience.
|
McpClient.SyncSpec |
McpClient.SyncSpec.sampling(Function<McpSchema.CreateMessageRequest,McpSchema.CreateMessageResult> samplingHandler)
Sets a custom sampling handler for processing message creation requests.
|
static McpClient.SyncSpec |
McpClient.sync(McpClientTransport transport)
Start building a synchronous MCP client with the specified transport layer.
|
McpClient.SyncSpec |
McpClient.SyncSpec.toolsChangeConsumer(Consumer<List<McpSchema.Tool>> toolsChangeConsumer)
Adds a consumer to be notified when the available tools change.
|
McpClient.SyncSpec |
McpClient.SyncSpec.withConnectOnInit(boolean connectOnInit)
Sets whether to connect to the server during the initialization phase (open an
SSE stream).
|
Copyright © 2025. All rights reserved.