Skip to content

Upgrade go-sdk to v1.3.0 and adopt ClientOptions pattern#1018

Merged
lpcox merged 3 commits intomainfrom
copilot/update-go-sdk-to-v1-3-0
Feb 17, 2026
Merged

Upgrade go-sdk to v1.3.0 and adopt ClientOptions pattern#1018
lpcox merged 3 commits intomainfrom
copilot/update-go-sdk-to-v1-3-0

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Upgrades MCP SDK dependency from v1.2.0 to v1.3.0 for critical bug fixes and performance improvements. Also adopts explicit ClientOptions pattern for future SDK feature compatibility.

Changes

Dependency Upgrades

  • go-sdk: v1.2.0 → v1.3.0
  • jsonschema-go: v0.3.0 → v0.4.2 (transitive)

Code Changes
Replaced nil ClientOptions with explicit struct initialization:

// Before
client := sdk.NewClient(&sdk.Implementation{
    Name:    "awmg",
    Version: version.Get(),
}, nil)

// After
client := sdk.NewClient(&sdk.Implementation{
    Name:    "awmg",
    Version: version.Get(),
}, &sdk.ClientOptions{})

Affected locations:

  • internal/mcp/connection.go (newMCPClient)
  • internal/testutil/mcptest/validator.go (NewValidatorClient)

Impact

v1.3.0 Bug Fixes

  • Case-insensitive Content-Type/Content-Length header parsing (fixes HTTP backend compatibility)
  • Logging race condition fix
  • Improved SSE transport error propagation

v1.3.0 Performance

  • Schema caching enabled automatically for stateless server scenarios

Code Quality

  • Explicit options pattern enables future capability configuration without API changes

