11"""Abstract base class for transport sessions."""
22
3- import abc
3+ from abc import ABC , abstractmethod
44from typing import Any
55
66from pydantic import AnyUrl
77
88import 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