Class McpService.DummyMcpService

java.lang.Object
dev.langchain4j.agentic.internal.McpService.DummyMcpService
All Implemented Interfaces:
McpService
Enclosing interface:
McpService

public static class McpService.DummyMcpService extends Object implements McpService
  • Method Details

    • mcpBuilder

      public <T> McpClientBuilder<T> mcpBuilder(Supplier<Object> mcpClientSupplier, Class<?> mcpClientType, Class<T> agentServiceClass)
      Description copied from interface: McpService
      Creates the builder of an MCP client agent. The supplier returns the McpClient and is invoked when the client is first needed, on the first invocation of the agent, because creating a client normally connects to the MCP server. Its declared return type is checked now, when the agent is built: it must be an McpClient, a subtype, or a supertype such as Object, in which case the instance returned is checked when the client is created.
      Specified by:
      mcpBuilder in interface McpService
      Parameters:
      mcpClientSupplier - the supplier of the client, wrapping the @McpClientSupplier method
      mcpClientType - the declared return type of that method
      agentServiceClass - the interface of the agent
    • methodToAgentExecutor

      public Optional<AgentExecutor> methodToAgentExecutor(InternalAgent agent, Method method)
      Specified by:
      methodToAgentExecutor in interface McpService