Warning

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
    • Triggering command: /tmp/go-build3332987366/b275/launcher.test /tmp/go-build3332987366/b275/launcher.test -test.testlogfile=/tmp/go-build3332987366/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go pull.rebase 64/pkg/tool/linu-o (dns block)
    • Triggering command: /tmp/go-build1872984022/b275/launcher.test /tmp/go-build1872984022/b275/launcher.test -test.testlogfile=/tmp/go-build1872984022/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true o s.noreply.github.com> x_amd64/compile -p internal/runtime/strconv -lang=go1.25 x_amd64/compile go_.�� 64/src/net ache/go/1.25.7/x64/src/crypto/ds-nolocalimports .12/x64/as -p time -lang=go1.25 02.o (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build3332987366/b260/config.test /tmp/go-build3332987366/b260/config.test -test.testlogfile=/tmp/go-build3332987366/b260/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go user.email 64/pkg/tool/linu-o (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build3332987366/b275/launcher.test /tmp/go-build3332987366/b275/launcher.test -test.testlogfile=/tmp/go-build3332987366/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go pull.rebase 64/pkg/tool/linu-o (dns block)
    • Triggering command: /tmp/go-build1872984022/b275/launcher.test /tmp/go-build1872984022/b275/launcher.test -test.testlogfile=/tmp/go-build1872984022/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true o s.noreply.github.com> x_amd64/compile -p internal/runtime/strconv -lang=go1.25 x_amd64/compile go_.�� 64/src/net ache/go/1.25.7/x64/src/crypto/ds-nolocalimports .12/x64/as -p time -lang=go1.25 02.o (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build3332987366/b275/launcher.test /tmp/go-build3332987366/b275/launcher.test -test.testlogfile=/tmp/go-build3332987366/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go pull.rebase 64/pkg/tool/linu-o (dns block)
    • Triggering command: /tmp/go-build1872984022/b275/launcher.test /tmp/go-build1872984022/b275/launcher.test -test.testlogfile=/tmp/go-build1872984022/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true o s.noreply.github.com> x_amd64/compile -p internal/runtime/strconv -lang=go1.25 x_amd64/compile go_.�� 64/src/net ache/go/1.25.7/x64/src/crypto/ds-nolocalimports .12/x64/as -p time -lang=go1.25 02.o (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build3332987366/b284/mcp.test /tmp/go-build3332987366/b284/mcp.test -test.testlogfile=/tmp/go-build3332987366/b284/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo --global ache/go/1.25.7/x64/pkg/tool/linu--64 pull.rebase (dns block)
    • Triggering command: /tmp/go-build1872984022/b284/mcp.test /tmp/go-build1872984022/b284/mcp.test -test.testlogfile=/tmp/go-build1872984022/b284/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true Y8ao1DxRd s.noreply.github.com> as -I abis -I 2987366/b171/_x005.o go_.�� 64/src/net -trimpath ache/go/1.25.7/x64/pkg/tool/linux_amd64/vet -p crypto/internal/-c -lang=go1.25 02.o (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: go-sdk (v1.3.0 upgrade available)</issue_title>
<issue_description># 🐹 Go Fan Report: modelcontextprotocol/go-sdk

Module Overview

The official Go SDK for Model Context Protocol servers and clients, maintained in collaboration with Google. This is our most critical dependency - it enables awmg to act as an MCP gateway by connecting to backend MCP servers and proxying their capabilities.

Repository: https://github.com/modelcontextprotocol/go-sdk
Current Version: v1.2.0 (released 2025-12-22)
Latest Version: v1.3.0 (released 2026-02-09) ⚡ UPDATE AVAILABLE
Last Updated: 2026-02-16T15:53:09Z (1 day ago!)

Current Usage in gh-aw-mcpg

Scale of Usage

  • Files: 22 files import and use this SDK
  • Import Count: 17 direct SDK API calls in internal/mcp/connection.go alone
  • Key APIs Used:
    • Client/Session: NewClient, Client, ClientSession, Implementation
    • Transports: CommandTransport, StreamableClientTransport, SSEClientTransport
    • MCP Methods: ListTools, CallTool, ListResources, ReadResource, ListPrompts, GetPrompt

Usage Pattern

// Current initialization (2 locations)
client := sdk.NewClient(&sdk.Implementation{
    Name:    "awmg",
    Version: version.Get(),
}, nil)  // ⚠️ Passing nil for options

Transport Strategy:

  • Stdio: CommandTransport for Docker-based MCP servers
  • HTTP Streamable: StreamableClientTransport for 2025-03-26 spec
  • HTTP SSE: SSEClientTransport for 2024-11-05 spec
  • Plain JSON-RPC: Custom implementation for legacy backends

Research Findings

v1.3.0 Release Highlights (2026-02-09)

🚀 Major Enhancements

  1. Schema Caching - Significant performance boost for stateless server deployments (avoids repeated reflection)
  2. DisableListening Option - New option for StreamableClientTransport to better control connection lifecycle
  3. Improved Logger API - Logger now configured via ClientOption (old API deprecated gracefully)
  4. Better Error Export - GetError and SetError methods now exported for advanced error handling

🐛 Critical Bugfixes

  • Content-Type header parsing - Now case-insensitive (affects our HTTP backends!)
  • SSEClientTransport error reporting - Better HTTP error propagation
  • RFC 9110 compliance - Added Allow header to 405 responses
  • Race condition - Fixed logging race condition (improves stability)

📦 Dependencies

  • Upgraded to jsonschema v0.4.2

v1.2.0 Features (Our Current Version)

MCP Spec 2025-11-25 Support:

  • ✅ Icons and metadata (SEP-973)
  • ✅ Tool name validation (SEP-986)
  • ✅ Elicitation defaults (SEP-1024)
  • ✅ URL mode elicitation (SEP-1036)
  • ✅ SSE polling (SEP-1699)
  • ✅ Elicitation enum improvements (SEP-1330)

New APIs Available (Not Yet Used):

  • Common error codes via sentinel jsonrpc.Error
  • OAuth 2.0 Protected Resource Metadata support
  • ClientCapabilities.RootsV2 and RootCapabilities
  • Capabilities fields in ServerOptions and ClientOptions

Recent Activity

Repository was updated yesterday (2026-02-16) with:

  • Content-Length header case-insensitivity fix
  • Transport improvements
  • Bug fixes and stability enhancements

Improvement Opportunities

🏃 Quick Wins

1. Upgrade to v1.3.0 (HIGH PRIORITY)

Why: Critical bug fixes + performance improvements
Impact: Fixes HTTP header parsing bug that affects our backends
Risk: Low - stable release, no breaking changes
Effort: 15 minutes

Benefits:

  • ✅ Case-insensitive Content-Length parsing (fixes potential HTTP backend issues)
  • ✅ Race condition fix in logging (improves stability)
  • ✅ Schema caching (automatic performance boost)
  • ✅ Better error handling capabilities

Steps:

go get -u github.com/modelcontextprotocol/go-sdk@v1.3.0
go mod tidy
make test-all

2. Use ClientOptions Pattern

Current: Passing nil for options everywhere
Better: Use ClientOptions for future-proofing and better control

Locations to fix:

  • internal/mcp/connection.go:94-97 (newMCPClient)
  • internal/testutil/mcptest/validator.go:19-22 (NewValidatorClient)

Example refactor:

// Before
client := sdk.NewClient(&sdk.Implementation{
    Name:    "awmg",
    Version: version.Get(),
}, nil)

// After
client := sdk.NewClient(&sdk.Implementation{
    Name:    "awmg",
    Version: version.Get(),
}, &sdk.ClientOptions{
    Capabilities: &sdk.ClientCapabilities{
        // Explicit capability configuration
    },
})

Benefit: Better control over capabilities, prepares for future SDK enhancements
Effort: 30 minutes

✨ Feature Opportunities

1. Leverage Schema Caching (v1.3.0)

  • What: New feature that caches JSON schemas to avoid repeated reflection
  • Impact: Significant performance improvement for stateless server scenarios
  • **C...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 17, 2026 12:54
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Update go-sdk to version v1.3.0 Upgrade go-sdk to v1.3.0 and adopt ClientOptions pattern Feb 17, 2026
Copilot AI requested a review from lpcox February 17, 2026 12:58
@lpcox lpcox marked this pull request as ready for review February 17, 2026 13:08
Copilot AI review requested due to automatic review settings February 17, 2026 13:08
@lpcox lpcox merged commit 9c9505a into main Feb 17, 2026
8 checks passed
@lpcox lpcox deleted the copilot/update-go-sdk-to-v1-3-0 branch February 17, 2026 13:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the MCP Go SDK dependency to v1.3.0 and updates client construction to always pass explicit ClientOptions, aligning runtime and test helpers with the SDK’s recommended initialization pattern.

Changes:

  • Bumped github.com/modelcontextprotocol/go-sdk from v1.2.0 to v1.3.0 (and jsonschema-go to v0.4.2 indirectly).
  • Replaced nil options with &sdk.ClientOptions{} in MCP client initialization (prod + test utility).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
go.mod Upgrades go-sdk to v1.3.0 and updates indirect jsonschema-go requirement.
go.sum Updates module checksums to match the upgraded dependencies.
internal/mcp/connection.go Uses explicit &sdk.ClientOptions{} in newMCPClient() for SDK client creation.
internal/testutil/mcptest/validator.go Uses explicit &sdk.ClientOptions{} in NewValidatorClient() for test validator client creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go-fan] Go Module Review: go-sdk (v1.3.0 upgrade available)

3 participants