Skip to content

Conversation

antholeole
Copy link

@antholeole antholeole commented Jul 11, 2025

after a connection is established, send a setLoggingLevel request

#610

Motivation and Context

How Has This Been Tested?

manually, but this is a very small change. i could write unit if required

Breaking Changes

None

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

Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to add the setLoggingLevel to match the default selected level. I just had one comment. (And I think you have some linting errors that are failing the CI.)

Side note, I think the title of the issue you linked to this PR ("The MCP spec for logging requires a setLevel message before logs should be emitted ") doesn't seem accurate, since a server could still emit logs without this being set.

@olaservo olaservo added the waiting on submitter Waiting for the submitter to provide more info label Jul 14, 2025
@olaservo olaservo removed the waiting on submitter Waiting for the submitter to provide more info label Jul 26, 2025
@antholeole
Copy link
Author

@olaservo I see you added the waiting for submitter tag - is there something else to do on my end? I thought I addressed your comment, lmk if there’s anything else you want from me :)

@olaservo olaservo enabled auto-merge July 31, 2025 04:17
olaservo
olaservo previously approved these changes Jul 31, 2025
@olaservo
Copy link
Member

Hi @antholeole , I'm good to merge this but for some reason some new formatting issues are showing up in the CI checks - could you resolve that? (If I make those changes it won't count my approval.) Thanks!

@antholeole
Copy link
Author

Sgtm, will fix this tomorrow, thanks for taking another look.

auto-merge was automatically disabled July 31, 2025 17:21

Head branch was pushed to by a user without write access

@olaservo olaservo enabled auto-merge August 1, 2025 01:13
Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@olaservo olaservo merged commit 21bb004 into modelcontextprotocol:main Aug 1, 2025
5 checks passed
@KKonstantinov
Copy link
Contributor

Hello,

This seem to lead to an issue discussed in #699, especially the code in useConnection

https://github.com/modelcontextprotocol/inspector/pull/611/files#diff-1308b8974395372ca4d89e566b653312adcb1a690a926bb21431639928db2701R566-R569

Please check?

@KKonstantinov
Copy link
Contributor

KKonstantinov commented Aug 12, 2025

And here is what happens:

whenever logging/setLevel is called, the MCP server has no default handler for this request, therefore it goes into the "Method not found" flow.

To resolve it, the MCP server has to register a requestHandler for this method, however I would consider this worth reverting until a more graceful way to handle this is implemented.

image

Temporary workarounds (if server in your control)

  • Disable the "logging" capabilities of your server
  • If you wish to leave them enabled, add a requestHandler to your server like so
server.setRequestHandler(SetLevelRequestSchema, request => {
                        console.log(`--- Logging level: ${request.params.level}`);
                        return {};
                    });

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.

3 participants