go-sdk v1.4.0 upgrade + protocol constant consolidation + HTTPTransport removal#1598
Merged
go-sdk v1.4.0 upgrade + protocol constant consolidation + HTTPTransport removal#1598
Conversation
…nt, remove HTTPTransport dead code Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update Go SDK to version 1.4.0
go-sdk v1.4.0 upgrade + protocol constant consolidation + HTTPTransport removal
Mar 5, 2026
This was referenced Mar 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades github.com/modelcontextprotocol/go-sdk to v1.4.0, centralizes MCP protocol version usage, and removes an unused HTTP transport implementation to align with recent module review recommendations.
Changes:
- Bump
go-sdkdependency from v1.3.1 to v1.4.0 (and related indirect deps). - Replace hardcoded initialization values with shared constants/
version.Get()in HTTP session initialization. - Remove dead
HTTPTransportimplementation and its tests.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/server/unified.go | References a single source of truth for the MCP protocol version. |
| internal/server/transport.go | Removes unused HTTPTransport implementation. |
| internal/server/transport_test.go | Deletes tests that only validated the removed dead transport. |
| internal/mcp/http_transport.go | Introduces shared MCPProtocolVersion constant and uses version.Get() in clientInfo. |
| go.mod | Upgrades go-sdk and related indirect dependencies. |
| go.sum | Updates checksums for upgraded dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the go-fan module review recommendations for
modelcontextprotocol/go-sdk: upgrade to v1.4.0, fix two hardcoded values ininitializeHTTPSession, and remove dead code.Changes
Upgrade
go-sdkv1.3.1 → v1.4.0 — picks up bug fixes, full sampling-with-tools support (2025-11-05 spec), and experimental client-side OAuth infrastructureFix hardcoded
clientInfo.versionininitializeHTTPSession— was"1.0.0", nowversion.Get()to match the rest of the codebaseConsolidate
MCPProtocolVersionconstant — moved frominternal/server/unified.gotointernal/mcp/http_transport.go(where it's actually used in initialization);servernow referencesmcp.MCPProtocolVersionfor a single source of truthRemove
HTTPTransportdead code frominternal/server/transport.go— no-op struct implementingsdk.Transportthat was never referenced in production; actual HTTP serving usessdk.NewStreamableHTTPHandlerWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/tmp/go-build3616839411/b297/launcher.test /tmp/go-build3616839411/b297/launcher.test -test.testlogfile=/tmp/go-build3616839411/b297/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true in.so /lto-wrapper rgo/bin/git(dns block)/tmp/go-build1213122719/b301/launcher.test /tmp/go-build1213122719/b301/launcher.test -test.testlogfile=/tmp/go-build1213122719/b301/testlog.txt -test.paniconexit0 -test.timeout=10m0s /home/REDACTED/.cache/go-build/b2/b2adc7ce0f112d7ee8c06bf864110bc00ea771823cd463eb71d47e27f9a4a316-d B4CU0D_pf .cfg 64/pkg/tool/linux_amd64/compile --gdwarf-5 --64 -o 64/pkg/tool/linux_amd64/compile -W g_.a aw-mcpg/internal/auth/header_test.go ache/go/1.25.7/x64/pkg/tool/linux_amd64/vet . 939512/b253/ --64 ache/go/1.25.7/x-buildtags(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build3616839411/b279/config.test /tmp/go-build3616839411/b279/config.test -test.testlogfile=/tmp/go-build3616839411/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true ternal/fips140/s-I r p/bin/git(dns block)/tmp/go-build1213122719/b283/config.test /tmp/go-build1213122719/b283/config.test -test.testlogfile=/tmp/go-build1213122719/b283/testlog.txt -test.paniconexit0 -test.timeout=10m0s 9395�� g_.a -trimpath 64/pkg/tool/linux_amd64/vet -I fips140/nistec/f-unsafeptr=false -I 64/pkg/tool/linux_amd64/vet 64/s�� ZfDYF9aua .cfg ache/go/1.25.7/x64/pkg/tool/linux_amd64/compile --gdwarf-5 --64 -o ache/go/1.25.7/x64/pkg/tool/linux_amd64/compile(dns block)nonexistent.local/tmp/go-build3616839411/b297/launcher.test /tmp/go-build3616839411/b297/launcher.test -test.testlogfile=/tmp/go-build3616839411/b297/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true in.so /lto-wrapper rgo/bin/git(dns block)/tmp/go-build1213122719/b301/launcher.test /tmp/go-build1213122719/b301/launcher.test -test.testlogfile=/tmp/go-build1213122719/b301/testlog.txt -test.paniconexit0 -test.timeout=10m0s /home/REDACTED/.cache/go-build/b2/b2adc7ce0f112d7ee8c06bf864110bc00ea771823cd463eb71d47e27f9a4a316-d B4CU0D_pf .cfg 64/pkg/tool/linux_amd64/compile --gdwarf-5 --64 -o 64/pkg/tool/linux_amd64/compile -W g_.a aw-mcpg/internal/auth/header_test.go ache/go/1.25.7/x64/pkg/tool/linux_amd64/vet . 939512/b253/ --64 ache/go/1.25.7/x-buildtags(dns block)slow.example.com/tmp/go-build3616839411/b297/launcher.test /tmp/go-build3616839411/b297/launcher.test -test.testlogfile=/tmp/go-build3616839411/b297/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true in.so /lto-wrapper rgo/bin/git(dns block)/tmp/go-build1213122719/b301/launcher.test /tmp/go-build1213122719/b301/launcher.test -test.testlogfile=/tmp/go-build1213122719/b301/testlog.txt -test.paniconexit0 -test.timeout=10m0s /home/REDACTED/.cache/go-build/b2/b2adc7ce0f112d7ee8c06bf864110bc00ea771823cd463eb71d47e27f9a4a316-d B4CU0D_pf .cfg 64/pkg/tool/linux_amd64/compile --gdwarf-5 --64 -o 64/pkg/tool/linux_amd64/compile -W g_.a aw-mcpg/internal/auth/header_test.go ache/go/1.25.7/x64/pkg/tool/linux_amd64/vet . 939512/b253/ --64 ache/go/1.25.7/x-buildtags(dns block)this-host-does-not-exist-12345.com/tmp/go-build3616839411/b306/mcp.test /tmp/go-build3616839411/b306/mcp.test -test.testlogfile=/tmp/go-build3616839411/b306/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo dPaLDQkT6 64/pkg/tool/linux_amd64/compile pull.rebase(dns block)/tmp/go-build1213122719/b310/mcp.test /tmp/go-build1213122719/b310/mcp.test -test.testlogfile=/tmp/go-build1213122719/b310/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cgo�� /middleware/jqschema.go /middleware/jqschema_bench_test.go ache/go/1.25.7/x64/pkg/tool/linux_amd64/vet 939512/b100/ 939512/b224/ /tmp/go-build791939512/b100/ ache/go/1.25.7/x64/pkg/tool/linu-buildtags(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>[go-fan] Go Module Review: modelcontextprotocol/go-sdk</issue_title>
<issue_description># 🐹 Go Fan Report: modelcontextprotocol/go-sdk
Module Overview
github.com/modelcontextprotocol/go-sdkis the official Go SDK for the Model Context Protocol. It provides client and server implementations, all transport layers (stdio, streamable HTTP, SSE), and the complete set of MCP protocol types. This is the single most critical dependency in the project — it is the foundation on which the entire gateway is built.Current Usage in gh-aw
The project is currently on v1.3.1; the latest is v1.4.0 (released 2026-02-27).
sdk "github.com/modelcontextprotocol/go-sdk/mcp")sdk.NewClient/sdk.Client/sdk.ClientSession— backend connectionssdk.NewServer/sdk.Server— serving MCP to clientssdk.CommandTransport— stdio (Docker container launches)sdk.StreamableClientTransport/sdk.SSEClientTransport— HTTP client transportssdk.NewStreamableHTTPHandler/sdk.StreamableHTTPOptions— HTTP serversdk.NewInMemoryTransports— unit test infrastructuresdk.Implementation,sdk.ClientOptions,sdk.ServerOptions— identity/configTool,Resource,Content,TextContent,CallToolRequest,CallToolResult, etc.Research Findings
Recent Updates (v1.3.1 → v1.4.0)
Released 2026-02-27 — the most recently updated dependency in the project's entire dependency tree.
mcp_go_client_oauthbuild tag):OAuthHandlerinterface integrated intoStreamableClientTransportauth.AuthorizationCodeHandlerimplements full OAuth 2.0authorization_codeflow per MCP spec §AuthorizationAuthorizationCodeFetchercallback for browser-redirect flowsOAuthHandlerLegacytype (from a previous iteration), which the project does not use.Best Practices
Server.AddTool(method version, not function) is correctly used to skip schema validation for backends with non-standard JSON Schema — this is the right call.logger.NewSlogLoggerWithHandler) is the recommended pattern per SDK docs.sdk.NewInMemoryTransportsfor unit tests is the SDK's recommended in-process test approach.Improvement Opportunities
🏃 Quick Wins
1. Upgrade to v1.4.0
The project is one minor version behind. v1.4.0 has no breaking changes (outside experimental OAuth API not currently used) and includes bug fixes:
2. Use
version.Get()ininitializeHTTPSessionclientInfoIn
internal/mcp/http_transport.go:383, the clientInfo version is hardcoded as"1.0.0"whilenewMCPClient()(in the same file) correctly usesversion.Get(). These should be consistent:✨ Feature Opportunities
3. Client-side OAuth for HTTP Backends (v1.4.0)
Currently, any HTTP backend with custom headers (auth) is forced to use the plain JSON-RPC transport path — the SDK's
StreamableClientTransportis bypassed entirely because it didn't support custom headers. The v1.4.0OAuthHandlerinterface provides a proper solution:StreamableClientTransport.OAuthHandlerfield can provide anoauth2.TokenSourcefor Bearer tokensOAuthHandler.Authorize()can re-run the OAuth flowThe current behavior (plain JSON-RPC for custom-header backends) works fine but limits those backends to the less-capable transport.
4. Sampling with Tools (v1.4.0)
The 2025-11-25 spec's sampling capability (LLM completion requests from server → client) is now fully supported. If the gateway's role expands to proxying sampling requests from backend MCP servers to LLM-capable clients, the foundation is now in place.
📐 Best Practice Alignment
5. Remove or document
HTTPTransportdead codeinternal/server/transport.go(lines 16–44) defines anHTTPTransportstruct implementingsdk.Transport...💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.