Skip to content

Commit 768932a

Browse files
committed
clientsession and server session to implement abstract classes
1 parent 5083654 commit 768932a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/mcp/client/session.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from mcp.shared.session import BaseSession, ProgressFnT, RequestResponder
1515
from mcp.shared.version import SUPPORTED_PROTOCOL_VERSIONS
1616

17+
from src.mcp.client.transport_session import TransportSession
18+
1719
DEFAULT_CLIENT_INFO = types.Implementation(name="mcp", version="0.1.0")
1820

1921
logger = logging.getLogger("client")
@@ -100,6 +102,7 @@ async def _default_logging_callback(
100102

101103

102104
class ClientSession(
105+
TransportSession,
103106
BaseSession[
104107
types.ClientRequest,
105108
types.ClientNotification,

src/mcp/server/session.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ async def handle_list_prompts(ctx: RequestContext) -> list[types.Prompt]:
5454
)
5555
from mcp.shared.version import SUPPORTED_PROTOCOL_VERSIONS
5656

57+
from src.mcp.server.transport_session import TransportSession
58+
5759

5860
class InitializationState(Enum):
5961
NotInitialized = 1
@@ -69,6 +71,7 @@ class InitializationState(Enum):
6971

7072

7173
class ServerSession(
74+
TransportSession,
7275
BaseSession[
7376
types.ServerRequest,
7477
types.ServerNotification,

0 commit comments

Comments
 (0)