chore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.7.0 #8
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.4.1→v1.7.0Release Notes
modelcontextprotocol/go-sdk (github.com/modelcontextprotocol/go-sdk)
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
v1.6.1Compare Source
This release adds an MCPGODEBUG flag to opt out of the Content-Type check on POST requests.
Behavior Changes
Prior to v1.6.0 (v1.4.0...v1.5.0), the Content-Type check on POST requests was gated by the same
disablecrossoriginprotectionMCPGODEBUG flag as the cross-origin protection. In v1.6.0, the cross-origin protection was disabled by default (replaced by the opt-inenableoriginverificationflag), but the Content-Type check was kept on unconditionally, leaving no way to disable it.This release restores an escape hatch for both the Streamable HTTP and SSE transports: setting
MCPGODEBUG=disablecontenttypecheck=1skips theContent-Type: application/jsonvalidation on POST requests.See #957.
What's Changed
Full Changelog: https://github.com/modelcontextprotocol/go-sdk/compare/v1.6.0...v1.6.1
v1.6.0Compare Source
This release is equivalent to v1.6.0-pre.1. Thank you to those who tested the pre-release.
In this release we introduce several smaller fixes and improvements, and we started working for release 2026-06-30. The main new feature is the introduction of
ClientCredentialsHandlerfor OAuth client credentials grant.Add
ClientCredentialsHandlerfor OAuth client credentials grantAdded
ClientCredentialsHandlerimplementingauth.OAuthHandlerusing the OAuth 2.0 Client Credentials grant (RFC 6749 Section 4.4) for service-to-service authentication with pre-registered credentials.2026-06-30 Release related PRs
feat: add automatic application_type inference by @guglielmo-san in #904
New
application_typefield is added to theClientRegistrationMetadatafor DynamicClientRegistration. If not specified, theapplication_typewill be inferred from the RedirectURIs. This implements SEP-837.feat: HTTP Header Standardization for method and name by @guglielmo-san in #907
By mirroring key fields from the JSON-RPC payload into HTTP headers, network intermediaries such as load balancers, proxies, and observability tools can route and process MCP traffic without deep packet inspection, reducing latency and computational overhead. This partially implements SEP-2243.
Behavior Changes
SetErrorBehavior ChangePreviously the
SetErrormethod onCallToolResultalways overwrote theContentfield with the error text. NowSetErrorpreserves the existing value if it has already been populated. You can restore the previous behavior by setting the environment variableseterroroverwrite=1.Cross-Origin Protection Default Change
Previously (v1.4.1-v1.5.0) default (zero-value) cross-origin protection was applied when
CrossOriginProtectioninStreamableHTTPOptionswasnil. Now cross-origin protection is not enabled by default whenCrossOriginProtectionis nil.You can restore the previous behavior (enable by default) by setting
enableoriginverification=1.disablecrossoriginprotectionwas replaced byenableoriginverificationafter the default was changed to not enable cross-origin protection.jsonescapingoption was removed, according to plan.Other Changes to the SDK
ServerSession.startKeepaliveby @begelundmuller in #856New Contributors
Full Changelog: https://github.com/modelcontextprotocol/go-sdk/compare/v1.5.0...v1.6.0-pre.1
v1.5.0Compare Source
This release is equivalent to v1.5.0-pre.1. Thank you to those who tested the pre-release.
In this release we introduce important enhancements to the client-side OAuth flows. We also introduce several smaller fixes and improvements.
Stabilization of client-side OAuth APIs
As previously communicated, we're stabilizing the client-side OAuth APIs in
v1.5.0. This means that themcp_go_client_oauthbuild tag will no longer be required to compile the functionality and standard backward compatibility guarantees apply from now on.Compared to the experimental support published in
v1.4.0, we made some backwards incompatible changes:auth.AuthorizationCodeHandlerConfig.AuthorizationCodeFetcher's type was changed fromfunc(context.Context, *auth.AuthorizationArgs) (*auth.AuthorizationResult, error)toauth.AuthorizationCodeFetcherwhich is a reusable definition carrying the same underlying function type.auth.AuthorizationCodeHandlerConfig.PreregisteredClientConfigwas removed and replaced withauth.AuthorizationCodeHandlerConfig.PreregisteredClientwhich uses a newly introducedoauthex.ClientCredentialstype. The type used previously (auth.PreregisteredClientConfig) has been removed.authandoauthexpackages.Enterprise Managed Authorization support added
Support for Enterprise Managed Authorization has been added to
auth/extauthpackage. Huge thanks to @radar07 for the implementation!Note: this support is part of an official MCP extension and is not part of the core protocol. The support of this functionality is not covered by the principles defined in SDK tiers.
Other changes to the SDK
New Contributors
Full Changelog: https://github.com/modelcontextprotocol/go-sdk/compare/v1.4.1...v1.5.0
Configuration
📅 Schedule: (UTC)
🚦 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.
ℹ️ Artifact update notice
File name: go.mod
In order to perform the update(s) described in the table above, Renovate ran the
go getcommand, which resulted in the following additional change(s):Details:
github.com/google/jsonschema-gov0.4.2->v0.4.3golang.org/x/oauth2v0.34.0->v0.35.0chore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.5.0to chore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.6.03097c2088b9f8fcc5cd8chore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.6.0to chore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.6.19f8fcc5cd8927cba130bchore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.6.1to chore(deps): update module github.com/modelcontextprotocol/go-sdk to v1.7.0927cba130b838e8b643cView 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.