-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add periodic logging messages to Everything server. #847
Add periodic logging messages to Everything server. #847
Conversation
modelcontextprotocol/inspector#184 The user who created the issue provided a python test server to send dummy messages, but I expected that the 'everything server' would be exercising this capability, but it wasn't. So I decided to add that functionality at the same time as fixing the inspector. In src/everything/everything.ts - add logsUpdateInterval - use setInterval to send a random-leveled log message every 15 seconds
I haven't worked with as many PRs in this repo yet so I'm not clear on what is causing the failures here - could you update your branch using the latest from main and we can re-run the workflows after that? |
@olaservo There's not anything broken here, it's just that the Everything server seemed the right place to send some messages to the client for testing that functionality. The problem was really there. |
@olaservo I've got a fix in the UI for letting you send set level requests The respecting of log level setting by the Everything server depends on the work in this PR. I've started that on another branch. It would be nice if this branch was merged so I can carry on with that. I could alternatively merge this branch into that one and carry on. |
@cliffhall thanks, sorry by 'failures' I meant the failed checks showing up on the PR here. Looking at other PRs I think this is expected and it allows me to merge, but I'm double checking with other contributors to see if there's any special guidance here. |
No idea what the problem with that would be. Looking into it as well. UPDATE: |
* This fixes modelcontextprotocol#868 * In everything.ts - import LoggingLevel from sdk - add log messages for all levels - add isMessageIgnored function that checks the incoming level against the logLevel and returns false if it is a lower index than the logLevel - in the setInterval for sending dummy logs, only send the message if it is not ignored by the logLevel.
@olaservo I went ahead and added the respect log level functionality to this branch. |
The package-lock was just out of sync so if you get the latest from main again these should all pass now, thank you for your patience. |
Updated the branch and the README.md. Should be all good. |
Description
Send periodic log messages to client, respecting the log level set by the client
Server Details
Motivation and Context
In the Inspector, it was reported that log messages from the server were not being displayed. The user who created the issue provided a python test server to send dummy messages, which used FastMCP. I wanted to test this with a reference server that didn't use any outside MCP libraries, to avoid any possible problems in the other project.
I expected that the 'everything server' would be exercising this capability, but it wasn't. So I decided to add that functionality at the same time as fixing the inspector.
How Has This Been Tested?
Used the output from this change to test the Inspector fix (where messages weren't getting through) and that the messages being sent are higher in severity than or equal to the selected level in the Inspector Logging Level dropdown

Breaking Changes
Nope.
Types of changes
Checklist
Additional context