Class HttpStatelessGenericGenaiAdapter
java.lang.Object
org.machanism.machai.process.provider.AbstractAIProvider
org.machanism.machai.mcp.server.GenericGenaiAdapter<io.modelcontextprotocol.common.McpTransportContext, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification>
org.machanism.machai.mcp.server.AbstractPromptGenaiAdapter<io.modelcontextprotocol.common.McpTransportContext, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification>
org.machanism.machai.mcp.server.HttpStatelessGenericGenaiAdapter
- All Implemented Interfaces:
ProcessProvider
public class HttpStatelessGenericGenaiAdapter
extends AbstractPromptGenaiAdapter<io.modelcontextprotocol.common.McpTransportContext, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification>
Adapts Machai tools, prompts, and resources to the stateless HTTP MCP
transport.
- Since:
- 1.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> Resource specifications registered by this adapter. -
Constructor Summary
ConstructorsConstructorDescriptionHttpStatelessGenericGenaiAdapter(List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification> toolSpecifications, AbstractMcpServer.ToolSpecificationBuilder<io.modelcontextprotocol.common.McpTransportContext> builder) Creates an adapter backed by the supplied tool specification collection. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddResource(URI uri, String description, String mimeType, ToolFunction function, ParamDescriptor... paramsDesc) protected io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecificationbuildPromptSpecification(io.modelcontextprotocol.spec.McpSchema.Prompt prompt, BiFunction<io.modelcontextprotocol.common.McpTransportContext, io.modelcontextprotocol.spec.McpSchema.GetPromptRequest, io.modelcontextprotocol.spec.McpSchema.GetPromptResult> promptHandler) List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> Returns the resources registered with this adapter.Methods inherited from class AbstractPromptGenaiAdapter
addPrompt, addSessionIdentifier, getPromptsMethods inherited from class GenericGenaiAdapter
addTool, getToolNames, perform, toHumanReadableMethods inherited from class AbstractAIProvider
addMcpServer, addMcpServers, addPrompts, 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
-
Field Details
-
resourceSpecifications
private final List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> resourceSpecificationsResource specifications registered by this adapter.
-
-
Constructor Details
-
HttpStatelessGenericGenaiAdapter
HttpStatelessGenericGenaiAdapter(List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification> toolSpecifications, AbstractMcpServer.ToolSpecificationBuilder<io.modelcontextprotocol.common.McpTransportContext> 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.McpStatelessServerFeatures.SyncPromptSpecification buildPromptSpecification(io.modelcontextprotocol.spec.McpSchema.Prompt prompt, BiFunction<io.modelcontextprotocol.common.McpTransportContext, io.modelcontextprotocol.spec.McpSchema.GetPromptRequest, io.modelcontextprotocol.spec.McpSchema.GetPromptResult> promptHandler) - Specified by:
buildPromptSpecificationin classAbstractPromptGenaiAdapter<io.modelcontextprotocol.common.McpTransportContext, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification, io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification>
-
addResource
protected void addResource(URI uri, String description, String mimeType, ToolFunction function, ParamDescriptor... paramsDesc) - Overrides:
addResourcein classAbstractAIProvider
-
getResources
public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> getResources()Returns the resources registered with this adapter.- Returns:
- mutable list of stateless resource specifications
-