Skip to content

Conversation

Rakib-hosen
Copy link

@Rakib-hosen Rakib-hosen commented Mar 31, 2025

Motivation and Context

According to the MCP spec, context logging functions should accept any JSON-serializable type as the message parameter.
#397

How Has This Been Tested?

this has been tested with :
Integers (42)
Lists (["list", "of", "items"])
Dictionaries ({"key": "value"})
Floating point numbers (3.14)
string

Breaking Changes

None

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

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.

While this PR correctly makes the type hints match the MCP specification, I'm rejecting it because:

  1. No compelling use case is presented for why SDK users need to pass non-string values directly as log messages. The current pattern of string messages + structured extra data is standard in Python.

  2. The underlying implementation already handles JSON-serializable data correctly; this is just a type hint change.

  3. Focus on established logging patterns is more important than maximal flexibility without clear benefit.

If you have specific use cases where passing non-string values as primary log messages (instead of using the extra parameters) is valuable, please resubmit with those examples and rationale.

@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
…te-mcp-server-quickstart-docs

docs: fix broken C# code sample for MCP Server
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.

3 participants