Commit a4a115b
committed
feat(mcp): modularize Jackson and victools support for v2 and v3
This commit completely decouples the MCP core and APT code generator
from Jackson and victools, resolving classpath conflicts between Jackson 2
and Jackson 3. It introduces dedicated integration modules to cleanly
handle JSON serialization and JSON Schema generation based on the user's
runtime environment.
Details:
* Refactored the APT generator (`McpRoute`, `McpRouter`) to build schemas
using standard `java.util.LinkedHashMap` and `java.util.ArrayList`
instead of Jackson's `ObjectNode` and `ArrayNode`.
* Removed hardcoded `victools` configuration from the generated `install`
methods. The generated router now dynamically requires the `SchemaGenerator`
from the Jooby application registry.
* Delegated the final schema map conversion strictly to the abstracted
`McpJsonMapper` interface.
* Introduced the `jooby-mcp-jackson2` module to provide bindings for
Jackson 2 and `victools` 4.x.
* Introduced the `jooby-mcp-jackson3` module to provide bindings for
Jackson 3 and `victools` 5.x.1 parent bc9714c commit a4a115b
16 files changed
Lines changed: 332 additions & 199 deletions
File tree
- modules
- jooby-apt/src
- main/java/io/jooby/internal/apt
- test/java/tests/i3830
- jooby-mcp-jackson2
- src/main/java/io/jooby/mcp/jackson2
- jooby-mcp-jackson3
- src/main/java/io/jooby/mcp/jackson3
- jooby-mcp
- src/main/java/io/jooby/mcp
- tests
- src/test/java/io/jooby/i3830
Lines changed: 30 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | | - | |
422 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
423 | 425 | | |
424 | 426 | | |
425 | 427 | | |
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
429 | | - | |
430 | | - | |
| 431 | + | |
431 | 432 | | |
432 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
433 | 438 | | |
434 | 439 | | |
435 | 440 | | |
| |||
442 | 447 | | |
443 | 448 | | |
444 | 449 | | |
445 | | - | |
446 | | - | |
447 | | - | |
| 450 | + | |
448 | 451 | | |
449 | 452 | | |
450 | | - | |
451 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
452 | 457 | | |
453 | 458 | | |
454 | 459 | | |
| |||
487 | 492 | | |
488 | 493 | | |
489 | 494 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 495 | + | |
| 496 | + | |
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
| |||
524 | 523 | | |
525 | 524 | | |
526 | 525 | | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| 559 | + | |
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
564 | | - | |
| 565 | + | |
565 | 566 | | |
566 | | - | |
| 567 | + | |
567 | 568 | | |
568 | 569 | | |
569 | 570 | | |
| |||
574 | 575 | | |
575 | 576 | | |
576 | 577 | | |
| 578 | + | |
577 | 579 | | |
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
582 | | - | |
| 584 | + | |
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
| |||
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
623 | | - | |
| 625 | + | |
| 626 | + | |
624 | 627 | | |
625 | 628 | | |
626 | 629 | | |
| |||
657 | 660 | | |
658 | 661 | | |
659 | 662 | | |
660 | | - | |
| 663 | + | |
| 664 | + | |
661 | 665 | | |
662 | 666 | | |
663 | 667 | | |
| |||
Lines changed: 9 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 368 | + | |
| 369 | + | |
373 | 370 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | 371 | | |
381 | 372 | | |
382 | 373 | | |
383 | 374 | | |
384 | | - | |
| 375 | + | |
385 | 376 | | |
386 | 377 | | |
387 | 378 | | |
| |||
394 | 385 | | |
395 | 386 | | |
396 | 387 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 388 | + | |
404 | 389 | | |
| 390 | + | |
405 | 391 | | |
406 | 392 | | |
407 | 393 | | |
408 | 394 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 395 | + | |
| 396 | + | |
418 | 397 | | |
419 | 398 | | |
420 | 399 | | |
| |||
438 | 417 | | |
439 | 418 | | |
440 | 419 | | |
441 | | - | |
| 420 | + | |
| 421 | + | |
442 | 422 | | |
443 | 423 | | |
444 | 424 | | |
| |||
Lines changed: 13 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 92 | | |
98 | | - | |
| 93 | + | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
102 | | - | |
103 | | - | |
| 97 | + | |
104 | 98 | | |
105 | 99 | | |
106 | 100 | | |
| |||
118 | 112 | | |
119 | 113 | | |
120 | 114 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 115 | | |
127 | | - | |
| 116 | + | |
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
131 | | - | |
| 120 | + | |
132 | 121 | | |
133 | 122 | | |
134 | 123 | | |
| |||
143 | 132 | | |
144 | 133 | | |
145 | 134 | | |
146 | | - | |
147 | 135 | | |
148 | | - | |
| 136 | + | |
149 | 137 | | |
150 | | - | |
151 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
152 | 142 | | |
153 | 143 | | |
154 | | - | |
| 144 | + | |
155 | 145 | | |
156 | 146 | | |
157 | 147 | | |
158 | | - | |
| 148 | + | |
159 | 149 | | |
160 | 150 | | |
161 | 151 | | |
| |||
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
167 | | - | |
| 157 | + | |
168 | 158 | | |
169 | 159 | | |
170 | 160 | | |
| |||
0 commit comments