Skip to content

Conversation

freeznet
Copy link

Exposed the optional MCP message_handler, letting each transport surface the hook and ensuring the base session forwards it on.

@seratch seratch added enhancement New feature or request feature:mcp labels Sep 24, 2025
@seratch
Copy link
Member

seratch commented Sep 24, 2025

Thanks for sending this PR. Since this SDK doesn’t support MCP sessions, I’m not sure how valuable this exposure actually is.

@seratch seratch marked this pull request as draft September 24, 2025 03:25
@freeznet
Copy link
Author

@seratch Appreciate the look! Even though we don’t surface full MCP sessions to SDK consumers yet, these server helpers already spin up ClientSession instances under the hood. Several integrations are relying on notifications (tools list changes, etc.), and today there’s no way to intercept those without forking the server classes. By threading the optional message_handler through we let advanced users react to those notifications to bridging server events into agent logic, without changing default behaviour. Since the hook is a straight pass-through, it stays no-op unless someone opts in, so the surface risk is very low while unblocking that customization point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:mcp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants