Skip to content

Conversation

koic
Copy link
Member

@koic koic commented Sep 24, 2025

Motivation and Context

I noticed through the existing tests that MCP::Configuration#protocol_version= allows setting an arbitrary protocol version.

Since the official MCP Ruby SDK is an implementation of the MCP specification, it should not support arbitrary protocol versions. This change adds validation to the setter, consistent with Configuration#initialize.

The same validation has also been added to MCP::Configuration#validate_tool_call_arguments=.

How Has This Been Tested?

Test code is being added.

Breaking Changes

None, because values that don't conform to the specification version are considered invalid.

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

I noticed through the existing tests that `MCP::Configuration#protocol_version=`
allows setting an arbitrary protocol version.

Since the official MCP Ruby SDK is an implementation of the MCP specification,
it should not support arbitrary protocol versions. This change adds validation
to the setter, consistent with `Configuration#initialize`.

The same validation has also been added to `MCP::Configuration#validate_tool_call_arguments=`.
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.

1 participant