AI Hints
Home›MCP Tutorial›Caching and Changes
MCP · Lesson 84 of 120

Deprecated Features

Logging and sampling.

⏱ 2 min read▶ Video at 1:14:49🎓 Free
Watch this lesson in the MCP courseWatch on YouTube ↗Full MCP course

The newest revision also deprecated two more features. Logging, where servers sent log messages to the client. And sampling, where servers asked the client's model to write text. Older code still uses them, so it helps to know what to do instead.

Deprecated Features
From the video: Deprecated Features
  • Logging
  • Sampling
  • Roots

What to use instead

Instead of protocol logging, write logs to standard error, or your own logging service. Instead of sampling, call a model directly from your server, with your own key. Instead of roots, use configuration.

DeprecatedUse instead
loggingstderr or your own logs
samplingcall a model API yourself
rootsconfiguration

Why they went

Each one needed the server to send requests back to the client, in the middle of a call. That made servers harder to scale, and clients harder to build. Elicitation stayed, in a simpler form.

keyvalue
Problemserver-to-client requests
Costhard to scale
Keptelicitation
New forminput required

Summary

Logging, sampling, and roots are deprecated. Use standard error, your own model calls, and configuration. Next, testing a server.

Key takeaways
  • stderr
  • Own model calls
  • Config
Next up: Testing a Server — pytest in-process