File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1111from mcp .shared .version import SUPPORTED_PROTOCOL_VERSIONS
1212
1313
14+ _DEFAULT_CLIENT_INFO = types .Implementation (name = "mcp" , version = "0.1.0" )
15+
1416class SamplingFnT (Protocol ):
1517 async def __call__ (
1618 self ,
@@ -97,6 +99,7 @@ def __init__(
9799 list_roots_callback : ListRootsFnT | None = None ,
98100 logging_callback : LoggingFnT | None = None ,
99101 message_handler : MessageHandlerFnT | None = None ,
102+ client_info : types .Implementation | None = None ,
100103 ) -> None :
101104 super ().__init__ (
102105 read_stream ,
@@ -105,6 +108,7 @@ def __init__(
105108 types .ServerNotification ,
106109 read_timeout_seconds = read_timeout_seconds ,
107110 )
111+ self ._client_info = client_info or _DEFAULT_CLIENT_INFO
108112 self ._sampling_callback = sampling_callback or _default_sampling_callback
109113 self ._list_roots_callback = list_roots_callback or _default_list_roots_callback
110114 self ._logging_callback = logging_callback or _default_logging_callback
@@ -130,7 +134,7 @@ async def initialize(self) -> types.InitializeResult:
130134 experimental = None ,
131135 roots = roots ,
132136 ),
133- clientInfo = types . Implementation ( name = "mcp" , version = "0.1.0" ) ,
137+ clientInfo = self . _client_info ,
134138 ),
135139 )
136140 ),
You can’t perform that action at this time.
0 commit comments