Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
strategy:
matrix:
entry:
- { ruby: '2.6', allowed-failure: false }
- { ruby: '2.7', allowed-failure: false }
- { ruby: '3.0', allowed-failure: false }
- { ruby: '3.1', allowed-failure: false }
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:
- rubocop-rake

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 2.6

Gemspec/DevelopmentDependencies:
Enabled: true
Expand Down
2 changes: 1 addition & 1 deletion lib/mcp/prompt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def validate_arguments!(args)
private

def required_args
arguments_value.filter_map { |arg| arg.name.to_sym if arg.required }
arguments_value.map { |arg| arg.name.to_sym if arg.required }.compact
end
end
end
Expand Down
5 changes: 4 additions & 1 deletion lib/mcp/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def validate!
end

def validate_tool_name!
duplicated_tool_names = @tool_names.tally.filter_map { |name, count| name if count >= 2 }
duplicated_tool_names = @tool_names
.each_with_object(Hash.new(0)) { |name, counts| counts[name] += 1 }
.select { |_name, count| count >= 2 }
.keys

raise ToolNotUnique, duplicated_tool_names unless duplicated_tool_names.empty?
end
Expand Down
4 changes: 2 additions & 2 deletions mcp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.license = "Apache-2.0"

# Since this library is used by a broad range of users, it does not align its support policy with Ruby's EOL.
spec.required_ruby_version = ">= 2.7.0"
spec.required_ruby_version = ">= 2.6.0"

spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata["changelog_uri"] = "https://github.com/modelcontextprotocol/ruby-sdk/releases/tag/v#{spec.version}"
Expand All @@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency("json-schema", ">= 4.1")
spec.add_dependency("json-schema", ">= 4.1", "< 6.0")
Copy link
Member

Choose a reason for hiding this comment

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

This would create an undesirable restriction for users on newer Ruby versions, preventing them from using bugfix releases and other updates. Instead of restricting the version, please consider proposing changes to support it on the dependent gem side. voxpupuli/json-schema#561 may be helpful as a reference.

end