Skip to content

Deprecate roots, sampling, and logging per SEP-2577#406

Open
atesgoral wants to merge 1 commit into
modelcontextprotocol:mainfrom
atesgoral:issue-390-deprecations
Open

Deprecate roots, sampling, and logging per SEP-2577#406
atesgoral wants to merge 1 commit into
modelcontextprotocol:mainfrom
atesgoral:issue-390-deprecations

Conversation

@atesgoral

@atesgoral atesgoral commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Deprecate MCP Roots, Sampling, and Logging only when protocol version 2026-07-28 is negotiated or explicitly configured.

Context

SEP-2577 deprecates Roots, Sampling, and Logging in the 2026-07-28 protocol version.

Closes #390

Changes

  • Add 2026-07-28 as an explicitly supported stable protocol version while keeping LATEST_STABLE_PROTOCOL_VERSION at 2025-11-25.
  • Add a shared protocol deprecation helper that emits Kernel.warn messages only for 2026-07-28.
  • Warn on deprecated server APIs and session-scoped calls for roots, sampling, and logging.
  • Warn client transports when deprecated roots or sampling capabilities are used with negotiated protocol version 2026-07-28.
  • Add YARD @deprecated notes and regression tests for both warning and no-warning behavior.
  • Update the changelog.

Testing

  • GEM_HOME="$PWD/.gem-test" GEM_PATH="$PWD/.gem-test:/nix/store/jh918yiwd5cs4pjg005ac32m2q7ckw3l-ruby-4.0.5/lib/ruby/gems/4.0.0" bundle exec rake test
  • GEM_HOME="$PWD/.gem-test" GEM_PATH="$PWD/.gem-test:/nix/store/jh918yiwd5cs4pjg005ac32m2q7ckw3l-ruby-4.0.5/lib/ruby/gems/4.0.0" bundle exec rake rubocop
  • git diff --check

@atesgoral atesgoral force-pushed the issue-390-deprecations branch 4 times, most recently from d8066ae to 6cabe09 Compare June 14, 2026 15:04
@atesgoral atesgoral changed the base branch from main to rubocop-cleanup-existing-offenses June 14, 2026 15:04
@atesgoral atesgoral force-pushed the rubocop-cleanup-existing-offenses branch from 0e694e3 to 460adaf Compare June 14, 2026 15:46
@atesgoral atesgoral force-pushed the issue-390-deprecations branch 2 times, most recently from 26a27ad to 9533204 Compare June 15, 2026 07:03
@atesgoral atesgoral changed the base branch from rubocop-cleanup-existing-offenses to main June 15, 2026 07:03
@atesgoral atesgoral force-pushed the issue-390-deprecations branch 4 times, most recently from 3f8cf4a to 0c7a871 Compare June 15, 2026 07:39
Warn when Roots, Sampling, or Logging APIs are used with MCP protocol version 2026-07-28, while leaving the latest stable default at 2025-11-25.

Add a shared protocol deprecation helper, YARD deprecation notes, and regression tests covering warnings for 2026-07-28 and no warnings for older protocol versions.

Closes modelcontextprotocol#390
@atesgoral atesgoral force-pushed the issue-390-deprecations branch from 0c7a871 to be41c3c Compare June 15, 2026 08:25
@atesgoral atesgoral marked this pull request as ready for review June 15, 2026 08:29
@atesgoral atesgoral requested a review from koic June 15, 2026 08:30
@atesgoral atesgoral changed the title feat: deprecate roots, sampling, and logging for 2026-07-28 feat: deprecate roots, sampling, and logging per SEP-2577 Jun 16, 2026
@atesgoral atesgoral changed the title feat: deprecate roots, sampling, and logging per SEP-2577 Deprecate roots, sampling, and logging per SEP-2577 Jun 16, 2026
@atesgoral

Copy link
Copy Markdown
Contributor Author

@koic Happy to push this through or were you thinking of doing the deprecation later?

@koic

koic commented Jun 24, 2026

Copy link
Copy Markdown
Member

I'd lean toward doing the deprecation later rather than merging the full behavior change now.

This SEP introduces a behavioral switch tied to protocol versioning, and I think that design makes sense because it preserves compatibility with existing protocol versions. However, the 2026-07-28 specification hasn't actually been released yet, and it doesn't appear to have been added to SUPPORTED_STABLE_PROTOCOL_VERSIONS in the Python or TypeScript SDKs either.

Given that, I'd prefer to wait until the 2026-07-28 release is closer before enabling the deprecation behavior.

In the meantime, it might be reasonable to land the advisory annotations on their own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEP-2577: Deprecate Roots, Sampling, and Logging

2 participants