Skip to content

Commit 5518e8d

Browse files
authored
Merge pull request #429 from atesgoral/issue-390-deprecation-annotations
docs: annotate Roots, Sampling, and Logging as deprecated per SEP-2577
2 parents b7bd9bb + 69bfe43 commit 5518e8d

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Deprecated
11+
12+
- Annotate Roots, Sampling, and Logging APIs as deprecated per SEP-2577 (#429)
13+
1014
## [0.22.0] - 2026-06-27
1115

1216
### Added

lib/mcp/server.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ def notify_resources_list_changed
256256
report_exception(e, { notification: "resources_list_changed" })
257257
end
258258

259+
# @deprecated MCP Logging (`logging/setLevel` and `notifications/message`)
260+
# is deprecated as of MCP protocol version 2026-07-28 (SEP-2577).
261+
# Use stderr or OpenTelemetry instead.
259262
def notify_log_message(data:, level:, logger: nil)
260263
return unless @transport
261264
return unless logging_message_notification&.should_notify?(level)
@@ -272,6 +275,10 @@ def notify_log_message(data:, level:, logger: nil)
272275
# Called when a client notifies the server that its filesystem roots have changed.
273276
#
274277
# @yield [params] The notification params (typically `nil`).
278+
# @deprecated MCP Roots (`roots/list` and
279+
# `notifications/roots/list_changed`) is deprecated as of MCP protocol
280+
# version 2026-07-28 (SEP-2577). Use tool parameters, resource URIs,
281+
# server configuration, or environment variables instead.
275282
def roots_list_changed_handler(&block)
276283
@handlers[Methods::NOTIFICATIONS_ROOTS_LIST_CHANGED] = block
277284
end

lib/mcp/server_context.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def report_progress(progress, total: nil, message: nil)
3535
# @param data [Object] The log data to send.
3636
# @param level [String] Log level (e.g., `"debug"`, `"info"`, `"error"`).
3737
# @param logger [String, nil] Logger name.
38+
# @deprecated MCP Logging (`logging/setLevel` and `notifications/message`)
39+
# is deprecated as of MCP protocol version 2026-07-28 (SEP-2577).
40+
# Use stderr or OpenTelemetry instead.
3841
def notify_log_message(data:, level:, logger: nil)
3942
return unless @notification_target
4043

@@ -51,6 +54,10 @@ def notify_resources_updated(uri:)
5154
end
5255

5356
# Delegates to the session so the request is scoped to the originating client.
57+
# @deprecated MCP Roots (`roots/list` and
58+
# `notifications/roots/list_changed`) is deprecated as of MCP protocol
59+
# version 2026-07-28 (SEP-2577). Use tool parameters, resource URIs,
60+
# server configuration, or environment variables instead.
5461
def list_roots
5562
if @notification_target.respond_to?(:list_roots)
5663
@notification_target.list_roots(related_request_id: @related_request_id)
@@ -84,6 +91,9 @@ def ping
8491
# Delegates to the session so the request is scoped to the originating client.
8592
# Falls back to `@context` (via `method_missing`) when `@notification_target`
8693
# does not support sampling.
94+
# @deprecated MCP Sampling (`sampling/createMessage`) is deprecated as of
95+
# MCP protocol version 2026-07-28 (SEP-2577). Use direct LLM provider
96+
# APIs instead.
8797
def create_sampling_message(**kwargs)
8898
if @notification_target.respond_to?(:create_sampling_message)
8999
@notification_target.create_sampling_message(**kwargs, related_request_id: @related_request_id)

lib/mcp/server_session.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def client_capabilities
9898
end
9999

100100
# Sends a `roots/list` request scoped to this session.
101+
# @deprecated MCP Roots (`roots/list` and
102+
# `notifications/roots/list_changed`) is deprecated as of MCP protocol
103+
# version 2026-07-28 (SEP-2577). Use tool parameters, resource URIs,
104+
# server configuration, or environment variables instead.
101105
def list_roots(related_request_id: nil)
102106
unless client_capabilities&.dig(:roots)
103107
raise "Client does not support roots."
@@ -115,6 +119,9 @@ def ping(related_request_id: nil)
115119
end
116120

117121
# Sends a `sampling/createMessage` request scoped to this session.
122+
# @deprecated MCP Sampling (`sampling/createMessage`) is deprecated as of
123+
# MCP protocol version 2026-07-28 (SEP-2577). Use direct LLM provider
124+
# APIs instead.
118125
def create_sampling_message(related_request_id: nil, **kwargs)
119126
params = @server.build_sampling_params(client_capabilities, **kwargs)
120127
send_to_transport_request(Methods::SAMPLING_CREATE_MESSAGE, params, related_request_id: related_request_id)
@@ -188,6 +195,9 @@ def notify_progress(progress_token:, progress:, total: nil, message: nil, relate
188195
end
189196

190197
# Sends a log message notification to this session only.
198+
# @deprecated MCP Logging (`logging/setLevel` and `notifications/message`)
199+
# is deprecated as of MCP protocol version 2026-07-28 (SEP-2577).
200+
# Use stderr or OpenTelemetry instead.
191201
def notify_log_message(data:, level:, logger: nil, related_request_id: nil)
192202
effective_logging = @logging_message_notification || @server.logging_message_notification
193203
return unless effective_logging&.should_notify?(level)

0 commit comments

Comments
 (0)