How to receive notifications on mcp client side? #889
Copy link
Copy link
Closed
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedimproves sdk consistencyImproves consistency with other SDKs such as TyepscriptImproves consistency with other SDKs such as Tyepscriptimproves spec complianceWhen a change improves ability of SDK users to comply with spec definitionWhen a change improves ability of SDK users to comply with spec definitionready for workEnough information for someone to start working onEnough information for someone to start working on
Milestone
Description
I am trying to send few logging events to the client during a tool invocation. I am using "Context.info('Hello)" inside a mcp.tool decorated function. I am using FASTMcp for hosting tools. I was expecting to receive these notifications in my ClientSession's "_received_notification" method. But I don't seem to get this to work. I do not see that _received_notification is getting called.
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedimproves sdk consistencyImproves consistency with other SDKs such as TyepscriptImproves consistency with other SDKs such as Tyepscriptimproves spec complianceWhen a change improves ability of SDK users to comply with spec definitionWhen a change improves ability of SDK users to comply with spec definitionready for workEnough information for someone to start working onEnough information for someone to start working on
Activity
kylestratis commentedon Jun 9, 2025
👍
It doesn't seem like notification handling is yet built into the Python SDK
maxisbey commentedon Jan 5, 2026
The SDK partially supports receiving notifications on the client side today:
logging_callbackprogress_callbackoncall_tool()message_handleronlymessage_handleronlymessage_handleronlymessage_handleronlymessage_handleronlymessage_handleronlyFor logging notifications (
Context.info(), etc.), pass alogging_callbacktoClientSession:For progress notifications, pass a
progress_callbackwhen calling a tool:For other notifications (resource/tool/prompt list changes, etc.), use the generic
message_handlerparameter:We do want to add proper dedicated callbacks for all notification types. PR #1611 addresses this but hasn't been reviewed yet.
As this issue is quite old, I'm closing it for now. Feel free to re-open if you have further questions.
AI Disclaimer