modelcontextprotocol / modelcontextprotocol/python-sdk

Option to not rewrite the logging configuration

Open
#420 11 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs decision P1
Dominant language
Python
Stars
24.3k
Forks
4k
Avg merge
1d 1h
Merged PRs (30d)
31

Description

Is your feature request related to a problem? Please describe.
We are integrating FastMcp into a larger python process that requires a custom logging handler and when initialising the FastMCP server (in our case in sse mode) we see that the logging library configuration changes with a custom configuration of the server itself.

Describe the solution you'd like
Define a configuration parameter that disables the logging configuration performed by the server.

Describe alternatives you've considered
Reviewing the configuration parameters I have seen the existence of the parameter log_level (https://github.com/modelcontextprotocol/python-sdk/blob/c2ca8e03e046908935d089a2ceed4e80b0c29a24/src/mcp/server/fastmcp/server.py#L71) and perhaps if this parameter allowed the value None this could prevent the reconfiguration from being carried out.

Additional context
As far as I have been able to identify, there are two points where this configuration is being made and which should be modified:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/mcp/server/fastmcp/server.py at the configure_logging call around line 138 and the uvicorn configuration around line 471. Trace how log_level and log_config are passed in SSE mode, then define and verify the option that leaves the host application's logging configuration unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.