Skip to content
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 support for server logging messages #185

Merged

Conversation

cliffhall
Copy link
Contributor

In useConnection.ts,

  • import LoggingMessageNotificationSchema
  • set onNotification as notification handler for LoggingMessageNotificationSchema

This fixes #184

Motivation and Context

As #184 demonstrates, logging notifications from the server were not being displayed in the inspector.

How Has This Been Tested?

I added functionality to the modelcontextprotocol/servers project, which sends randomly-leveled log messages every 15 seconds.
Screenshot 2025-03-13 at 3 04 13 PM

Breaking Changes

Nope.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

- import LoggingMessageNotificationSchema
- set onNotification as notification handler for LoggingMessageNotificationSchema
@olaservo
Copy link
Collaborator

I think this is good to merge just had a minor comment on the related PR, thinking that one can go first. modelcontextprotocol/servers#847

@cliffhall
Copy link
Contributor Author

cliffhall commented Mar 15, 2025

I think this is good to merge just had a minor comment on the related PR, thinking that one can go first. modelcontextprotocol/servers#847

Added comments over there, but I'd be happy to add it to these PRs. Shouldn't make them that much more complicated.

I just don't want the branches to get far out of sync.

@olaservo olaservo merged commit cedf02d into modelcontextprotocol:main Mar 15, 2025
2 checks passed
@olaservo
Copy link
Collaborator

I went ahead and merged this one since they are not strictly dependent on each other and this one was already updated from main and passing checks.

@cliffhall
Copy link
Contributor Author

I went ahead and merged this one since they are not strictly dependent on each other and this one was already updated from main and passing checks.

Thanks, I'll set up another issue in inspector and servers projects describing the level set/respect problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inspector does not report log messages
2 participants