-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Low level MCP server now uses FastMCP log level #1485
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?
Conversation
…erver", debug=True, log_level='DEBUG')
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.
Hi @daamitt thank you for this contribution!
Could you add a small test in tests/server/fastmcp/test_server.py
that demonstrates the new logging behavior?
The description suggests this is a bugfix and that FastMCP
wasn't receiving the logging level information before. It'd be great to have a regression test for this to prevent this in future.
I'd also appreciate some testing evidence showing how it wasn't working before the fix, and how it is working now after the fix (along side the unit tests requested by @felixweinberger ) |
Not sure if this can be captured by a test case, its a very small change that only affects the low level server logs (which i found very useful to track down a race condition Merged PR) Here is the before and after of this fix using
Before
After
|
There are already tests in there that assert on logging - you could take inspiration from those for example? python-sdk/tests/server/fastmcp/test_server.py Lines 972 to 973 in b8e758b
|
Low level MCP server now uses log level set by FastMCP(name="My MCP Server", debug=True, log_level='DEBUG')
Motivation and Context
When logging level is set in code at the FastMCP server, this change percolates it to the low lever server by configuring the logging before low level server init.
How Has This Been Tested?
uv run pytest :
Results (18.58s):
653 passed
2 skipped
1 xfailed
Breaking Changes
No
Types of changes
Checklist
Additional context