Skip to content

fix: Remove logging initialization from MCPServer.__init__#2004

Open
SimonZehetner wants to merge 1 commit intomodelcontextprotocol:mainfrom
SimonZehetner:remove-logging-init-1656
Open

fix: Remove logging initialization from MCPServer.__init__#2004
SimonZehetner wants to merge 1 commit intomodelcontextprotocol:mainfrom
SimonZehetner:remove-logging-init-1656

Conversation

@SimonZehetner
Copy link

Motivation and Context

Fixes #1656

How Has This Been Tested?

Breaking Changes

Removed mcp.server.mcpserver.utilities.logging.configure_logging

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

I removed mcp.server.mcpserver.utilities.logging.configure_logging, as this was the only usage.
I also checked the examples, and most of them had logging.basicConfig in them or no logging at all.

I was uncertain about moving the call to configure_logging to MCPServer.run_sse_async or MCPServer.run_streamable_http_async because they set up uvicorn with logging. However, I ultimately decided against it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FastMCP configures logging on init, which messes up application-level logging

1 participant