CAMEL-24310: camel-mcp-server - verify main HTTP server authentication protects the MCP endpoint - #25328
Conversation
…n protects the MCP endpoint The MCP routes are registered on the same Vert.x sub-router the camel.server.authentication* handlers are mounted on (default path /*), and the handlers are installed before the MCP routes, so every /mcp request passes authentication first. This was an open verification item from the PR 25306 review: unauthenticated POST/GET/DELETE now proven to return 401, and the full MCP conversation (initialize, tools/list, tools/call) proven to work with Basic credentials. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davsclaus
left a comment
There was a problem hiding this comment.
Clean test-only follow-up that closes the verification gap from #25306 — confirms camel.server.authentication* configuration protects the /mcp endpoint at runtime.
Conventions check:
- ✅ Package-private test class and methods (JUnit 5 convention)
- ✅ AssertJ assertions throughout
- ✅ No
Thread.sleep() - ✅ Proper resource management (
Mainvia@BeforeAll/@AfterAll,McpSyncClientin try-finally) - ✅ License headers, imports, AI attribution
LGTM.
This review was generated by an AI agent (Claude Code on behalf of davsclaus) and may contain inaccuracies. Please verify all suggestions before applying.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 9 all testedMaveniverse Scalpel detected 1 affected modules (current approach: 9). Modules only in current approach (8)
Skip-tests mode would test 1 modules (1 direct + 0 downstream), skip tests for 0 (generated code, meta-modules) Modules Scalpel would test (1)
All tested modules (9 modules)
|
Test-only follow-up to CAMEL-24310 / #25306, closing the open verification item from that PR's description: does the main HTTP server's
camel.server.authentication*configuration also protect the MCP endpoint?It does — now proven at runtime. The mechanism:
VertxPlatformHttpServermounts the basic/JWT authentication handlers on its sub-router at the default path/*during server init, and theVertxPlatformHttpRouterbound in the registry delegates to that same sub-router — so the/mcproutes the MCP engine registers later sit behind the auth handlers (Vert.x dispatches in insertion order).McpServerMainAuthenticationTestbootsMainwithcamel.server.authentication-enabled=true+basic-properties-fileand asserts:POST/GET/DELETEon/mcp→ 401 (all three registered routes covered)tools/list,tools/call) succeeds with Basic credentials, supplied via the MCP SDK client'shttpRequestCustomizerFull
camel-mcp-servermodule suite green (10 tests).This PR was written by Claude Code on behalf of Federico Mariani (@Croway).
🤖 Generated with Claude Code