Skip to content

refactor(client): rename message handler callback#2596

Closed
MukundaKatta wants to merge 1 commit into
modelcontextprotocol:mainfrom
MukundaKatta:codex/python-sdk-message-callback
Closed

refactor(client): rename message handler callback#2596
MukundaKatta wants to merge 1 commit into
modelcontextprotocol:mainfrom
MukundaKatta:codex/python-sdk-message-callback

Conversation

@MukundaKatta

Copy link
Copy Markdown

Summary

  • Rename client-facing message_handler parameters/fields to message_callback for consistency with the other callback options
  • Update ClientSession, Client, ClientSessionParameters, CLI wiring, tests, and migration docs

Closes #2588

Testing

  • uv run ruff check src/mcp/client/client.py src/mcp/client/session.py src/mcp/client/session_group.py src/mcp/client/__main__.py tests/client/test_session.py tests/client/test_session_group.py tests/client/test_logging_callback.py tests/client/test_notification_response.py tests/experimental/tasks/client/test_handlers.py tests/experimental/tasks/server/test_server.py tests/server/mcpserver/test_integration.py tests/server/test_session.py tests/shared/test_progress_notifications.py tests/shared/test_session.py tests/shared/test_streamable_http.py
  • uv run ruff format --check src/mcp/client/client.py src/mcp/client/session.py src/mcp/client/session_group.py src/mcp/client/__main__.py tests/client/test_session.py tests/client/test_session_group.py tests/client/test_logging_callback.py tests/client/test_notification_response.py tests/experimental/tasks/client/test_handlers.py tests/experimental/tasks/server/test_server.py tests/server/mcpserver/test_integration.py tests/server/test_session.py tests/shared/test_progress_notifications.py tests/shared/test_session.py tests/shared/test_streamable_http.py
  • uv run pytest tests/client/test_logging_callback.py tests/client/test_notification_response.py tests/client/test_session.py tests/client/test_session_group.py tests/experimental/tasks/client/test_handlers.py tests/experimental/tasks/server/test_server.py tests/server/mcpserver/test_integration.py tests/server/test_session.py tests/shared/test_progress_notifications.py tests/shared/test_session.py tests/shared/test_streamable_http.py -q

@maxisbey

Copy link
Copy Markdown
Contributor

Thanks for the PR. Per our CONTRIBUTING.md we ask that PRs start from a linked, triaged issue with maintainer buy-in, which this one doesn't have yet. I'm closing this out as part of a backlog cleanup around the v2 release. Feel free to reopen if this is still relevant.

AI Disclaimer

@maxisbey maxisbey closed this Jul 24, 2026
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.

ClientConfig has inconsistent naming: message_handler should be message_callback

2 participants