Commit af55286
openapi-mcp: add Axis2 JSON-RPC format docs, auth annotations, MCP 2025 hints
Driven by gaps identified against Python rapi-mcp, pyRapi, and
internal-alpha-theory-mcp.
OpenApiSpecGenerator.generateMcpCatalogJson():
- Add catalog-level _meta object documenting the Axis2 JSON-RPC
transport contract (axis2JsonRpcFormat, contentType, authHeader,
tokenEndpoint) — MCP clients need this to call services without
an intermediary proxy
- Add x-axis2-payloadTemplate per tool: {"opName":[{"arg0":{}}]}
(the wrapping format mandated by JsonUtils.invokeServiceClass())
- Add x-requiresAuth per tool: false for loginService (token endpoint),
true for all other services — mirrors the two-phase auth flow in
pyRapi/auth.py and rapi-mcp/server/rapi/api.py
- Add MCP 2025-03-26 annotations per tool (readOnlyHint, destructiveHint,
idempotentHint, openWorldHint) — conservative defaults, overridable
via @mcptool annotations (future work)
SwaggerUIHandler.handleMcpCatalogRequest():
- Add Cache-Control: no-cache, no-store — catalog must not be cached
as service list changes on deployment
Tests (McpCatalogGeneratorTest, McpCatalogHandlerTest):
- 30+ new test methods covering _meta, payload template structure,
auth annotations, MCP 2025 annotations, Cache-Control, security headers
New test file McpAxis2PayloadTest.java (30 tests):
- Structural validation of the Axis2 JSON-RPC payload template format
- Two-phase auth flow (loginService → Bearer → protected service)
- pyRapi format compatibility ({"doLogin":[{"arg0":{}}]})
- All-tools consistency checks (template key matches tool name, etc.)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 93884cf commit af55286
5 files changed
Lines changed: 822 additions & 1 deletion
File tree
- modules/openapi/src
- main/java/org/apache/axis2/openapi
- test/java/org/apache/axis2/openapi
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
652 | 665 | | |
653 | 666 | | |
654 | 667 | | |
| |||
657 | 670 | | |
658 | 671 | | |
659 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
660 | 677 | | |
661 | 678 | | |
662 | 679 | | |
| |||
678 | 695 | | |
679 | 696 | | |
680 | 697 | | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
681 | 717 | | |
682 | 718 | | |
683 | 719 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
0 commit comments