Class StdioGenaiAdapter

java.lang.Object
org.machanism.machai.ai.provider.AbstractAIProvider
org.machanism.machai.mcp.server.GenericGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange,io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification>
org.machanism.machai.mcp.server.AbstractPromptGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange,io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification,io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>
org.machanism.machai.mcp.server.StdioGenaiAdapter
All Implemented Interfaces:
Genai

public class StdioGenaiAdapter extends AbstractPromptGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange,io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification,io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>
Adapts Machai tools and prompts to the synchronous STDIO MCP transport.
Since:
1.2.0
  • Constructor Details

    • StdioGenaiAdapter

      StdioGenaiAdapter(List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> toolSpecifications, AbstractMcpServer.ToolSpecificationBuilder<io.modelcontextprotocol.server.McpSyncServerExchange> builder)
      Creates an adapter backed by the supplied tool specification collection.
      Parameters:
      toolSpecifications - collection receiving generated tool specifications
      builder - builder that creates transport-specific tool specifications
  • Method Details

    • buildPromptSpecification

      protected io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification buildPromptSpecification(io.modelcontextprotocol.spec.McpSchema.Prompt prompt, BiFunction<io.modelcontextprotocol.server.McpSyncServerExchange,io.modelcontextprotocol.spec.McpSchema.GetPromptRequest,io.modelcontextprotocol.spec.McpSchema.GetPromptResult> promptHandler)
      Specified by:
      buildPromptSpecification in class AbstractPromptGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange,io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification,io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>