Skip to content

feat: support sse customize httpClient #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/transport/sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func WithHeaders(headers map[string]string) ClientOption {
}
}

func WithHttpClient(httpClient *http.Client) ClientOption {
return func(sc *SSE) {
sc.httpClient = httpClient
}
}

// NewSSE creates a new SSE-based MCP client with the given base URL.
// Returns an error if the URL is invalid.
func NewSSE(baseURL string, options ...ClientOption) (*SSE, error) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/mark3labs/mcp-go

go 1.23
go 1.23.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Note on Go version specificity

Specifying the patch version (1.23.0) is more precise than just the minor version (1.23). However, ensure that this version aligns with your deployment targets, as Go 1.23 would be a future release as of April 2024.


🌐 Web query:

What is the latest stable version of Go currently available?

💡 Result:

Latest Stable Version of Go

The latest stable version of the Go programming language currently available is Go 1.24.2, which was released on April 1, 2025[1][9]. This version includes security and bug fixes for several packages including net/http, crypto/tls, go/types, and others[1].

Go 1.24 is a major release, introducing notable changes such as full support for generic type aliases and several performance improvements in the runtime and toolchain[2][7]. The 1.24.2 release is the most recent minor revision, providing important security updates and bug fixes to ensure stability and security for developers[1][9].

Citations:


Upgrade Go version in go.mod to the latest stable release

The go.mod file currently specifies:

  • File: go.mod
    Line 3: go 1.23.0

As of April 2025, Go 1.24.2 is the latest stable release, which includes important security patches and performance improvements. Please update the Go version directive to align with supported deployment targets:

--- go.mod
@@ line 3
- go 1.23.0
+ go 1.24.2
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
go 1.23.0
go 1.24.2


require (
github.com/google/uuid v1.6.0
Expand Down