-
Notifications
You must be signed in to change notification settings - Fork 3.5k
ClientConfig has inconsistent naming: message_handler should be message_callback #2588
Copy link
Copy link
Open
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implementv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implementv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Type
Fields
Give feedbackNo fields configured for issues without a type.
Initial Checks
Description
ClientConfigexposes five user-facing callback fields, but four of them use the*_callbacksuffix while one uses*_handler:The same inconsistency is present in
ClientSession.__init__andServerConnectionParams:A TODO comment in the codebase already flags this:
Proposed Fix
Rename
message_handler→message_callbackconsistently across all three sites:src/mcp/client/client.pymessage_handler→message_callback(field + forwarding call)src/mcp/client/session.pymessage_handlerparameter →message_callback; internal_message_handler→_message_callbacksrc/mcp/client/session_group.pyServerConnectionParams.message_handler→message_callback+ forwarding callsrc/mcp/client/__main__.pySince this is the v2 rewrite on
main, a breaking rename is appropriate and there is no need for a deprecation shim.I'd like to take this on if you're open to a fix.
Python & MCP Python SDK