Commit d5df0a1
committed
feat(mcp): complete APT code generation for MCP server features
Implement full Annotation Processor (APT) support for generating MCP
server specifications and handlers, bridging Jooby controllers with the
Model Context Protocol SDK.
Key implementations:
* Annotations: Add code generation for @mcptool, @McpPrompt,
@McpResource, and @McpCompletion.
* Completion Routing: Implement "Group and Route" architecture. Groups
multiple argument-specific completion methods under a single MCP
Reference and routes them at runtime using compile-time generated
enhanced switch/when expressions.
* Dynamic Resources: Auto-detect URI placeholders (`{}`) to dynamically
register as Resource Templates or static Resources.
* Template Variables: Integrate `DefaultMcpUriTemplateManager` to safely
extract and bind path variables from `req.uri()` into controller args.
* Schema Generation: Optimize Jackson 3 (`tools.jackson`) schema builder
to automatically omit output schemas for primitives, standard java.lang
types, and internal MCP classes.
* Idiomatic Output: Generate clean, modern Java (var, enhanced switch)
and Kotlin (val, when) with strict null-safety checks and safe default
fallbacks for unmatched requests.1 parent 61cf331 commit d5df0a1
File tree
6 files changed
+1265
-348
lines changed- modules/jooby-apt
- src
- main/java/io/jooby/internal/apt
- test/java/tests/i3830
6 files changed
+1265
-348
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
| |||
0 commit comments