fix(deps): update module github.com/modelcontextprotocol/go-sdk to v1.8.0 #130
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/github.com-modelcontextprotocol-go-sdk-1.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
v1.6.1→v1.8.0Release Notes
modelcontextprotocol/go-sdk (github.com/modelcontextprotocol/go-sdk)
v1.8.0Compare Source
This release is equivalent to v1.8.0-pre.2. Thank you to those who tested the pre-release.
In this release we introduce several fixes and improvements on top of v1.7.0. It adds no new protocol revision: the supported set is unchanged, and
2026-07-28remains the newest version the SDK negotiates.The bulk of the work is hardening the transports against resource exhaustion, closing session leaks, deadlocks and teardown hangs found by users running the new protocol at scale, and giving servers explicit control over which protocol versions they advertise.
Two behavior changes are guarded by new
MCPGODEBUGflags; see the section below.Hardening against resource exhaustion
Every decoding path that buffers incoming input is now bounded. JSON payloads are rejected past 1000 levels of nesting, before the parser recurses. Both SSE readers cap the bytes buffered for a single event via
MaxEventSizeonSSEClientTransportandStreamableClientTransport, and the stdio transport caps a single JSON-RPC frame viaStdioTransport.MaxLineLength.On the OAuth side, dynamic client registration responses are bounded to 1 MB, and the discovery code now validates metadata documents rather than trusting them.
Restricting the protocol versions a server supports
ServerOptions.SupportedProtocolVersionslets a server narrow the set of versions it advertises and negotiates. The list can only narrow, never widen; naming a version the SDK does not implement panics at construction.Relatedly, a stateful streamable handler receiving a
2026-07-28request now returns that same JSON-RPC error instead of a plain-text 400, so the client can renegotiate down instead of losing the connection.Per-request cache control
ServerOptions.SetCacheableis a new hook that decides thettlMsandcacheScopefields of every result carrying them:server/discover, the four list methods, andresources/read. It runs once per result, after the handler returns, with the values that handler produced, so it can set a policy globally while still letting an individual handler override it. Anything left unset falls back to the protocol default ofpublic.Behavior changes guarded by MCPGODEBUG
Two new escape-hatch flags restore the previous behavior of the changes above. Both will be removed in v1.9.0.
plaintextstatefulrejection=1— restore the plain-texthttp.Error400 body a statefulStreamableHTTPHandlerpreviously returned for a request carrying per-request metadata. The default is now a JSON-RPC-32022 CodeUnsupportedProtocolVersionerror with anUnsupportedProtocolVersionDatapayload advertising the legacy versions the server supports. Introduced by #1143.blockingcancelnotify=1— restore the previous behavior where a cancelled call waits synchronously fornotifications/cancelledto be delivered (up to 5s) before returning, joining any delivery error into the caller's error. The default now retires the call immediately and sends the notification asynchronously. Introduced by #1151.Options below were removed, according to plan:
seterroroverwriteenableoriginverificationdisablecontenttypecheckdisablelocalhostprotectionOther Changes to the SDK
go getleaves the module unbuildable by @tonydzi (#1148)actions/setup-nodefrom 6.0.0 to 7.0.0 by @dependabot (#1123)actions/setup-pythonfrom 6.3.0 to 7.0.0 by @dependabot (#1124)actions/setup-gofrom 6.5.0 to 7.0.0 by @dependabot (#1125)actions/checkoutfrom 7.0.0 to 7.0.1 by @dependabot (#1126)golang/govulncheck-actionfrom 1.0.4 to 1.1.0 by @dependabot (#1218)ossf/scorecard-actionfrom 2.4.3 to 2.4.4 by @dependabot (#1217)New Contributors
Full Changelog: https://github.com/modelcontextprotocol/go-sdk/compare/v1.7.0...v1.8.0-pre.1
v1.7.0Compare Source
This release brings full support for protocol version
2026-07-28.The wire protocol is largely rewritten: a stateless model with per-request
_meta, a newserver/discoverRPC replacing theinitializehandshake, multi-round-trip requests (MRTR) replacing server-initiated calls, a unifiedsubscriptions/listenstream replacing free-floating change notifications, standardised HTTP headers, and the formal deprecation of the roots, sampling, and logging features.The streamable HTTP transport accepts requests at protocol version
2026-07-28only whenStreamableHTTPOptions.Stateless = true. If you want to expose the new protocol over HTTP, setStateless = true; if you want to keep stateful sessions, your clients will negotiate down to2025-11-25.Backward compatibility with
2025-11-25and earlier is preserved on every endpoint. The SDK negotiates the highest mutually-supported version at connect time. The new protocol is enabled by default for new clients; existing legacy clients and servers continue to work unchanged.This release consolidates everything shipped in
v1.7.0-pre.1,v1.7.0-pre.2, andv1.7.0-pre.3. Thank you to everyone who exercised the pre-releases and filed feedback.v1.7.0-pre.3is already successfully used by GitHub, serving more than half a million users.Make MCP Stateless (SEP-2575) & Sessionless (SEP-2567)
The
initialize/notifications/initializedhandshake is removed in2026-07-28. Each request now carries_meta.io.modelcontextprotocol/{protocolVersion,clientInfo,clientCapabilities}so the server can validate the peer without state. A newserver/discoverRPC lets clients learn the server's supported versions and capabilities up front; the SDK falls back to legacyinitializeif discover fails. Resumability (Last-Event-ID, standalone GET) is removed;ping,logging/setLevel,resources/subscribe, andresources/unsubscribeare also removed on this revision and rejected withMethodNotFound.MissingRequiredClientCapabilityerror data by @guglielmo-san (#1005)UnsupportedProtocolVersionerror by @guglielmo-san (#989)Subscriptions listen (SEP-2575)
The legacy
tools/list_changed,prompts/list_changed,resources/list_changed, andresources/updatednotifications are replaced by a single long-livedsubscriptions/listenrequest whose response stream multiplexes every change notification the client opted into, each tagged withio.modelcontextprotocol/subscriptionId. The SDK opens this stream automatically onClient.Connectwhen the corresponding list-changed handler is set; servers route notifications only to subscribed sessions.subscriptions/listenrpc (SEP-2575) by @guglielmo-san (#1007)Multi Round-Trip Requests (SEP-2322)
Server-to-client requests for elicitation, sampling, and roots are no longer issued as fresh JSON-RPC requests. Instead a tool/prompt/resource handler returns an
InputRequiredResultwhoseinputRequestsfield carries the requests; the client fulfils each and retries the original call withinputResponsespopulated. The SDK ships client- and server-side middleware that handles this transparently in both directions, including a server-side compatibility shim that lets MRTR handlers also work against legacy clients.Cacheable list results (SEP-2549)
tools/list,prompts/list,resources/list,resources/templates/list,resources/read, andserver/discoverresults now carryttlMsandcacheScopefields. Clients honour them as freshness hints to reduce polling; shared intermediaries usecacheScopeto decide whether responses may be cached.DiscoverResultby @guglielmo-san (#1022)HTTP standardization (SEP-2243)
The streamable HTTP transport now mirrors selected fields from the JSON-RPC body into HTTP headers (
Mcp-Method,Mcp-Name,Mcp-Protocol-Version,Mcp-Param-*) so network intermediaries can route and observe MCP traffic without deep packet inspection. Tools can declare per-parameter passthrough viax-mcp-headerannotations on their input schema. Body↔header mismatches return-32020 HeaderMismatch.x-mcp-headerby @guglielmo-san (#915)Deprecation of roots, sampling, and logging (SEP-2577)
Roots, sampling, and logging are formally deprecated on the
2026-07-28revision. The SDK continues to expose the corresponding Go types for backward compatibility with older peers, but new servers should not rely on them.Behavior changes guarded by MCPGODEBUG
Seven escape-hatch flags are added in this release to restore behavior that changed as part of spec-compliance fixes. All will be removed in v1.9.0.
customresnotfounderrcode=1— restore the old-32002code forResourceNotFoundError.hintomitempty=1— restoreomitemptyonToolAnnotations.ReadOnlyHintandIdempotentHint. The default now always serializes these fields because the Go types are barebool(not*bool), so omittingfalsemade it indistinguishable from "unset".allowsessionsinstateless=1— restore session-id handling on stateless streamable HTTP servers (read/writeMcp-Session-Id, acceptDELETE). The default behavior is now what the spec requires: stateless servers ignore session IDs entirely and return405 Method Not AllowedforDELETE.nomethodnotfoundcodeinerror=1— restore the previous STDIO behavior where the JSON-RPCMethodNotFound(-32601) code is omitted from the error response for unhandled methods. The default now includes the code.noprotocolerrorbody=1— restore the previous streamable HTTP client behavior of not decoding the JSON-RPC error body of a non-2xx HTTP response. The default now surfaces the underlying JSON-RPC error.nowrapinvalidparams=1— restore the previous behavior of returning rawunmarshalParamserrors from receiving handlers instead of wrapping them as a JSON-RPC-32602 Invalid paramserror. Introduced by #1087.disablecompleteparamsvalidation=1— restore the previous behavior of acceptingcompletion/completeresponses without validating the presence of thecompletionparams object. Introduced by #1080.Other Changes to the SDK
Streamable HTTP transport:
streamableClientConn.Closeby @blackwell-systems (#929)Custom methods and MCPGODEBUG-guarded fixes:
unmarshalParamswith jsonrpc error by @guglielmo-san (#1087)CompleteResultby @guglielmo-san (#1080)Additional spec-compliance fixes:
DiscoverResult(SEP-2575) by @guglielmo-san (#1097)subscriptions/listenby @guglielmo-san (#1088)server/discoverfor<2026-07-28requests by @guglielmo-san (#1084)resultTypeon new-protocol responses by @ychampion (#1060)ElicitParamsby @guglielmo-san (#1078)ApplyDefaultwhenres.Content == nilby @guglielmo-san (#1069)InitializeParamsin Meta by @guglielmo-san (#1049)protocolVersionin legacy initialize toprotocolVersion20251125by @guglielmo-san (#1051)NotificationSubscriptionsa mandatory field by @guglielmo-san (#1050)omitemptyReadOnlyHintinToolAnnotationsby @pvlbzn (#908)AddToolwhen schema is nil by @wucm667 (#918)tool.InputSchemaandtool.OutputSchemavalidation (SEP-2106) by @guglielmo-san (#1009)2026-06-30to2026-07-28by @guglielmo-san (#1015)2026-07-28to the supported protocol versions by @guglielmo-san (#1020)Auth and OAuth:
ClockSkewoption toRequireBearerTokenOptionsby @BorisTyshkevich (#969)AllowMissingExpirationoption toRequireBearerTokenOptionsby @BorisTyshkevich (#971)MatchesResourcehelper (RFC 9728/8707 audience comparison) by @BorisTyshkevich (#970)oauth2.RetrieveErrorduring token refresh by @smlx (#917)Session, keepalive and misc:
golang.org/x/time/rateforLoggingHandlerrate limiting by @wucm667 (#927)Conformance tests, documentation and CI:
troubleshoot.mdto includeresultTypeby @guglielmo-san (#1081)github/codeql-actionfrom 4.35.1 to 4.35.2 by @dependabot (#922)github/codeql-actionfrom 4.35.2 to 4.36.0 by @dependabot (#986)actions/cachefrom 5.0.4 to 5.0.5 by @dependabot (#923)actions/cachefrom 5.0.5 to 6.1.0 by @dependabot (#1065)actions/setup-nodefrom 6.3.0 to 6.4.0 by @dependabot (#921)actions/upload-artifactfrom 7.0.0 to 7.0.1 by @dependabot (#920)actions/checkoutfrom 6.0.2 to 7.0.0 by @dependabot (#1040)actions/setup-pythonfrom 6.2.0 to 6.3.0 by @dependabot (#1038)actions/setup-gofrom 6.4.0 to 6.5.0 by @dependabot (#1066)github/codeql-action/upload-sariffrom 4.36.0 to 4.36.2 by @dependabot (#1039)New Contributors
Full Changelog: https://github.com/modelcontextprotocol/go-sdk/compare/v1.6.0...v1.7.0
Configuration
📅 Schedule: (in timezone Europe/Berlin)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.
fix(deps): update module github.com/modelcontextprotocol/go-sdk to v1.7.0to fix(deps): update module github.com/modelcontextprotocol/go-sdk to v1.8.02c32c3c4a2580697ede0View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.