Skip to content

Commit 272b3bd

Browse files
committed
make BaseClientSession inherit from CommonBaseSession
1 parent 2ab20a2 commit 272b3bd

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/mcp/client/base_client_session.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
from typing import Any
33

44
from mcp import types
5-
from mcp.shared.session import ProgressFnT
5+
from mcp.shared.session import CommonBaseSession, ProgressFnT
66
from mcp.types._types import RequestParamsMeta
77

88
# from mcp.shared.session import CommonBaseSession
99

10-
class BaseClientSession:
10+
class BaseClientSession(
11+
CommonBaseSession[
12+
types.ClientRequest,
13+
types.ClientNotification,
14+
types.ClientResult,
15+
types.ServerRequest,
16+
types.ServerNotification,
17+
]
18+
):
1119
"""Base class for client transport sessions.
1220
1321
The class provides all the methods that a client session should implement,
@@ -24,17 +32,6 @@ async def send_ping(self, *, meta: RequestParamsMeta | None = None) -> types.Emp
2432
"""Send a ping request."""
2533
raise NotImplementedError
2634

27-
@abstractmethod
28-
async def send_progress_notification(
29-
self,
30-
progress_token: types.ProgressToken,
31-
progress: float,
32-
total: float | None = None,
33-
message: str | None = None,
34-
) -> None:
35-
"""Sends a progress notification for a request that is currently being processed."""
36-
raise NotImplementedError
37-
3835
@abstractmethod
3936
async def list_resources(self, *, params: types.PaginatedRequestParams | None = None) -> types.ListResourcesResult:
4037
"""Send a resources/list request.

src/mcp/shared/session.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def __init__(
185185
self._write_stream = write_stream
186186
self._session_read_timeout_seconds = read_timeout_seconds
187187
self._response_streams = {}
188+
self._task_group = anyio.create_task_group()
188189

189190
@abstractmethod
190191
async def send_request(

0 commit comments

Comments
 (0)