Commit 5845866
Remove stateless check from ClientSupportsMrtr and flow protocol version header
ClientSupportsMrtr now purely reflects whether the client negotiated
the MRTR protocol version, independent of server transport mode.
The stateless guard is moved to the call site that gates the high-level
await path (which requires storing continuations).
In stateless mode, each request creates a new McpServerImpl that never
sees the initialize handshake. The Mcp-Protocol-Version header is now
flowed via JsonRpcMessageContext.ProtocolVersion so the MRTR wrapper
can populate _negotiatedProtocolVersion, making IsMrtrSupported return
true when the client sends the experimental protocol version header.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 80417c0 commit 5845866
File tree
4 files changed
+79
-14
lines changed- src
- ModelContextProtocol.AspNetCore
- ModelContextProtocol.Core
- Protocol
- Server
- tests/ModelContextProtocol.AspNetCore.Tests
4 files changed
+79
-14
lines changedLines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
| 483 | + | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
486 | 489 | | |
487 | | - | |
488 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
489 | 502 | | |
490 | 503 | | |
491 | 504 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
77 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
1146 | | - | |
1147 | | - | |
| 1146 | + | |
1148 | 1147 | | |
1149 | 1148 | | |
1150 | | - | |
1151 | 1149 | | |
1152 | 1150 | | |
1153 | 1151 | | |
| |||
1177 | 1175 | | |
1178 | 1176 | | |
1179 | 1177 | | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1180 | 1187 | | |
1181 | 1188 | | |
1182 | 1189 | | |
| |||
1217 | 1224 | | |
1218 | 1225 | | |
1219 | 1226 | | |
1220 | | - | |
1221 | | - | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1222 | 1230 | | |
1223 | 1231 | | |
1224 | 1232 | | |
| |||
1262 | 1270 | | |
1263 | 1271 | | |
1264 | 1272 | | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1269 | 1277 | | |
1270 | 1278 | | |
1271 | 1279 | | |
| |||
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
434 | 438 | | |
435 | 439 | | |
436 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
437 | 470 | | |
0 commit comments