Skip to content

Commit 3f977b3

Browse files
committed
rename classes
1 parent 380710e commit 3f977b3

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

src/mcp/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from .client.session import ClientSession
2+
from .client.transport_session import ClientTransportSession
3+
from .server.transport_session import ServerTransportSession
24
from .client.session_group import ClientSessionGroup
35
from .client.stdio import StdioServerParameters, stdio_client
46
from .server.session import ServerSession
@@ -113,4 +115,6 @@
113115
"stdio_server",
114116
"CompleteRequest",
115117
"JSONRPCResponse",
118+
"ClientTransportSession",
119+
"ServerTransportSession",
116120
]

src/mcp/client/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing_extensions import deprecated
1010

1111
import mcp.types as types
12-
from mcp.client.transport_session import TransportSession
12+
from mcp.client.transport_session import ClientTransportSession
1313
from mcp.shared.context import RequestContext
1414
from mcp.shared.message import SessionMessage
1515
from mcp.shared.session import BaseSession, ProgressFnT, RequestResponder
@@ -101,7 +101,7 @@ async def _default_logging_callback(
101101

102102

103103
class ClientSession(
104-
TransportSession,
104+
ClientTransportSession,
105105
BaseSession[
106106
types.ClientRequest,
107107
types.ClientNotification,

src/mcp/client/transport_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mcp.shared.session import ProgressFnT
99

1010

11-
class TransportSession(ABC):
11+
class ClientTransportSession(ABC):
1212
"""Abstract base class for communication transports."""
1313

1414
@abstractmethod

src/mcp/server/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async def handle_list_prompts(ctx: RequestContext) -> list[types.Prompt]:
4747

4848
import mcp.types as types
4949
from mcp.server.models import InitializationOptions
50-
from mcp.server.transport_session import TransportSession
50+
from mcp.server.transport_session import ServerTransportSession
5151
from mcp.shared.message import ServerMessageMetadata, SessionMessage
5252
from mcp.shared.session import (
5353
BaseSession,
@@ -70,7 +70,7 @@ class InitializationState(Enum):
7070

7171

7272
class ServerSession(
73-
TransportSession,
73+
ServerTransportSession,
7474
BaseSession[
7575
types.ServerRequest,
7676
types.ServerNotification,
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
"""Abstract base class for transport sessions."""
22

3-
import abc
3+
from abc import ABC, abstractmethod
44
from typing import Any
55

66
from pydantic import AnyUrl
77

88
import mcp.types as types
99

1010

11-
class TransportSession(abc.ABC):
11+
class ServerTransportSession(ABC):
1212
"""Abstract base class for transport sessions."""
1313

14-
@abc.abstractmethod
14+
@abstractmethod
1515
async def send_log_message(
1616
self,
1717
level: types.LoggingLevel,
@@ -22,17 +22,17 @@ async def send_log_message(
2222
"""Send a log message notification."""
2323
raise NotImplementedError
2424

25-
@abc.abstractmethod
25+
@abstractmethod
2626
async def send_resource_updated(self, uri: AnyUrl) -> None:
2727
"""Send a resource updated notification."""
2828
raise NotImplementedError
2929

30-
@abc.abstractmethod
30+
@abstractmethod
3131
async def list_roots(self) -> types.ListRootsResult:
3232
"""Send a roots/list request."""
3333
raise NotImplementedError
3434

35-
@abc.abstractmethod
35+
@abstractmethod
3636
async def elicit(
3737
self,
3838
message: str,
@@ -42,12 +42,12 @@ async def elicit(
4242
"""Send an elicitation/create request."""
4343
raise NotImplementedError
4444

45-
@abc.abstractmethod
45+
@abstractmethod
4646
async def send_ping(self) -> types.EmptyResult:
4747
"""Send a ping request."""
4848
raise NotImplementedError
4949

50-
@abc.abstractmethod
50+
@abstractmethod
5151
async def send_progress_notification(
5252
self,
5353
progress_token: str | int,
@@ -59,17 +59,17 @@ async def send_progress_notification(
5959
"""Send a progress notification."""
6060
raise NotImplementedError
6161

62-
@abc.abstractmethod
62+
@abstractmethod
6363
async def send_resource_list_changed(self) -> None:
6464
"""Send a resource list changed notification."""
6565
raise NotImplementedError
6666

67-
@abc.abstractmethod
67+
@abstractmethod
6868
async def send_tool_list_changed(self) -> None:
6969
"""Send a tool list changed notification."""
7070
raise NotImplementedError
7171

72-
@abc.abstractmethod
72+
@abstractmethod
7373
async def send_prompt_list_changed(self) -> None:
7474
"""Send a prompt list changed notification."""
7575
raise NotImplementedError

0 commit comments

Comments
 (0)