From 6afcb24b553e56e66d26d1e6a193176deabe0fe0 Mon Sep 17 00:00:00 2001 From: Haihua Xiao Date: Wed, 30 Apr 2025 14:16:00 +0800 Subject: [PATCH] Add Accept header set Accept header to application/json, text/event-stream --- client/transport/streamable_http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/transport/streamable_http.go b/client/transport/streamable_http.go index 0e771c51..c0a784ff 100644 --- a/client/transport/streamable_http.go +++ b/client/transport/streamable_http.go @@ -356,6 +356,7 @@ func (c *StreamableHTTP) SendNotification(ctx context.Context, notification mcp. // Set headers req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "application/json, text/event-stream") if sessionID := c.sessionID.Load(); sessionID != "" { req.Header.Set(headerKeySessionID, sessionID.(string)) }