[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:
parent
1ff9a74521
commit
590afb575b
3 changed files with 120 additions and 0 deletions
|
|
@ -471,6 +471,8 @@ The client can receive requests and notifications from the server when configure
|
|||
|
||||
### Logging Notifications
|
||||
|
||||
> **Deprecated** since protocol revision `2026-07-28` ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), earliest removal `2027-07-28`. Logging keeps working until then; new integrations should log to stderr (stdio) or use OpenTelemetry instead.
|
||||
|
||||
Receive structured log messages from the server:
|
||||
|
||||
```php
|
||||
|
|
@ -504,6 +506,8 @@ $client->setLoggingLevel(LoggingLevel::Info);
|
|||
|
||||
### Sampling (LLM Requests)
|
||||
|
||||
> **Deprecated** since protocol revision `2026-07-28` ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), earliest removal `2027-07-28`. Sampling keeps working until then; new integrations should call an LLM provider's API directly instead.
|
||||
|
||||
Handle server requests for LLM completions:
|
||||
|
||||
```php
|
||||
|
|
@ -673,6 +677,8 @@ elicitation demo server.
|
|||
|
||||
### Roots
|
||||
|
||||
> **Deprecated** since protocol revision `2026-07-28` ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), earliest removal `2027-07-28`. Roots keep working until then; new integrations should pass directories or files through tool arguments, resource URIs or server configuration instead.
|
||||
|
||||
Roots let the client expose a list of `file://` "workspace folders" that the server
|
||||
is allowed to operate on. Advertise the `roots` capability and register a handler
|
||||
that answers server `roots/list` requests:
|
||||
|
|
|
|||
|
|
@ -601,6 +601,8 @@ public function generatePrompt(string $topic, string $style): array
|
|||
|
||||
## Logging
|
||||
|
||||
> **Deprecated** since protocol revision `2026-07-28` ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), earliest removal `2027-07-28`. Logging keeps working until then; new integrations should log to stderr (stdio) or use OpenTelemetry instead.
|
||||
|
||||
The SDK provides support to send structured log messages to clients. All standard PSR-3 log levels are supported.
|
||||
Level **warning** as the default level.
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ if ($context->getProtocolVersion()->isAtLeast(ProtocolVersion::V2026_07_28)) {
|
|||
|
||||
## Sampling
|
||||
|
||||
> **Deprecated** since protocol revision `2026-07-28` ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), earliest removal `2027-07-28`. Sampling keeps working until then; new integrations should call an LLM provider's API directly instead.
|
||||
|
||||
With [sampling](https://modelcontextprotocol.io/specification/2025-11-25/client/sampling) servers can request clients to
|
||||
execute "completions" or "generations" with a language model for them:
|
||||
|
||||
|
|
@ -90,6 +92,8 @@ Use `$result->getContentBlocks()` to iterate the response regardless of whether
|
|||
|
||||
## Logging
|
||||
|
||||
> **Deprecated** since protocol revision `2026-07-28` ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577)), earliest removal `2027-07-28`. Logging keeps working until then; new integrations should log to stderr (stdio) or use OpenTelemetry instead.
|
||||
|
||||
The [Logging](https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/logging) utility enables servers
|
||||
to send structured log messages as notification to clients:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue