Commit 7351534
feat: Add Spring WebMVC streamable server transport provider (#425)
- Add WebMvcStreamableServerTransportProvider with SSE support for streamable sessions
- Support GET, POST, DELETE endpoints for MCP protocol operations
- Implement thread-safe SSE operations using ReentrantLock in WebMvcSseServerTransportProvider
- Add test infrastructure with AbstractMcpClientServerIntegrationTests
- Refactor WebMvcStreamableIntegrationTests to use parameterized tests
- Support testing with both HttpClient and WebFlux transports
- Add streamable transport tests for both async and sync server modes
- Refactor existing WebMVC SSE integration tests to use shared test base
- Add error handling improvements in McpStreamableServerSession
- Update dependencies: add json-unit-assertj for enhanced JSON testing
- Reorganize POM dependencies and add mcp-spring-webflux test dependency
- Wrap handler invocations with Mono.defer for lazy evaluation
- Wrap consumer, tool, resource, prompt, and completion handler calls with Mono.defer()
- Ensures proper lazy evaluation and error handling in reactive streams
Related to #72
Signed-off-by: Christian Tzolov <[email protected]>
Signed-off-by: Dariusz Jędrzejczyk <[email protected]>
Co-authored-by: Dariusz Jędrzejczyk <[email protected]>1 parent a8f5a3f commit 7351534
File tree
11 files changed
+2410
-1159
lines changed- mcp-spring/mcp-spring-webmvc
- src
- main/java/io/modelcontextprotocol/server/transport
- test/java/io/modelcontextprotocol/server
- mcp-test
- src/main/java/io/modelcontextprotocol
- mcp/src
- main/java/io/modelcontextprotocol/server
- test/java/io/modelcontextprotocol/server
11 files changed
+2410
-1159
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
342 | 349 | | |
343 | 350 | | |
344 | 351 | | |
| |||
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
| 368 | + | |
361 | 369 | | |
362 | 370 | | |
363 | 371 | | |
| |||
367 | 375 | | |
368 | 376 | | |
369 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
370 | 381 | | |
371 | 382 | | |
372 | 383 | | |
| |||
390 | 401 | | |
391 | 402 | | |
392 | 403 | | |
| 404 | + | |
393 | 405 | | |
394 | 406 | | |
395 | 407 | | |
396 | 408 | | |
397 | 409 | | |
398 | 410 | | |
399 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
400 | 415 | | |
401 | 416 | | |
402 | 417 | | |
| |||
405 | 420 | | |
406 | 421 | | |
407 | 422 | | |
| 423 | + | |
408 | 424 | | |
409 | 425 | | |
410 | 426 | | |
411 | 427 | | |
412 | 428 | | |
413 | 429 | | |
414 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
415 | 434 | | |
416 | 435 | | |
417 | 436 | | |
| |||
0 commit comments