Skip to content

Obsolete Roots, Sampling, and Logging surface area per SEP-2577 - #1651

Merged
tarekgh merged 5 commits into
modelcontextprotocol:mainfrom
tarekgh:obsolete-roots-sampling-logging-sep2577
Jun 22, 2026
Merged

Obsolete Roots, Sampling, and Logging surface area per SEP-2577#1651
tarekgh merged 5 commits into
modelcontextprotocol:mainfrom
tarekgh:obsolete-roots-sampling-logging-sep2577

Conversation

@tarekgh

@tarekgh tarekgh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Marks the public API surface for the Roots, Sampling, and Logging features as [Obsolete] in line with SEP-2577, which deprecates these three features in specification version 2026-07-28.

There is no functional or wire-behavior change. The features continue to work exactly as before; consumers simply get a compile-time deprecation warning guiding them away from the deprecated surface.

What is deprecated

The deprecation covers the full surface area of all three features:

  • Protocol DTOs (e.g. Root, ListRootsResult, CreateMessageRequestParams, CreateMessageResult, SamplingMessage, ModelPreferences, LoggingLevel, SetLevelRequestParams, LoggingMessageNotificationParams, and related types).
  • Capability properties (RootsCapability, SamplingCapability, LoggingCapability, and the corresponding properties on ClientCapabilities / ServerCapabilities).
  • Method-name and notification-name constants in RequestMethods and NotificationMethods.
  • Convenience client/server methods, handlers, builders, and request filters tied to these features.
  • The sampling/roots helpers on the input request/response types.

Diagnostic ID

All three features share a single diagnostic ID, MCP9005, so consumers can opt out with one suppression. Feature-specific messages (Roots, Sampling, Logging) keep the diagnostics distinguishable in build output.

  • Documented the new diagnostic in docs/list-of-diagnostics.md.
  • Suppressed MCP9005 internally where the SDK, tests, and samples still exercise the deprecated APIs.

Validation

  • dotnet build -c Release: succeeds with 0 warnings (TreatWarningsAsErrors=true).
  • dotnet test -c Release: all tests pass.

Fixes #1588

Mark all public API surface for the Roots, Sampling, and Logging features as
[Obsolete] in line with SEP-2577. This covers protocol DTOs, capability
properties, method-name constants, convenience methods, handlers, builders,
filters, and the related sampling/roots helpers on the input request/response
types. There is no functional or wire behavior change; the features continue to
work exactly as before.

All three features share a single diagnostic ID (MCP9005) so consumers can opt
out with one suppression, while feature-specific messages keep the diagnostics
distinguishable. Documents the new diagnostic in docs/list-of-diagnostics.md and
suppresses MCP9005 where the SDK, tests, and samples exercise the deprecated
APIs internally.
Comment thread samples/Directory.Build.props Outdated
Replace the blanket samples/Directory.Build.props suppression with a
local NoWarn in only the four samples that intentionally exercise a
deprecated feature, so MCP9005 stays active for every other sample.
halter73
halter73 previously approved these changes Jun 18, 2026
Comment thread src/Common/Obsoletions.cs Outdated
The list-of-diagnostics.md table rows are not headings, so per-ID
fragments like #mcp9005 and #mcp9003 do not resolve. Link to the
#obsolete-apis section heading instead, matching the MCP9004 entry.
@tarekgh
tarekgh merged commit 8ddb3cc into modelcontextprotocol:main Jun 22, 2026
11 checks passed
@mikekistler mikekistler linked an issue Jun 23, 2026 that may be closed by this pull request
@jeffhandley jeffhandley added the breaking-change This issue or PR introduces a breaking change label Jul 28, 2026
@jeffhandley

Copy link
Copy Markdown
Contributor

Added breaking-change because this introduces MCP9005 build warnings across the stable Roots, Sampling, and Logging API surface. Under the SDK's obsoletion policy, adding warnings is the first stage of an API-breaking transition. Consumers that still require these capabilities can temporarily suppress MCP9005 while planning migration.

AI-generated by GitHub Copilot at the maintainer's request.

@jeffhandley jeffhandley mentioned this pull request Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This issue or PR introduces a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEP-2577: Deprecate Roots, Sampling, and Logging

4 participants