MCP HTTP Tool
ConvEngine supports two HTTP MCP integration models.
Two ways
HTTP MCP models
| Model | Use when | How it executes |
|---|---|---|
| HttpApiRequestingToolHandler | You want framework-managed retries/timeouts/circuit/auth/mapping | HttpApiToolInvoker (framework HttpClient) |
| HttpApiProcessorToolHandler | You already use [api-processor](https://github.com/salilvnair/api-processor) in your app | RestWebServiceFacade -> delegate.invoke -> processResponse |
Related libraries:
Model A: HttpApiRequestingToolHandler
Flow
- Handler returns
HttpApiRequestSpec - Framework executes HTTP call
- Mapping mode resolves output
- MCP observation is stored
Supported mapping modes:
RAW_JSONJSON_PATHFIELD_TEMPLATEMAPPER_CLASSTEXT
MAPPER_CLASS example:
new HttpApiResponseMapping(
HttpApiResponseMappingMode.MAPPER_CLASS,
null,
Map.of(),
"com.acme.api.OrderStatusResponse");
Model B: HttpApiProcessorToolHandler
Flow
wsContext(...)builds tool contextwsHandler(...)returnsRestWebServiceHandler- Framework calls
RestWebServiceFacade.initiate(...) prepareRequest(...)runs- delegate
invoke(...)runs processResponse(...)maps output- framework calls
extractResponse(...)and stores MCP observation
convengine-demo package convention
In demo we now keep each api-processor MCP tool in its own folder tree with dedicated handler/delegate:
mcp/handler/loan/credit/rating/...mcp/handler/loan/credit/fraud/...mcp/handler/loan/application/submit/...mcp/handler/mock/customer/profile/...mcp/handler/mock/order/status/...mcp/handler/mock/order/async/trace/...mcp/handler/mock/order/submit/...
Each tool folder contains:
<Tool>ToolHandler(MCP SPI class)handler/<Tool>WsHandlerdelegate/<Tool>WsDelegate
Shared lightweight helper types are in:
mcp/handler/common/...
Debt tool intentionally unchanged
As requested, LoanDebtSummaryToolHandler remains HttpApiRequestingToolHandler to demonstrate the framework-managed HTTP model side-by-side with api-processor mode.
What MockOrderAsyncTraceToolHandler does
mock.order.async.trace fetches async callback trace details for an order:
traceIdapi4AsyncStatuscallbackReceivedAtmessage
It is used in order diagnostics flow to explain why an order can be submitted while async callback is still pending or null.