Class StdioGenaiAdapter
java.lang.Object
org.machanism.machai.process.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:
ProcessProvider
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
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionStdioGenaiAdapter(List<io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification> toolSpecifications, AbstractMcpServer.ToolSpecificationBuilder<io.modelcontextprotocol.server.McpSyncServerExchange> builder) Creates an adapter backed by the supplied tool specification collection. -
Method Summary
Modifier and TypeMethodDescriptionprotected io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecificationbuildPromptSpecification(io.modelcontextprotocol.spec.McpSchema.Prompt prompt, BiFunction<io.modelcontextprotocol.server.McpSyncServerExchange, io.modelcontextprotocol.spec.McpSchema.GetPromptRequest, io.modelcontextprotocol.spec.McpSchema.GetPromptResult> promptHandler) Methods inherited from class AbstractPromptGenaiAdapter
addPrompt, addSessionIdentifier, getPromptsMethods inherited from class GenericGenaiAdapter
addTool, getToolNames, perform, toHumanReadableMethods inherited from class AbstractAIProvider
addMcpServer, addMcpServers, addPrompts, addResource, addResources, addTools, addWebSearch, addWebSearch, clear, getConfigurator, getInstructions, getMaxOutputTokens, getMaxToolCalls, getModel, getParamValue, getProjectDir, getTimeout, init, instructions, isErrorHandling, normalize, prompt, safelyInvokeTool, setErrorHandling, setInstructions, setMaxOutputTokens, setMaxToolCalls, setModel, setProjectDir, setTimeout, toSnakeCase
-
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 specificationsbuilder- 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:
buildPromptSpecificationin classAbstractPromptGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange, io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification, io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>
-