Skip to content

Commit 39995aa

Browse files
committed
fix: add ReceiveResultT into Base Session
1 parent c3b9a0b commit 39995aa

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/mcp/client/session.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ async def _default_logging_callback(
9696

9797
class ClientSession(
9898
BaseSession[
99-
types.ClientRequest,
100-
types.ClientNotification,
101-
types.ClientResult,
102-
types.ServerRequest,
103-
types.ServerNotification,
99+
types.ClientRequest, # SendRequestT
100+
types.ClientNotification, # SendNotificationT
101+
types.ClientResult, # SendResultT
102+
types.ServerRequest, # ReceiveRequestT
103+
Any, # ReceiveResultT,兼容所有服务端返回结果类型
104+
types.ServerNotification, # ReceiveNotificationT
104105
]
105106
):
106107
def __init__(

src/mcp/server/session.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class ServerSession(
7474
types.ServerNotification,
7575
types.ServerResult,
7676
types.ClientRequest,
77+
Any,
7778
types.ClientNotification,
7879
]
7980
):

0 commit comments

Comments
 (0)