feat: deprecate roots sampling and logging

Warn when Roots, Sampling, or Logging APIs are used with MCP protocol version 2026-07-28 or newer.

Add a shared protocol deprecation helper, YARD deprecation notes, and regression tests covering warnings at and after the deprecation threshold and no warnings for older or never-established protocol versions.

Closes https://github.com/modelcontextprotocol/ruby-sdk/issues/390

Co-authored-by: Qlaw <noreply@qlaw.quick.shopify.io>
This commit is contained in:
Ates Goral 2026-06-14 11:45:38 +02:00
commit 6a43d3d6fb

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
require "test_helper"
module MCP
class ProtocolDeprecationsTest < ActiveSupport::TestCase
test "roots, sampling, and logging are deprecated in 2026-07-28 and later" do
refute ProtocolDeprecations.deprecated_roots_sampling_logging?(nil)
refute ProtocolDeprecations.deprecated_roots_sampling_logging?("2025-11-25")
assert ProtocolDeprecations.deprecated_roots_sampling_logging?("2026-07-28")
assert ProtocolDeprecations.deprecated_roots_sampling_logging?("2027-01-01")
end
end
end