File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ async def initialize(self) -> types.InitializeResult:
140140 )
141141 ),
142142 types .InitializeResult ,
143+ cancellable = False
143144 )
144145
145146 if result .protocolVersion not in SUPPORTED_PROTOCOL_VERSIONS :
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ async def send_request(
216216 result_type : type [ReceiveResultT ],
217217 request_read_timeout_seconds : timedelta | None = None ,
218218 metadata : MessageMetadata = None ,
219+ cancellable : bool = True ,
219220 ) -> ReceiveResultT :
220221 """
221222 Sends a request and wait for a response. Raises an McpError if the
@@ -260,7 +261,7 @@ async def send_request(
260261 with anyio .fail_after (timeout ) as scope :
261262 response_or_error = await response_stream_reader .receive ()
262263
263- if scope .cancel_called :
264+ if cancellable and scope .cancel_called :
264265 with anyio .CancelScope (shield = True ):
265266 notification = CancelledNotification (
266267 method = "notifications/cancelled" ,
You can’t perform that action at this time.
0 commit comments