You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client): store full InitializeResult as server_params
ClientSession now stores the complete InitializeResult via a server_params
property, mirroring ServerSession.client_params. This provides access to
server_info, capabilities, instructions, and the negotiated protocol_version
through a single, future-proof property.
Previously, only capabilities were stored (via _server_capabilities) and
users had no access to server_info, instructions, or protocol_version after
initialize() returned — they had to manually capture the return value.
get_server_capabilities() and Client.server_capabilities have been removed.
Github-Issue: #1018
Copy file name to clipboardExpand all lines: docs/migration.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,6 +169,30 @@ result = await session.list_resources(params=PaginatedRequestParams(cursor="next
169
169
result =await session.list_tools(params=PaginatedRequestParams(cursor="next_page_token"))
170
170
```
171
171
172
+
### `ClientSession.get_server_capabilities()` replaced by `server_params` property
173
+
174
+
`ClientSession` now stores the full `InitializeResult` via a `server_params` property, mirroring `ServerSession.client_params`. This is the new way to access server metadata after initialization — `server_info`, `capabilities`, `instructions`, and the negotiated `protocol_version` are all available through this single property. The `get_server_capabilities()` method has been removed.
175
+
176
+
**Before (v1):**
177
+
178
+
```python
179
+
capabilities = session.get_server_capabilities()
180
+
# server_info, instructions, protocol_version were not stored — had to capture initialize() return value
181
+
```
182
+
183
+
**After (v2):**
184
+
185
+
```python
186
+
params = session.server_params
187
+
if params isnotNone:
188
+
capabilities = params.capabilities
189
+
server_info = params.server_info
190
+
instructions = params.instructions
191
+
version = params.protocol_version
192
+
```
193
+
194
+
The high-level `Client.server_capabilities` property has similarly been replaced by `Client.server_params`.
195
+
172
196
### `McpError` renamed to `MCPError`
173
197
174
198
The `McpError` exception class has been renamed to `MCPError` for consistent naming with the MCP acronym style used throughout the SDK.
0 commit comments