Set Log Levels at Runtime
Let clients turn verbosity up or down.
Verbosity on Demand
Sometimes a user wants quiet logs, sometimes deep detail. MCP lets the client set a log level at runtime instead of restarting the server.
The setLevel Request
The client sends a logging/setLevel request naming the lowest level it wants. This is a request, so the server replies to confirm.
{"method": "logging/setLevel",
"params": {"level": "warning"}}All lessons in this course
- Send Progress for Long Tasks
- Handle Cancellation Requests
- Structured Logging to the Client
- Set Log Levels at Runtime