-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Client-side 2026-07-28 support: .discover()/.adopt() + Client(mode=); request-metadata green #2950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
maxisbey
wants to merge
9
commits into
main
Choose a base branch
from
s3-client-modern-path
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,456
−662
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cb9e260
Rename SUPPORTED_PROTOCOL_VERSIONS to HANDSHAKE_PROTOCOL_VERSIONS; co…
maxisbey e0990bf
Thread per-message headers from session to transport via CallOptions/…
maxisbey 52546fa
ClientSession: install per-request stamp at connect time; transport b…
maxisbey 1d33743
Client gains mode= and prior_discover= policy knobs (legacy and versi…
maxisbey 1fbd075
ClientSession.discover() with the error ladder; Client mode='auto'
maxisbey 46c0742
modern_on_request driver + Client in-process modern path via DirectDi…
maxisbey dcbe6e8
Sweep: route report_progress through DispatchContext.progress; bump L…
maxisbey a97459d
Add lifecycle:envelope/discover/mode requirement entries and interact…
maxisbey 52f200b
Conformance client fixture: drive Client(mode='auto') for the modern leg
maxisbey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,6 +159,10 @@ The `headers`, `timeout`, `sse_read_timeout`, and `auth` parameters have been re | |
|
|
||
| Note: `sse_client` retains its `headers`, `timeout`, `sse_read_timeout`, and `auth` parameters — only the streamable HTTP transport changed. | ||
|
|
||
| ### `protocol_version` removed from `StreamableHTTPTransport` and `streamable_http_client` | ||
|
|
||
| The `protocol_version` attribute on `StreamableHTTPTransport` and the `protocol_version` parameter on `streamable_http_client` have been removed. The transport no longer holds per-connection protocol state; era-dependent headers (e.g. `MCP-Protocol-Version`) are supplied per-message by the session, so the transport never needs to know the negotiated version. | ||
|
|
||
| ### `terminate_windows_process` removed | ||
|
|
||
| The deprecated `mcp.os.win32.utilities.terminate_windows_process` function has been | ||
|
|
@@ -350,6 +354,10 @@ if result is not None: | |
|
|
||
| The high-level `Client.initialize_result` returns the same `InitializeResult` but is non-nullable — initialization is guaranteed inside the context manager, so no `None` check is needed. This replaces v1's `Client.server_capabilities`; use `client.initialize_result.capabilities` instead. | ||
|
|
||
| ### `ClientSession(protocol_version=)` removed | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. definitely wasn't in v2, remove |
||
|
|
||
| The `protocol_version` constructor parameter on `ClientSession` has been removed. To install a known protocol version without performing the `initialize` handshake (e.g. when reconnecting to an existing session), call `session.adopt(result)` after construction with a stored `InitializeResult`. | ||
|
|
||
| ### `McpError` renamed to `MCPError` | ||
|
|
||
| The `McpError` exception class has been renamed to `MCPError` for consistent naming with the MCP acronym style used throughout the SDK. | ||
|
|
@@ -764,6 +772,12 @@ async def my_tool(ctx: Context) -> str: ... | |
| async def my_tool(ctx: Context[MyLifespanState]) -> str: ... | ||
| ``` | ||
|
|
||
| ### Version constants | ||
|
|
||
| `SUPPORTED_PROTOCOL_VERSIONS` is deprecated — it's now the union of `HANDSHAKE_PROTOCOL_VERSIONS` (initialize-handshake versions) and `MODERN_PROTOCOL_VERSIONS` (per-request-envelope versions). If you were using it to mean "versions the initialize handshake accepts", switch to `HANDSHAKE_PROTOCOL_VERSIONS`. | ||
|
|
||
| `LATEST_PROTOCOL_VERSION` now reflects the newest protocol revision the SDK supports (`2026-07-28`). Code that used it to mean "the version `.initialize()` offers" should switch to `HANDSHAKE_PROTOCOL_VERSIONS[-1]`. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. useless, remove |
||
|
|
||
| ### `ProgressContext` and `progress()` context manager removed | ||
|
|
||
| The `mcp.shared.progress` module (`ProgressContext`, `Progress`, and the `progress()` context manager) has been removed. This module had no real-world adoption — all users send progress notifications via `Context.report_progress()` or `session.send_progress_notification()` directly. | ||
|
|
@@ -1289,6 +1303,12 @@ warnings.filterwarnings("ignore", category=MCPDeprecationWarning) | |
|
|
||
| No migration is required during the deprecation window. New code should avoid building on these features, since they may be removed in a future spec version. | ||
|
|
||
| ### Client-to-server progress deprecated (2026-07-28) | ||
|
|
||
| The 2026-07-28 spec restricts `notifications/progress` to the server-to-client direction only — `ProgressNotification` is no longer in `ClientNotification`. `Client.send_progress_notification()` and `ClientSession.send_progress_notification()` now carry `typing_extensions.deprecated` and emit `mcp.MCPDeprecationWarning` at runtime. They continue to work against servers negotiating 2025-11-25 or earlier. | ||
|
|
||
| On the server side, prefer the new dispatcher-agnostic `ServerSession.report_progress(progress, total, message)` (and `Context.report_progress()` on `MCPServer`) over the raw `ServerSession.send_progress_notification(progress_token, …)`. `report_progress` encapsulates the "no-op when the caller did not request progress" rule and works on every dispatcher; the raw token-taking form remains for handlers that read `_meta.progressToken` directly. | ||
|
|
||
| ## Bug Fixes | ||
|
|
||
| ### OAuth metadata URLs no longer gain a trailing slash | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this in v1 though? migration.md is only for changes from v1 -> v2, not changes within v2