Repository navigation
Keep Ruby 2.7 from warning about keywords in StdioTransport - #621
Merged
koic merged 1 commit intoOct 17, 2026
Conversation
Since 1.8.0, `ServerSession#handle` accepts bare keyword arguments as the request (`handle(request = nil, auth_info: nil, **request_keywords)`), so `StdioTransport` passing the parsed request Hash as its only argument makes Ruby 2.7 treat the Hash as keyword arguments. The request is still handled, but every frame prints "Using the last argument as keyword parameters is deprecated" to stderr when deprecation warnings are enabled, which breaks callers that expect a silent stderr, such as RuboCop's MCP server specs on Ruby 2.7. Passing `auth_info: nil` explicitly keeps the Hash positional without changing the request that reaches the server.
koic
added a commit
to rubocop/rubocop
that referenced
this pull request
Oct 16, 2026
mcp 1.8.0 makes Ruby 2.7 print a keyword argument deprecation warning for every stdio request, which fails the MCP server specs that expect a silent stderr on the Ruby 2.7 CI jobs. The fix is modelcontextprotocol/ruby-sdk#621. Excluding only 1.8.0 resolves to 1.7.0 until then and picks up 1.8.1 without another change here. mcp is a development dependency only, so users of RuboCop are not affected.
koic
deleted the
keep_ruby_2_7_from_warning_about_keywords_in_stdio_transport
branch
October 17, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since 1.8.0,
ServerSession#handleaccepts bare keyword arguments as the request (handle(request = nil, auth_info: nil, **request_keywords)), soStdioTransportpassing the parsed request Hash as its only argument makes Ruby 2.7 treat the Hash as keyword arguments. The request is still handled, but every frame prints "Using the last argument as keyword parameters is deprecated" to stderr when deprecation warnings are enabled, which breaks callers that expect a silent stderr, such as RuboCop's MCP server specs on Ruby 2.7.Passing
auth_info: nilexplicitly keeps the Hash positional without changing the request that reaches the server.Types of changes
Checklist