-
Notifications
You must be signed in to change notification settings - Fork 59
Add Logging Support #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Logging Support #119
Conversation
e2b375c to
232f8c8
Compare
232f8c8 to
ef08de4
Compare
joetannenbaum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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