Commit 70fcdd2
mcp: A1/A2/A3 complete — /openapi-mcp.json, mcp-bridge stdio JAR, mTLS, X.509 auth, unit tests
Track A (OpenAPI-driven MCP bridge) is fully implemented and validated:
A1 — /openapi-mcp.json endpoint (axis2-openapi module)
- OpenApiSpecGenerator.generateMcpCatalogJson(): iterates AxisConfiguration services
with same isSystemService/shouldIncludeService/shouldIncludeOperation filters as
generatePaths(); produces MCP tool catalog JSON
- SwaggerUIHandler.handleMcpCatalogRequest(): mirrors handleOpenApiJsonRequest()
with application/json content-type, CORS headers, security headers
- OpenApiServlet + Axis2WebAppInitializer: route /openapi-mcp.json to handler
- Axis2Application.OPENAPI_PATHS: added /openapi-mcp.json to bypass JWT chain
A2 — axis2-mcp-bridge stdio JAR (new module modules/mcp-bridge/)
- McpTool: data class, strips HTTP method prefix to derive path
- ToolRegistry: GETs /openapi-mcp.json at startup, builds List<McpTool>/Map
- McpStdioServer: blocking stdin loop, JSON-RPC 2.0 dispatch
(initialize / tools/list / tools/call / error / notification handling)
- McpBridgeMain: --base-url / --keystore / --truststore arg parsing,
buildSslContext() for PKCS12 mTLS; maven-shade produces *-exe.jar uber-jar
- No MCP SDK — Jackson 2.21.1 (Apache 2.0) + Java stdlib HttpClient only
- Protocol version: 2024-11-05; notifications silently consumed (no response)
mTLS / PKI
- IoT CA pattern: RSA 4096 CA (10yr) + RSA 2048 leaf certs (2yr), SHA-256, PKCS12
- certs/: ca.{key,crt}, server.{key,crt,csr}, client.{key,crt,csr},
server-keystore.p12, ca-truststore.p12, client-keystore.p12 (password: changeit)
- Tomcat 8443 connector: certificateVerification=required, TLSv1.2+
X.509 Spring Security (springbootdemo-tomcat11)
- X509AuthenticationFilter: reads jakarta.servlet.request.X509Certificate (set by
Tomcat post-handshake), extracts CN via RFC 2253, creates
UsernamePasswordAuthenticationToken(CN, cert, [ROLE_X509_CLIENT])
- springSecurityFilterChainMtls @order(2): MtlsRequestMatcher (port==8443),
X509AuthenticationFilter ahead of existing JWT chains
A3 validation — confirmed working end-to-end:
Claude Desktop -> axis2-mcp-bridge stdio -> HTTPS+mTLS 8443
-> X509AuthenticationFilter (CN=axis2-mcp-bridge, ROLE_X509_CLIENT)
-> BigDataH2Service.processBigDataSet() -> real response returned
Unit tests (JUnit 3 TestCase style, matching existing openapi module conventions)
mcp-bridge module (4 new test classes, 48 tests):
McpToolTest: path extraction, description fallback, accessor correctness
McpStdioServerTest: initialize/tools-list/unknown-method/parse-error/notification/
sequence tests via System.in/out redirection + StubToolRegistry inner class
McpBridgeMainTest: parseArg/parseArgOrDefault via reflection, buildSslContext
with real cert files (skips gracefully when certs absent)
ToolRegistryTest: pre-load state, injection via reflection, ParseableRegistry
subclass driving catalog-parsing logic for 7 parsing scenarios
openapi module (2 new test classes, 26 tests):
McpCatalogGeneratorTest: JSON validity, empty catalog, tool fields, endpoint format,
inputSchema structure, JSON escaping, MCP/OpenAPI path consistency
McpCatalogHandlerTest: HTTP 200, Content-Type, CORS headers, body validity,
service discovery, security header presence
MCP.md updated: current state table, PKI section, Spring Security filter chain table,
X.509 auth flow, next steps (C1 now unblocked, A4/Track B queued)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ad14246 commit 70fcdd2
30 files changed
Lines changed: 3157 additions & 104 deletions
File tree
- certs
- modules
- mcp-bridge
- src
- main/java/org/apache/axis2/mcp/bridge
- test/java/org/apache/axis2/mcp/bridge
- openapi/src
- main/java/org/apache/axis2/openapi
- test/java/org/apache/axis2/openapi
- samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot
- configuration
- security/webservices
Large diffs are not rendered by default.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Binary file not shown.
0 commit comments