[Schema][Client][Server] Deprecate Roots, Sampling and Logging (SEP-2577) (#427)

* [Schema][Client][Server] Deprecate Roots, Sampling and Logging (SEP-2577)

* Emit runtime deprecation notices and document the migration (SEP-2596)
This commit is contained in:
Christopher Hertel 2026-08-18 01:23:32 +02:00 • committed by GitHub
commit 590afb575b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,9 @@ use Mcp\Schema\Notification\LoggingMessageNotification;
* Handler for logging message notifications from the server.
*
* @author Kyrian Obikwelu <koshnawaza@gmail.com>
*
* @deprecated since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28.
* Log to stderr (stdio) or use OpenTelemetry instead.
*/
class LoggingNotificationHandler implements NotificationHandlerInterface
{
@ -27,6 +30,7 @@ class LoggingNotificationHandler implements NotificationHandlerInterface
public function __construct(
private readonly mixed $callback,
) {
trigger_deprecation('mcp/sdk', '0.8', 'MCP logging is deprecated since protocol revision 2026-07-28 (SEP-2577); log to stderr or use OpenTelemetry instead.');
}
public function supports(Notification $notification): bool