Package dev.agenor.adapters.mcp
Class AgenorMcpClientAdapter
java.lang.Object
dev.agenor.adapters.mcp.AgenorMcpClientAdapter
- All Implemented Interfaces:
McpClient,AutoCloseable
Agenor
McpClient that delegates to the official MCP Java SDK's
McpSyncClient, bridging its blocking calls to CompletableFuture
via supplyAsync().
Use McpClientFactory to construct instances.
-
Method Summary
Modifier and TypeMethodDescriptionInvokes a named tool on the MCP server.voidclose()Closes the underlying transport and releases all associated resources.Returns the list of tools currently advertised by the MCP server.
-
Method Details
-
listTools
Description copied from interface:McpClientReturns the list of tools currently advertised by the MCP server. -
callTool
Description copied from interface:McpClientInvokes a named tool on the MCP server.- Specified by:
callToolin interfaceMcpClient- Parameters:
name- tool name as returned byMcpClient.listTools()args- key-value arguments conforming to the tool'sinputSchema- Returns:
- future completing with the tool result (never
null)
-
close
public void close()Description copied from interface:McpClientCloses the underlying transport and releases all associated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMcpClient
-