Add "Draft" protocol version to supported protocol versions #179
+106
−9
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.
Motivation and Context
For example, the
titleintroduced in #109 is not supported in the latest stable protocol version "2025-06-18": https://modelcontextprotocol.io/specification/2025-06-18It is supported in the Draft of the next version:
https://modelcontextprotocol.io/specification/draft
In other words, the fact that the Ruby SDK treats "2025-06-18" as the default protocol version while
titleis only supported in the Draft results in an inconsistency.Because of this, a new version
"Draft"has been added to the list of supported versions. Its value follows the schema below and is defined asDRAFT-2025-v3: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/14ec41c/schema/draft/schema.ts#L15It was also considered to continue using the latest stable version "2025-06-18" as the Ruby SDK default instead of the Draft. However, in that case, users would need to explicitly specify
MCP::Server.new(protocol_version: 'DRAFT-2025-v3'), which adds extra burden. In this PR, Draft is made the default in order to provide the following benefits:protocol_versionoption when initializingMCP::ServerDRAFT-2025-v3The primary case for specifying
protocol_versionexplicitly is when strict adherence to a particular version is required. However, it seems more practical to prioritize use cases where backward-compatible features, including those from the Draft, are desirable. This is the rationale behind making the Draft version the default.In addition, making the Draft version the default protocol version preserves backward compatibility for
MCP::Server.How Has This Been Tested?
Added new tests, and all tests, including the existing ones, are passing.
Breaking Changes
When no version is specified for
protocol_version, features from the draft version are still allowed by default.On the other hand, when a version is specified for
protocol_version, only features that strictly conform to the corresponding specification are permitted.It is assumed that users typically don't specify
protocol_versionand this doesn't cause breaking changes for that.Types of changes
Checklist
Additional context
NOTE:
DRAFT-2025-v3is a development code, so its value cannot be set externally. It is applied either whenprotocol_versionis omitted or whennilis set explicitly, such as withMCP::Configuration.new(protocol_version: nil). This prevents users from creating implementations that depend on development codes likeDRAFT-2025-v3.