Skip to content

Conversation

Gujiawei-Edinburgh
Copy link

@Gujiawei-Edinburgh Gujiawei-Edinburgh commented Apr 7, 2025

Motivation and Context

After the request context is assigned, the logging can add extra trace info to the log content.

How Has This Been Tested?

Yes

Breaking Changes

No

Types of changes

  • [x ] 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

  • [x ] I have read the MCP Documentation
  • [ x] 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

@Gujiawei-Edinburgh Gujiawei-Edinburgh marked this pull request as draft April 8, 2025 01:35
@Gujiawei-Edinburgh Gujiawei-Edinburgh marked this pull request as ready for review April 8, 2025 01:36
Copy link

@mcp-shadow mcp-shadow bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution to the MCP Python SDK. After reviewing change, I'm rejecting this PR for the following reasons:

  1. Insufficient justification: While you mention that logging can add extra trace info when called after the context assignment, there's no evidence provided that this is causing issues or that trace information is currently missing from logs. The PR doesn't demonstrate what specific trace information would be improved.

  2. Reduced logging visibility: Your change removes a debug-level log statement entirely, which reduces the observability of the request handling process. The current approach provides two log entries (one at info level for processing, one at debug level for dispatching), which is valuable for troubleshooting.

  3. Change in error logging behavior: If an exception occurs during context setup, the current implementation ensures the request is still logged, whereas your change would result in no log entry for failed requests where the context couldn't be established.

  4. Maintenance cost vs. benefit: The MCP Python SDK strives to minimize unnecessary changes to reduce maintenance burden. Without a clear demonstration of the issue being solved or substantial improvement to logging functionality, this change does not meet our threshold for inclusion.

@mcp-shadow mcp-shadow bot closed this May 13, 2025
gspencergoog pushed a commit to gspencergoog/mcp-python-sdk that referenced this pull request Jul 29, 2025
Closes modelcontextprotocol#380
Closes modelcontextprotocol#448
Closes modelcontextprotocol#471
Closes modelcontextprotocol#492

Co-authored-by: Rahul Lashkari <rahul.lsh.connect@gmail.com>
Co-authored-by: Dimitris Tsapakidis <dimitris@tsapakidis.com>
Co-authored-by: Jayde Mitchell <jayde@jaydemitchell.com>
Co-authored-by: Jose Sebastian <josesebastian@Joses-MacBook-Air.local>
Co-authored-by: "Yaroslav O. Halchenko" <debian@onerussian.com>
Co-authored-by: Den Delimarsky 🌺 <53200638+localden@users.noreply.github.com>
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.

1 participant