Skip to content

Commit 39f7739

Browse files
committed
ignore type warning for internal use of send_notification
1 parent cf1bb2b commit 39f7739

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/mcp/shared/session.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
SendRequestT = TypeVar("SendRequestT", ClientRequest, ServerRequest)
3737
SendResultT = TypeVar("SendResultT", ClientResult, ServerResult)
3838
SendNotificationT = TypeVar("SendNotificationT", ClientNotification, ServerNotification)
39-
SendNotificationInternalT = TypeVar(
40-
"SendNotificationInternalT",
41-
CancelledNotification,
42-
ClientNotification,
43-
ServerNotification,
44-
)
4539
ReceiveRequestT = TypeVar("ReceiveRequestT", ClientRequest, ServerRequest)
4640
ReceiveResultT = TypeVar("ReceiveResultT", bound=BaseModel)
4741
ReceiveNotificationT = TypeVar(
@@ -308,7 +302,7 @@ async def send_request(
308302
requestId=request_id, reason="cancelled"
309303
),
310304
)
311-
await self._send_notification_internal(
305+
await self._send_notification( # type: ignore
312306
notification, request_id
313307
)
314308
raise McpError(
@@ -349,16 +343,6 @@ async def send_notification(
349343
Emits a notification, which is a one-way message that does not expect
350344
a response.
351345
"""
352-
await self._send_notification_internal(notification, related_request_id)
353-
354-
# this method is required as SendNotificationT type checking prevents
355-
# internal use for sending cancelation - typechecking sorcery may be
356-
# required
357-
async def _send_notification_internal(
358-
self,
359-
notification: SendNotificationInternalT,
360-
related_request_id: RequestId | None = None,
361-
) -> None:
362346
# Some transport implementations may need to set the related_request_id
363347
# to attribute to the notifications to the request that triggered them.
364348
jsonrpc_notification = JSONRPCNotification(

0 commit comments

Comments
 (0)