Croway opened a new pull request, #25329:
URL: https://github.com/apache/camel/pull/25329

   JIRA: [CAMEL-24353](https://issues.apache.org/jira/browse/CAMEL-24353) — the 
small enabler for 
[CAMEL-23853](https://issues.apache.org/jira/browse/CAMEL-23853) / #25203 
discussed 
[here](https://github.com/apache/camel/pull/25203#issuecomment-5181076911).
   
   `VertxMcpServerEngine` hardwired its router lookup to the main HTTP server 
(`isMainServer()`). This adds a `targetServerType` property (default `server`, 
unchanged behavior) so the engine can register the MCP endpoint on the 
**management** HTTP server router instead — `ManagementHttpServer` already 
binds its `VertxPlatformHttpRouter` with `SERVER_TYPE_MANAGEMENT` in the 
registry, so this is pure selection, no new plumbing.
   
   Semantics:
   - Exact server-type match; an explicit `management` target **never falls 
back** to the public server (dev tools must not silently end up on the exposed 
port).
   - The single-router fallback for a bare `VertxPlatformHttpServer` (which 
carries no server type) is kept for the default target only.
   - Fail-fast messages name the missing server and how to enable it.
   
   With this, #25203 can drive the SDK-backed engine directly — 
`initialize(...)` + `toolAdded(...)` with tools built from the JBang 
`ToolRegistry` — and drop its hand-rolled JSON-RPC engine while gaining the 
full streamable transport (sessions, SSE, GET replay, DELETE, 
`tools/list_changed`).
   
   ## Testing
   
   `VertxMcpServerEngineTargetServerTypeTest`:
   - Engine targeted at `management` with both servers running: full MCP 
conversation (SDK client) on the management port, **404** on the main port — 
also exercises the bridge-less, hand-built-tools usage exactly as #25203 would.
   - `management` target with no management server: fails fast with an 
`IllegalStateException` naming the management server, even though a main-server 
router is present.
   
   Full `camel-mcp-server` module suite green (10 tests).
   
   ---
   _This PR was written by Claude Code on behalf of Federico Mariani (@Croway)._
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to