1010from mcp .shared .session import BaseSession , RequestResponder
1111from mcp .shared .version import SUPPORTED_PROTOCOL_VERSIONS
1212
13+ DEFAULT_CLIENT_INFO = types .Implementation (name = "mcp" , version = "0.1.0" )
14+
1315
1416class SamplingFnT (Protocol ):
1517 async def __call__ (
@@ -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 supported_protocol_versions : tuple [str | int , ...] | None = None ,
101104 ) -> None :
102105 super ().__init__ (
@@ -106,6 +109,7 @@ def __init__(
106109 types .ServerNotification ,
107110 read_timeout_seconds = read_timeout_seconds ,
108111 )
112+ self ._client_info = client_info or DEFAULT_CLIENT_INFO
109113 self ._sampling_callback = sampling_callback or _default_sampling_callback
110114 self ._list_roots_callback = list_roots_callback or _default_list_roots_callback
111115 self ._logging_callback = logging_callback or _default_logging_callback
@@ -134,7 +138,7 @@ async def initialize(self) -> types.InitializeResult:
134138 experimental = None ,
135139 roots = roots ,
136140 ),
137- clientInfo = types . Implementation ( name = "mcp" , version = "0.1.0" ) ,
141+ clientInfo = self . _client_info ,
138142 ),
139143 )
140144 ),
0 commit comments