Skip to content

Update protocol version #410

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cliffhall
Copy link
Contributor

@cliffhall cliffhall commented Apr 25, 2025

  • This fixes LATEST_PROTOCOL_VERSION is not set to "2025-03-26" #378
  • In types.ts
    • set LATEST_PROTOCOL_VERSION to "2025-03-26"
    • add "2025-03-26" to SUPPORTED_PROTOCOL_VERSIONS
  • In auth.test.ts
    • in test "returns metadata when discovery succeeds"
      • expect "MCP-Protocol-Version" to be "2025-03-26"
  • Added types.test.ts
    • "should have correct latest protocol version"
    • "should have correct supported protocol versions"

Motivation and Context

StreamableHttp is available in the current release of the SDK and people are finding that returning the newest protocol version from their servers can cause a failure to connect.

How Has This Been Tested?

Unit and integration tests pass. Lint has no errors.

Breaking Changes

Nope.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

* This fixes modelcontextprotocol#378
* In types.ts
  - set LATEST_PROTOCOL_VERSION to "2025-03-26"
  - add "2025-03-26" to SUPPORTED_PROTOCOL_VERSIONS
* In auth.test.ts
  - in test "returns metadata when discovery succeeds"
    - expect "MCP-Protocol-Version" to be "2025-03-26"
* Added types.test.ts
  - "should have correct latest protocol version"
  - "should have correct supported protocol versions"
* tidy types.test.ts
@ihrpr ihrpr added this to the release 1.10.3 milestone Apr 28, 2025
Copy link
Contributor

@ihrpr ihrpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this! Please can we have tests for version negotiations. Ideally we test:

  • old protocol server, new client
  • old protocol client, new server

@cliffhall
Copy link
Contributor Author

Thank you for working on this! Please can we have tests for version negotiations. Ideally we test:

  • old protocol server, new client
  • old protocol client, new server

It seems as if the bases are covered by the current crop of client and server tests. If you see a gap, I'm happy to close it.

Server version-handling tests

Screenshot 2025-04-28 at 3 00 04 PM

Client version-handling tests

Screenshot 2025-04-28 at 3 00 57 PM

@ihrpr
Copy link
Contributor

ihrpr commented Apr 28, 2025

Thank you for working on this! Please can we have tests for version negotiations. Ideally we test:

  • old protocol server, new client
  • old protocol client, new server

It seems as if the bases are covered by the current crop of client and server tests. If you see a gap, I'm happy to close it.

Server version-handling tests

Screenshot 2025-04-28 at 3 00 04 PM ### [Client version-handling tests](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/client/index.test.ts#L23) Screenshot 2025-04-28 at 3 00 57 PM

Those tests have loads of mocking, I think if we can just check manually if all works fine for both of the cases that would be great.

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.

LATEST_PROTOCOL_VERSION is not set to "2025-03-26"
2 participants