From 72bad588369ae25f3d2f3af586e84011e21aaf1a Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Fri, 12 Dec 2025 11:23:45 -0500 Subject: [PATCH 1/2] mcp: update latestProtocolVersion to 2025-11-25 Update the SDK to use protocol version 2025-11-25 as the latest supported version. Fix tests and examples that had hardcoded expectations for the previous version (2025-06-18). --- docs/protocol.md | 2 +- docs/troubleshooting.md | 4 ++-- mcp/shared.go | 4 ++-- mcp/streamable_example_test.go | 2 +- mcp/streamable_test.go | 2 +- mcp/testdata/conformance/server/version-latest.txtar | 2 +- mcp/transport_example_test.go | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/protocol.md b/docs/protocol.md index 16ba0bfa..a2724b76 100644 --- a/docs/protocol.md +++ b/docs/protocol.md @@ -165,7 +165,7 @@ func ExampleStreamableHTTPHandler() { resp := mustPostMessage(`{"jsonrpc": "2.0", "id": 1, "method":"initialize", "params": {}}`, httpServer.URL) fmt.Println(resp) // Output: - // {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-06-18","serverInfo":{"name":"server","version":"v0.1.0"}}} + // {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-11-25","serverInfo":{"name":"server","version":"v0.1.0"}}} } ``` diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index b8cc7769..1a0c3679 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -50,8 +50,8 @@ func ExampleLoggingTransport() { } // Output: - // read: {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-06-18","serverInfo":{"name":"server","version":"v0.0.1"}}} - // write: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"client","version":"v0.0.1"},"protocolVersion":"2025-06-18","capabilities":{"roots":{"listChanged":true}}}} + // read: {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-11-25","serverInfo":{"name":"server","version":"v0.0.1"}}} + // write: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"client","version":"v0.0.1"},"protocolVersion":"2025-11-25","capabilities":{"roots":{"listChanged":true}}}} // write: {"jsonrpc":"2.0","method":"notifications/initialized","params":{}} } ``` diff --git a/mcp/shared.go b/mcp/shared.go index d83eae7d..b559236f 100644 --- a/mcp/shared.go +++ b/mcp/shared.go @@ -33,8 +33,8 @@ const ( // // It is the version that the client sends in the initialization request, and // the default version used by the server. - latestProtocolVersion = protocolVersion20250618 - protocolVersion20251125 = "2025-11-25" // not yet released + latestProtocolVersion = protocolVersion20251125 + protocolVersion20251125 = "2025-11-25" protocolVersion20250618 = "2025-06-18" protocolVersion20250326 = "2025-03-26" protocolVersion20241105 = "2024-11-05" diff --git a/mcp/streamable_example_test.go b/mcp/streamable_example_test.go index f1cdf90a..7ff1612e 100644 --- a/mcp/streamable_example_test.go +++ b/mcp/streamable_example_test.go @@ -35,7 +35,7 @@ func ExampleStreamableHTTPHandler() { resp := mustPostMessage(`{"jsonrpc": "2.0", "id": 1, "method":"initialize", "params": {}}`, httpServer.URL) fmt.Println(resp) // Output: - // {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-06-18","serverInfo":{"name":"server","version":"v0.1.0"}}} + // {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-11-25","serverInfo":{"name":"server","version":"v0.1.0"}}} } // !-streamablehandler diff --git a/mcp/streamable_test.go b/mcp/streamable_test.go index b1c3f074..58d3956a 100644 --- a/mcp/streamable_test.go +++ b/mcp/streamable_test.go @@ -758,7 +758,7 @@ func TestStreamableServerTransport(t *testing.T) { Logging: &LoggingCapabilities{}, Tools: &ToolCapabilities{ListChanged: true}, }, - ProtocolVersion: latestProtocolVersion, + ProtocolVersion: protocolVersion20250618, ServerInfo: &Implementation{Name: "testServer", Version: "v1.0.0"}, }, nil) initializedMsg := req(0, notificationInitialized, &InitializedParams{}) diff --git a/mcp/testdata/conformance/server/version-latest.txtar b/mcp/testdata/conformance/server/version-latest.txtar index 75317676..77d1de26 100644 --- a/mcp/testdata/conformance/server/version-latest.txtar +++ b/mcp/testdata/conformance/server/version-latest.txtar @@ -20,7 +20,7 @@ response with its latest supported version. "capabilities": { "logging": {} }, - "protocolVersion": "2025-06-18", + "protocolVersion": "2025-11-25", "serverInfo": { "name": "testServer", "version": "v1.0.0" diff --git a/mcp/transport_example_test.go b/mcp/transport_example_test.go index bb032f11..62fc0315 100644 --- a/mcp/transport_example_test.go +++ b/mcp/transport_example_test.go @@ -45,8 +45,8 @@ func ExampleLoggingTransport() { } // Output: - // read: {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-06-18","serverInfo":{"name":"server","version":"v0.0.1"}}} - // write: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"client","version":"v0.0.1"},"protocolVersion":"2025-06-18","capabilities":{"roots":{"listChanged":true}}}} + // read: {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"logging":{}},"protocolVersion":"2025-11-25","serverInfo":{"name":"server","version":"v0.0.1"}}} + // write: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"client","version":"v0.0.1"},"protocolVersion":"2025-11-25","capabilities":{"roots":{"listChanged":true}}}} // write: {"jsonrpc":"2.0","method":"notifications/initialized","params":{}} } From dc3083e55333c181f3ec5a6d8988537e8cd13dac Mon Sep 17 00:00:00 2001 From: Maciek Kisiel Date: Tue, 3 Mar 2026 08:54:51 +0000 Subject: [PATCH 2/2] So additional adjustments. --- mcp/protocol.go | 6 ------ mcp/server_test.go | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/mcp/protocol.go b/mcp/protocol.go index 837ce784..d0717404 100644 --- a/mcp/protocol.go +++ b/mcp/protocol.go @@ -4,12 +4,6 @@ package mcp -// Protocol types for version 2025-06-18. -// To see the schema changes from the previous version, run: -// -// prefix=https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema -// sdiff -l <(curl $prefix/2025-03-26/schema.ts) <(curl $prefix/2025/06-18/schema.ts) - import ( "encoding/json" "fmt" diff --git a/mcp/server_test.go b/mcp/server_test.go index 227e7be3..e57af1e2 100644 --- a/mcp/server_test.go +++ b/mcp/server_test.go @@ -763,13 +763,13 @@ func TestClientRootCapabilities(t *testing.T) { var initParams json.RawMessage if tc.capabilities != nil { initParams = json.RawMessage(`{ - "protocolVersion": "2025-06-18", + "protocolVersion": "2025-11-25", "capabilities": ` + *tc.capabilities + `, "clientInfo": {"name": "TestClient", "version": "1.0.0"} }`) } else { initParams = json.RawMessage(`{ - "protocolVersion": "2025-06-18", + "protocolVersion": "2025-11-25", "clientInfo": {"name": "TestClient", "version": "1.0.0"} }`) }