From 807d5b745eeb31afe4914c6d9f029c2498d5b146 Mon Sep 17 00:00:00 2001 From: Liu Shuang Date: Thu, 10 Apr 2025 14:40:36 +0800 Subject: [PATCH] feat: add WithHTTPClient option for SSEMCPClient configuration --- client/sse.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/sse.go b/client/sse.go index cf4a1028..ec10f29b 100644 --- a/client/sse.go +++ b/client/sse.go @@ -53,6 +53,12 @@ func WithSSEReadTimeout(timeout time.Duration) ClientOption { } } +func WithHTTPClient(client *http.Client) ClientOption { + return func(sc *SSEMCPClient) { + sc.httpClient = client + } +} + // NewSSEMCPClient creates a new SSE-based MCP client with the given base URL. // Returns an error if the URL is invalid. func NewSSEMCPClient(baseURL string, options ...ClientOption) (*SSEMCPClient, error) {