modelcontextprotocol / modelcontextprotocol/python-sdk
Option to not rewrite the logging configuration
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 24.3k
- Forks
- 4k
- Merge médio
- 1d 1h
- PRs com merge (30d)
- 31
Descrição
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.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece em src/mcp/server/fastmcp/server.py, na chamada de configure_logging por volta da linha 138, e na configuração do uvicorn por volta da linha 471. Rastreie como log_level e log_config são passados no modo SSE e, em seguida, defina e verifique a opção que deixa inalterada a configuração de logging da aplicação host.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- backend
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Pouca atividade
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 68/100