Skip to content

deps: upgrade modelcontextprotocol/go-sdk to v1.5.0#2336

Merged
SamMorrowDrums merged 3 commits intomainfrom
upgrade-mcp-go-sdk-v1.5.0
Apr 15, 2026
Merged

deps: upgrade modelcontextprotocol/go-sdk to v1.5.0#2336
SamMorrowDrums merged 3 commits intomainfrom
upgrade-mcp-go-sdk-v1.5.0

Conversation

@SamMorrowDrums
Copy link
Copy Markdown
Collaborator

Summary

Upgrade the MCP Go SDK from v1.3.1-0.20260220105450-b17143f71798 (pseudo-version) to v1.5.0 (latest stable).

Fixes #2333

Why

The pinned pseudo-version predates go-sdk v1.4.1, which introduced Content-Type validation in StreamableHTTPHandler. That validation already uses mime.ParseMediaType to correctly handle Content-Type: application/json; charset=utf-8, so the middleware proposed in #2334 is unnecessary with this upgrade.

What changed

  • go.mod / go.sum: bumped modelcontextprotocol/go-sdk to v1.5.0
  • Transitive bumps: go directive 1.24→1.25, golang.org/x/oauth2, golang.org/x/sys, segmentio/encoding

Validation

  • go build ./...
  • script/test ✅ (all tests pass)
  • script/lint ✅ (0 issues)

Upgrade the MCP Go SDK from v1.3.1-0.20260220105450-b17143f71798
(pseudo-version) to v1.5.0 (latest stable).

This also resolves #2333, as the SDK now correctly handles
Content-Type headers with MIME parameters (e.g. charset=utf-8)
via mime.ParseMediaType in StreamableHTTPHandler (added in v1.4.1).

Transitive dependency updates:
- go directive: 1.24.0 → 1.25.0 (required by SDK)
- golang.org/x/oauth2: v0.34.0 → v0.35.0
- golang.org/x/sys: v0.40.0 → v0.41.0
- segmentio/encoding: v0.5.3 → v0.5.4

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner April 15, 2026 22:48
Copilot AI review requested due to automatic review settings April 15, 2026 22:48
Auto-generated by license-check workflow
Copy link
Copy Markdown
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 modelcontextprotocol/go-sdk dependency to a stable release to resolve Content-Type validation issues seen by some MCP clients (e.g., application/json; charset=utf-8) and to drop reliance on a pinned pseudo-version.

Changes:

  • Bump github.com/modelcontextprotocol/go-sdk from a pseudo-version to v1.5.0.
  • Update the module go directive to 1.25.0 and refresh transitive dependencies in go.sum.
Show a summary per file
File Description
go.mod Upgrades MCP go-sdk requirement and updates the module Go version to 1.25.0.
go.sum Updates checksums for the new SDK version and transitive dependency bumps.

Copilot's findings

  • Files reviewed: 5/6 changed files
  • Comments generated: 1

Comment thread go.mod
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums merged commit 76d68b4 into main Apr 15, 2026
18 checks passed
@SamMorrowDrums SamMorrowDrums deleted the upgrade-mcp-go-sdk-v1.5.0 branch April 15, 2026 23:08
@lindazqli
Copy link
Copy Markdown

Hi @SamMorrowDrums when do we expect this to roll out? We have been getting customer tickets on 415 error. Thanks

@SamMorrowDrums
Copy link
Copy Markdown
Collaborator Author

Should be shipping today!

@Moarcoo
Copy link
Copy Markdown

Moarcoo commented Apr 17, 2026

I am still experiencing this at this moment on https://api.githubcopilot.com/mcp. Should I wait a bit longer?

@weltonrodrigo
Copy link
Copy Markdown

Just to help those eager to restart interacting with the github mcp, i'm adding this reproducer.

Run as:

export GITHUB_TOKEN=$(gh auth token)
uv run --with httpx python mcp_reproducer.py
import httpx
import sys
import os

def reproduce():
    # To run this, you need a valid GitHub Installation Token or PAT
    token = os.environ.get("GITHUB_TOKEN")
    if not token:
        print("Error: Please set GITHUB_TOKEN environment variable.")
        sys.exit(1)

    url = "https://api.githubcopilot.com/mcp"
    
    # This payload follows the MCP JSON-RPC 2.0 spec
    payload = {
        "jsonrpc": "2.0",
        "method": "tools/list",
        "id": 1
    }

    print(f"Target URL: {url}")
    print("-" * 50)

    # 1. SUCCESS CASE: Exact header
    print("Test 1: Content-Type: application/json (Expected: 200 OK)")
    headers_ok = {
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
        "Accept": "application/json, text/event-stream"
    }
    try:
        r1 = httpx.post(url, headers=headers_ok, json=payload)
        print(f"Result: {r1.status_code} {r1.reason_phrase}")
        if r1.status_code != 200:
            print(f"Body: {r1.text}")
    except Exception as e:
        print(f"Error: {e}")

    print("-" * 50)

    # 2. FAILURE CASE: With charset parameter
    print("Test 2: Content-Type: application/json; charset=utf-8 (Expected: Failure if bug persists)")
    headers_fail = {
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json; charset=utf-8",
        "Accept": "application/json, text/event-stream"
    }
    try:
        r2 = httpx.post(url, headers=headers_fail, json=payload)
        print(f"Result: {r2.status_code} {r2.reason_phrase}")
        if r2.status_code == 415:
            print("Reproduced: Server strictly requires 'application/json' and rejects parameters.")
            print(f"Server Message: {r2.text}")
        elif r2.status_code == 200:
            print("Fixed: Server now accepts the charset parameter.")
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    reproduce()

@SamMorrowDrums
Copy link
Copy Markdown
Collaborator Author

Thank you for confirming, I will check and we can add back a middleware for this if we need to, that's unfortunate.

@SamMorrowDrums
Copy link
Copy Markdown
Collaborator Author

Reopened #2333

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.

'Content-Type must be 'application/json' - when setting charset

5 participants