类的使用
io.agentscope.core.tool.mcp.McpClientBuilder
使用McpClientBuilder的程序包
-
io.agentscope.core.tool.mcp中McpClientBuilder的使用
修饰符和类型方法说明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.Sets the request timeout duration.