Skip to content

Commit 5e62109

Browse files
committed
move functionality to after protocolVersion check
1 parent db43067 commit 5e62109

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mcp/client/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ async def initialize(self) -> types.InitializeResult:
167167
types.InitializeResult,
168168
)
169169

170-
if self._client_info is DEFAULT_CLIENT_INFO:
171-
self._client_info = result.serverInfo
172-
173170
if result.protocolVersion not in SUPPORTED_PROTOCOL_VERSIONS:
174171
raise RuntimeError(f"Unsupported protocol version from the server: {result.protocolVersion}")
175172

173+
if self._client_info is DEFAULT_CLIENT_INFO:
174+
self._client_info = result.serverInfo
175+
176176
await self.send_notification(types.ClientNotification(types.InitializedNotification()))
177177

178178
return result

0 commit comments

Comments
 (0)