Repository navigation
Commit 90b8fd4
committed
Derive
## Motivation and Context
#490 and #492 merged independently green but broke each other on main: #492 made the modern path reject
a name-bearing POST whose body carries a target name without `Mcp-Name` (-32020, HTTP 400)
and taught the `modern_rack_request` helper to derive `Mcp-Method` from the body, while #490,
merged in between, added five modern `tools/call` tests that build their requests through that helper
and therefore send no `Mcp-Name`. Since the #492 merge every CI run on main fails those five tests
with 400 where 200 is expected; the library behavior itself is correct.
The helper now derives `Mcp-Name` the same way it derives `Mcp-Method`: from `params.name` or
`params.uri` when the body's method is one of the name-bearing three. That is what a conforming client sends per
the 2026-07-28 specification, and what the TypeScript SDK's client, the bundled `MCP::Client::HTTP`,
and the conformance harness's standard headers all do, so tests built through
the helper model a compliant client by default. `name_header: nil` omits the header for tests of
the requirement itself, symmetric with `method_header: nil`, and an explicit `headers:` entry still overrides
the derived value, which keeps the base64 mismatch tests exercising their divergent names.
## How Has This Been Tested?
The five failing tests pass again without being touched, and the #492 requirement tests
(missing `Mcp-Method`, missing `Mcp-Name`, header mismatches, base64 decoding) still pass:
the transport test file reports 217 runs with zero failures. `bundle exec rake` is green,
including RuboCop and the `--requirements 2025-11-25` conformance baseline.
## Breaking Changes
None. The change is confined to a test helper; the shipped gem is untouched.Mcp-Name from the body in the modern transport test helper1 parent b03da23 commit 90b8fd4
1 file changed
Lines changed: 19 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5357 | 5357 | | |
5358 | 5358 | | |
5359 | 5359 | | |
| 5360 | + | |
5360 | 5361 | | |
5361 | 5362 | | |
5362 | 5363 | | |
| |||
5788 | 5789 | | |
5789 | 5790 | | |
5790 | 5791 | | |
5791 | | - | |
5792 | | - | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
5793 | 5795 | | |
5794 | | - | |
5795 | | - | |
5796 | | - | |
5797 | | - | |
5798 | | - | |
5799 | | - | |
5800 | | - | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
| 5799 | + | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
| 5805 | + | |
| 5806 | + | |
| 5807 | + | |
| 5808 | + | |
5801 | 5809 | | |
5802 | 5810 | | |
5803 | | - | |
| 5811 | + | |
5804 | 5812 | | |
5805 | 5813 | | |
5806 | 5814 | | |
5807 | 5815 | | |
| 5816 | + | |
5808 | 5817 | | |
5809 | 5818 | | |
5810 | 5819 | | |
| |||
0 commit comments