Repository navigation
Commit 7d64add
committed
Keep Ruby 2.7 from warning about keywords in
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.StdioTransport
1 parent 56af0c7 commit 7d64add
2 files changed
Lines changed: 22 additions & 1 deletion
File tree
- lib/mcp/server/transports
- test/mcp/server/transports
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
138 | 157 | | |
139 | 158 | | |
140 | 159 | | |
| |||
0 commit comments