Interface McpService

All Known Implementing Classes:
DefaultMcpService, McpService.DummyMcpService

public interface McpService
  • Method Details

    • mcpBuilder

      <T> McpClientBuilder<T> mcpBuilder(Supplier<Object> mcpClientSupplier, Class<?> mcpClientType, Class<T> agentServiceClass)
      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.
      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

      Optional<AgentExecutor> methodToAgentExecutor(InternalAgent mcpClient, Method method)
    • get

      static McpService get()