mcp: deprecate roots, sampling, and logging (SEP-2577)#1013
Conversation
Mark user-facing roots, sampling, and logging APIs as deprecated per SEP-2577. Wire behavior is unchanged; internal call sites use unexported helpers to keep staticcheck clean.
Use single-line Deprecated comments and drop marginal wire-type doc notes on ListRootsParams, RootsListChangedParams, and SetLoggingLevelParams.
|
@guglielmo-san Following up from your go-ahead on #995. This mirrors rust-sdk #884: advisory Local gate: CI is green on the first run (lint, test 1.25/1.26, race, client+server conformance, docs-check, CodeQL). Pushed a small follow-up to tighten deprecation wording and trim marginal wire-type doc comments. Happy to adjust wording or scope if you prefer a smaller first pass. |
| > **Note:** The roots feature is deprecated by [SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577). | ||
| > The SDK continues to support roots for compatibility. | ||
|
|
There was a problem hiding this comment.
it would be better to reference modelcontextprotocol.io rather than github, as in the other locations of these files.
In this case https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging
| // It is a panic to set both CreateMessageHandler and | ||
| // CreateMessageWithToolsHandler. | ||
| // | ||
| // Deprecated: SEP-2577 deprecates this API. It may be removed in a future release of this SDK. |
There was a problem hiding this comment.
Let's add to the comment that remains functional for at least 12 months, as done in ts sdk https://github.com/modelcontextprotocol/typescript-sdk/pull/2268/changes#diff-d31d9f65bfbc356e9ca36cb9fba7062bd8ba5902c815f5065a72b285b75c2b14
550d880 to
3f6fe83
Compare
4f90273 to
3f6fe83
Compare
Summary
Implements SEP-2577 by marking user-facing roots, sampling, and logging APIs as deprecated. The deprecation is advisory: wire format and runtime behavior are unchanged.
Deprecated:comments on client/server session methods, option handlers, and logging helpers (AddRoots,CreateMessage,NewLoggingHandler,LoggingTransport, and related APIs).protocol.gowithout changing their behavior.//lint:file-ignore SA1019to conformance and example servers that intentionally exercise deprecated APIs for coverage.Fixes #995
Test plan
gofmt(clean)go vet ./...staticcheck ./...go test ./...go test -race ./...