Croway commented on PR #25203:
URL: https://github.com/apache/camel/pull/25203#issuecomment-5181076911

   Now that CAMEL-24308/24310/24311 are merged, this PR can be simplified 
considerably while keeping its scope (dev/diagnostics tools on the management 
server — a valid, complementary use case to the `ai-tool` business tools on the 
main server):
   
   1. **Reuse `VertxMcpServerEngine` from `camel-mcp-server` instead of the 
hand-rolled JSON-RPC engine.** The `McpServerEngine` SPI is 
tool-source-agnostic: `McpServerTool` is just name/description/handler and 
accepts a raw `inputSchemaJson`, so the `ToolMcpSchemas` output maps 1:1, and 
`McpToolCallResult(text, isError)` is the same shape as this PR's 
`ToolCallResult`. The JBang side would build `McpServerTool`s from the 
`ToolDescriptor`s and call `initialize(...)`/`toolAdded(...)` directly — no 
bridge needed. This deletes `StreamableMcpJsonRpcEngine`, `ToolMcpSchemas`, the 
`EmbeddedMcpRequestHandler` SPI and the `ManagementHttpServer` dispatch code 
(~450 lines), and upgrades the endpoint from a POST-only, session-less subset 
to the full SDK-backed streamable transport (sessions, SSE, GET replay, DELETE, 
`tools/list_changed`). It also fixes an interop issue: rejecting every request 
carrying an `Origin` header with 403 breaks legitimate clients — the spec asks 
to *validate* Origi
 n, not refuse it.
   
   2. **Drop the `camel.mcp.*` namespace — this PR already contains its 
replacement.** The `mcpEnabled`/`mcpPath` fields added to 
`HttpManagementServerConfigurationProperties` are reachable as 
`camel.management.mcpEnabled` / `camel.management.mcpPath`, which is the right 
home for a management-server feature and symmetric with the merged 
`camel.server.mcp-*`. That removes `McpConfigurationProperties`, its generated 
configurer/metadata, `mainConfigurationProperties.mcp()` and the 
`setMcpProperties` cross-wiring in `BaseMainSupport` (where the host/port 
default issues from earlier review rounds kept surfacing). The `--mcp` flag 
then just sets `camel.management.mcpEnabled=true` plus management-server 
enablement, like the other management flags in `Run.java`.
   
   3. With 1+2, **core `camel-main` stays MCP-free** (only the existing 
`McpServerFactory` hook), and everything new lives in camel-jbang / 
camel-platform-http-main, with `camel-jbang-core` depending on 
`camel-mcp-server`.
   
   4. **Docs**: after this lands there are two MCP surfaces — dev tools at 
`<management-port>/mcp` (`--mcp`) and business `ai-tool` routes at 
`<server-port>/mcp` (`camel.server.mcp-enabled=true`, already property-only 
under JBang). Worth stating the distinction and cross-linking `mcp-server.adoc`.
   
   One enabler is needed on the camel-mcp-server side: `VertxMcpServerEngine` 
currently prefers the main server's router when looking up 
`VertxPlatformHttpRouter`. `ManagementHttpServer` already binds its router 
(with `SERVER_TYPE_MANAGEMENT`) in the registry, so a small enhancement to make 
the target server type selectable unblocks this — I can prepare that as a prep 
PR.
   
   _Claude Code on behalf of Federico Mariani (@Croway)_
   


-- 
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