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. |
joetannenbaum
left a comment
There was a problem hiding this comment.
Ok, well, just reviewed this not realizing it was a draft 🤦
Regardless, if we decide to ever go with this please refer to my comments.
|
|
||
| use Illuminate\Contracts\Cache\Repository as Cache; | ||
|
|
||
| class SessionStore |
There was a problem hiding this comment.
A whole SessionStore setup seems a bit overblown for this, we're not even using all of the methods. Are we planning on utilizing this in the future for something specific? If not, let's just have the logging manager class interact directly with the cache, right?
There was a problem hiding this comment.
Yeah that can be done.
|
|
||
| public function level(): LogLevel | ||
| { | ||
| return $this->level; |
There was a problem hiding this comment.
If these are never set after the contructor, any reason to not make them just public readonly properties? Instead of getter methods?
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