Skip to content

Commit b6649db

Browse files
mcp: Deprecate roots, sampling and logging (SEP-2577) (#1017)
Fixes #1013
1 parent cd7d80c commit b6649db

22 files changed

Lines changed: 320 additions & 25 deletions

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ The following table shows which versions of the Go SDK support which versions of
4444

4545
\*\* Partial support for 2025-11-25 (client side OAuth and Sampling with tools not available).
4646

47+
The roots, sampling, and logging features are deprecated as of protocol version
48+
2026-07-28 by
49+
[SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging).
50+
The SDK continues to support them for compatibility during the deprecation
51+
window (at least twelve months). See the individual feature documentation for
52+
migration guidance.
53+
4754
New releases of the SDK target only supported versions of Go. See
4855
https://go.dev/doc/devel/release#policy for more information.
4956

conformance/everything-server/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// The conformance server implements features required for MCP conformance testing.
66
// It mirrors the functionality of the TypeScript conformance server at
77
// https://github.com/modelcontextprotocol/conformance/blob/main/examples/servers/typescript/everything-server.ts
8+
//
9+
//lint:file-ignore SA1019 conformance server exercises deprecated SEP-2577 APIs (roots, sampling, logging).
810
package main
911

1012
import (

docs/client.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
## Roots
1212

13+
> **Note:** The roots feature is deprecated as of protocol version 2026-07-28
14+
> ([SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging)).
15+
> It remains fully functional during the deprecation window (at least twelve
16+
> months). The SDK continues to support roots for compatibility. New code
17+
> should pass paths via tool parameters, resource URIs, or configuration
18+
> instead.
19+
1320
MCP allows clients to specify a set of filesystem
1421
["roots"](https://modelcontextprotocol.io/specification/2025-06-18/client/roots).
1522
The SDK supports this as follows:
@@ -77,6 +84,13 @@ func Example_roots() {
7784

7885
## Sampling
7986

87+
> **Note:** The sampling feature is deprecated as of protocol version
88+
> 2026-07-28
89+
> ([SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging)).
90+
> It remains fully functional during the deprecation window (at least twelve
91+
> months). The SDK continues to support sampling for compatibility. Servers
92+
> that need LLM completions should call LLM provider APIs directly.
93+
8094
[Sampling](https://modelcontextprotocol.io/specification/2025-06-18/client/sampling)
8195
is a way for servers to leverage the client's AI capabilities. It is
8296
implemented in the SDK as follows:

docs/server.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,13 @@ _ = mcp.NewServer(&mcp.Implementation{Name: "server"}, &mcp.ServerOptions{
474474

475475
### Logging
476476

477+
> **Note:** The logging feature is deprecated as of protocol version
478+
> 2026-07-28
479+
> ([SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging)).
480+
> It remains fully functional during the deprecation window (at least twelve
481+
> months). The SDK continues to support logging for compatibility. Servers
482+
> should migrate to stderr logging (for STDIO transports) or OpenTelemetry.
483+
477484
MCP servers can send logging messages to MCP clients.
478485
(This form of logging is distinct from server-side logging, where the
479486
server produces logs that remain server-side, for use by server maintainers.)

examples/server/distributed/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// Example:
1717
//
1818
// ./distributed -http=localhost:8080 -child_ports=8081,8082
19+
//
20+
//lint:file-ignore SA1019 example server exercises deprecated SEP-2577 logging API for demonstration.
1921
package main
2022

2123
import (

examples/server/everything/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// license that can be found in the LICENSE file.
44

55
// The everything server implements all supported features of an MCP server.
6+
//
7+
//lint:file-ignore SA1019 example server exercises deprecated SEP-2577 APIs (roots, sampling, logging) for demonstration.
68
package main
79

810
import (

internal/docs/client.src.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
## Roots
66

7+
> **Note:** The roots feature is deprecated as of protocol version 2026-07-28
8+
> ([SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging)).
9+
> It remains fully functional during the deprecation window (at least twelve
10+
> months). The SDK continues to support roots for compatibility. New code
11+
> should pass paths via tool parameters, resource URIs, or configuration
12+
> instead.
13+
714
MCP allows clients to specify a set of filesystem
815
["roots"](https://modelcontextprotocol.io/specification/2025-06-18/client/roots).
916
The SDK supports this as follows:
@@ -26,6 +33,13 @@ method. To receive notifications about root changes, set
2633

2734
## Sampling
2835

36+
> **Note:** The sampling feature is deprecated as of protocol version
37+
> 2026-07-28
38+
> ([SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging)).
39+
> It remains fully functional during the deprecation window (at least twelve
40+
> months). The SDK continues to support sampling for compatibility. Servers
41+
> that need LLM completions should call LLM provider APIs directly.
42+
2943
[Sampling](https://modelcontextprotocol.io/specification/2025-06-18/client/sampling)
3044
is a way for servers to leverage the client's AI capabilities. It is
3145
implemented in the SDK as follows:

internal/docs/server.src.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,13 @@ requests.
236236

237237
### Logging
238238

239+
> **Note:** The logging feature is deprecated as of protocol version
240+
> 2026-07-28
241+
> ([SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging)).
242+
> It remains fully functional during the deprecation window (at least twelve
243+
> months). The SDK continues to support logging for compatibility. Servers
244+
> should migrate to stderr logging (for STDIO transports) or OpenTelemetry.
245+
239246
MCP servers can send logging messages to MCP clients.
240247
(This form of logging is distinct from server-side logging, where the
241248
server produces logs that remain server-side, for use by server maintainers.)

internal/readme/README.src.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ The following table shows which versions of the Go SDK support which versions of
4343

4444
\*\* Partial support for 2025-11-25 (client side OAuth and Sampling with tools not available).
4545

46+
The roots, sampling, and logging features are deprecated as of protocol version
47+
2026-07-28 by
48+
[SEP-2577](https://modelcontextprotocol.io/seps/2577-deprecate-roots-sampling-and-logging).
49+
The SDK continues to support them for compatibility during the deprecation
50+
window (at least twelve months). See the individual feature documentation for
51+
migration guidance.
52+
4653
New releases of the SDK target only supported versions of Go. See
4754
https://go.dev/doc/devel/release#policy for more information.
4855

mcp/capabilities_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by an MIT-style
33
// license that can be found in the LICENSE file.
44

5+
//lint:file-ignore SA1019 tests exercise deprecated SEP-2577 APIs (roots, sampling, logging).
6+
57
package mcp
68

79
import (

0 commit comments

Comments
 (0)