类的使用
io.agentscope.core.tool.mcp.McpClientBuilder
使用McpClientBuilder的程序包
-
io.agentscope.core.tool.mcp中McpClientBuilder的使用
修饰符和类型方法说明McpClientBuilder.asyncElicitation(Function<io.modelcontextprotocol.spec.McpSchema.ElicitRequest, reactor.core.publisher.Mono<io.modelcontextprotocol.spec.McpSchema.ElicitResult>> handler) Registers an asynchronous elicitation handler for processing elicit requests from the server.static McpClientBuilderCreates a new MCP client builder with the specified name.McpClientBuilder.customizeSseClient(Consumer<HttpClient.Builder> customizer) Customizes the HTTP client for SSE transport (only applicable after calling sseTransport).McpClientBuilder.customizeStreamableHttpClient(Consumer<HttpClient.Builder> customizer) Customizes the HTTP client for StreamableHTTP transport (only applicable after calling streamableHttpTransport).Adds an HTTP header (only applicable for HTTP transports).Sets multiple HTTP headers (only applicable for HTTP transports).McpClientBuilder.initializationTimeout(Duration timeout) Sets the initialization timeout duration.McpClientBuilder.queryParam(String key, String value) Adds a query parameter to the URL (only applicable for HTTP transports).McpClientBuilder.queryParams(Map<String, String> queryParams) Sets multiple query parameters (only applicable for HTTP transports).McpClientBuilder.sseTransport(String url) Configures HTTP SSE (Server-Sent Events) transport for stateful connections.McpClientBuilder.stdioTransport(String command, String... args) Configures StdIO transport for local process communication.Configures StdIO transport with environment variables.McpClientBuilder.streamableHttpTransport(String url) Configures HTTP StreamableHTTP transport for stateless connections.McpClientBuilder.syncElicitation(Function<io.modelcontextprotocol.spec.McpSchema.ElicitRequest, io.modelcontextprotocol.spec.McpSchema.ElicitResult> handler) Registers a synchronous elicitation handler for processing elicit requests from the server.Sets the request timeout duration.