Commit f9bf124
committed
Relax Accept header requirement for JSON-only responses
When is_json_response_enabled is True, servers only return application/json
responses and never use SSE. This change relaxes the Accept header validation
to only require application/json in this mode, rather than requiring both
application/json and text/event-stream.
This makes it easier to test JSON-only MCP servers with tools like curl,
which is useful when developing and debugging MCP servers.
For servers with is_json_response_enabled=False (SSE mode), the existing
requirement for both content types is maintained.1 parent 40acbc5 commit f9bf124
2 files changed
+39
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
309 | 331 | | |
310 | 332 | | |
311 | 333 | | |
312 | 334 | | |
313 | 335 | | |
314 | 336 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 337 | + | |
| 338 | + | |
323 | 339 | | |
324 | 340 | | |
325 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
696 | 711 | | |
697 | 712 | | |
698 | 713 | | |
| |||
0 commit comments