Conversation
e2b375c to
232f8c8
Compare
232f8c8 to
ef08de4
Compare
joetannenbaum
left a comment
There was a problem hiding this comment.
This looks good overall, just the one nit comment about the cases as opposed to hardcoding, I'll let you make the call there.
Is this the first time we're doing something like $this->addCapability('logging'); as a public facing user API? Is that string essentially arbitrary or are there pre-defined use cases? Either way, for built-in capabilities, do we want to avoid the magic string and provide a helper method such as enableLogging or something similar?
Yes, this is the first time we’re exposing And keeping this opt-in feels right, since most MCP users won’t need logging unless they know exactly what they’re doing. |
|
Kinda want to wait for more demand for this since it's a beefy PR to maintain. |
This PR adds support for the MCP logging utility, allowing servers to send structured log messages to clients.
Logging is opt in. MCP servers will not enable this by default. To turn it on, the user must explicitly add the capability in their MCP server class:
Once enabled, client can send
logging/setLevelrequest. User can log things but filtering won't happen without this capability.How It Works
logging/setLevelto adjust verbosityUsage
Basic Logging
Testing
Configuration