modelcontextprotocol / modelcontextprotocol/python-sdk

Option to not rewrite the logging configuration

Offen
#420 11 Kommentare 23 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement needs decision P1
Vorherrschende Sprache
Python
Sterne
24.3k
Forks
4k
Ø Merge
1 T. 1 Std.
Gemergte PRs (30 T.)
31

Beschreibung

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:

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in src/mcp/server/fastmcp/server.py beim configure_logging-Aufruf ungefähr in Zeile 138 und bei der uvicorn-Konfiguration ungefähr in Zeile 471. Verfolge, wie log_level und log_config im SSE-Modus übergeben werden, und definiere und überprüfe die Option, die die Logging-Konfiguration der Host-Anwendung unverändert lässt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.