modelcontextprotocol / modelcontextprotocol/python-sdk
Option to not rewrite the logging configuration
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 24.3k
- Forks
- 4k
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 31
Descripción
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:
- The call to the configure_logging method (https://github.com/modelcontextprotocol/python-sdk/blob/c2ca8e03e046908935d089a2ceed4e80b0c29a24/src/mcp/server/fastmcp/server.py#L138), which should be prevented.
- The configuration of uvicorn (https://github.com/modelcontextprotocol/python-sdk/blob/c2ca8e03e046908935d089a2ceed4e80b0c29a24/src/mcp/server/fastmcp/server.py#L471) that if the parameters log_config and log_level are not None also makes the change.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en src/mcp/server/fastmcp/server.py, en la llamada a configure_logging alrededor de la línea 138, y en la configuración de uvicorn alrededor de la línea 471. Sigue cómo se pasan log_level y log_config en el modo SSE y, después, define y verifica la opción que deja sin cambios la configuración de logging de la aplicación host.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 68/100