Skip to content

feat(core): add support for MCP 2026 stateless draft and auto-negotiation fallback#704

Merged
anubhav756 merged 19 commits into
anubhav-mcp-draftfrom
anubhav-draft-negotiation
Jul 1, 2026
Merged

feat(core): add support for MCP 2026 stateless draft and auto-negotiation fallback#704
anubhav756 merged 19 commits into
anubhav-mcp-draftfrom
anubhav-draft-negotiation

Conversation

@anubhav756

Copy link
Copy Markdown
Contributor

This PR adds support for the upcoming MCP 2026 stateless draft (DRAFT-2026-v1) and introduces protocol auto-negotiation fallback to ensure smooth backward compatibility with older servers.

  • Adds MCP_DRAFT constant pointing to DRAFT-2026-v1 alongside MCP and MCP_LATEST.
  • Implements fallback protocol negotiation during client initialization.
    • If an older server returns a single version string instead of throwing an UnsupportedProtocolVersionError, the client manually triggers ProtocolNegotiationError and falls back to the server's preferred version.
  • Adds E2E test test_protocol_fallback_e2e to verify negotiation down to older versions.
  • Updates documentation across core, adk, langchain, and llamaindex integrations.

@anubhav756 anubhav756 force-pushed the anubhav-draft-negotiation branch from 9511caf to 261bb86 Compare June 30, 2026 14:25
@anubhav756 anubhav756 force-pushed the anubhav-draft-negotiation branch from e821d64 to caf7b85 Compare July 1, 2026 13:27
@anubhav756 anubhav756 merged commit 25c0c88 into anubhav-mcp-draft Jul 1, 2026
29 checks passed
@anubhav756 anubhav756 deleted the anubhav-draft-negotiation branch July 1, 2026 14:42
@anubhav756

Copy link
Copy Markdown
Contributor Author

This PR is rolled-up in #703 to override some of the intermediate changes and make it easier to review.

anubhav756 added a commit that referenced this pull request Jul 1, 2026
…tion fallback (#704)

* feat(core): add support for MCP 2026 stateless draft and auto-negotiation fallback

* fix: Keep the MCP_LATEST to stable version but point MCP_DRAFT to 2026 draft

* chore: fix integration tests

* chore: delint

* chore: fix tests

* test: increase integration test coverage

* chore: delint

* test: integrate the draft build with dual testing modes

* fix(tests): correct pytest async fixtures and auto-format with black/isort

* fix(tests): use pytest.fixture for sync fixtures and fix isort formatting

* fix(tests): update binary URL for draft testing in all packages

* chore: fix integration tests url and lint errors

* chore: test with mcp-v202606 branch to fix unknown flag error

* fix(test): core fallback and adk toolset import

* chore: format files

* Revert "chore: format files"

This reverts commit ee00b9e.

* chore(test): fix line length in bucket name selection

* chore: bump TOOLBOX_VERSION to v1.6.0

* test: parameterize integration tests to run comprehensively for both stable and draft MCP versions
anubhav756 added a commit that referenced this pull request Jul 1, 2026
…tion fallback (#704)

* feat(core): add support for MCP 2026 stateless draft and auto-negotiation fallback

* fix: Keep the MCP_LATEST to stable version but point MCP_DRAFT to 2026 draft

* chore: fix integration tests

* chore: delint

* chore: fix tests

* test: increase integration test coverage

* chore: delint

* test: integrate the draft build with dual testing modes

* fix(tests): correct pytest async fixtures and auto-format with black/isort

* fix(tests): use pytest.fixture for sync fixtures and fix isort formatting

* fix(tests): update binary URL for draft testing in all packages

* chore: fix integration tests url and lint errors

* chore: test with mcp-v202606 branch to fix unknown flag error

* fix(test): core fallback and adk toolset import

* chore: format files

* Revert "chore: format files"

This reverts commit ee00b9e.

* chore(test): fix line length in bucket name selection

* chore: bump TOOLBOX_VERSION to v1.6.0

* test: parameterize integration tests to run comprehensively for both stable and draft MCP versions
anubhav756 added a commit that referenced this pull request Jul 2, 2026
…tion fallback (#704)

* feat(core): add support for MCP 2026 stateless draft and auto-negotiation fallback

* fix: Keep the MCP_LATEST to stable version but point MCP_DRAFT to 2026 draft

* chore: fix integration tests

* chore: delint

* chore: fix tests

* test: increase integration test coverage

* chore: delint

* test: integrate the draft build with dual testing modes

* fix(tests): correct pytest async fixtures and auto-format with black/isort

* fix(tests): use pytest.fixture for sync fixtures and fix isort formatting

* fix(tests): update binary URL for draft testing in all packages

* chore: fix integration tests url and lint errors

* chore: test with mcp-v202606 branch to fix unknown flag error

* fix(test): core fallback and adk toolset import

* chore: format files

* Revert "chore: format files"

This reverts commit ee00b9e.

* chore(test): fix line length in bucket name selection

* chore: bump TOOLBOX_VERSION to v1.6.0

* test: parameterize integration tests to run comprehensively for both stable and draft MCP versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants