Class HttpStreamableGenericGenaiAdapter
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.HttpStreamableGenericGenaiAdapter
- All Implemented Interfaces:
ProcessProvider
public class HttpStreamableGenericGenaiAdapter
extends AbstractPromptGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange, io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification, io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>
Adapts Machai tools and prompts to the streamable HTTP MCP transport.
- Since:
- 1.2.0
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHttpStreamableGenericGenaiAdapter(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 voidaddSessionIdentifier(io.modelcontextprotocol.server.McpSyncServerExchange exchange, Map<String, Object> arguments) Adds transport-specific session data to prompt arguments when available.protected 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, 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
-
HttpStreamableGenericGenaiAdapter
HttpStreamableGenericGenaiAdapter(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
-
addSessionIdentifier
protected void addSessionIdentifier(io.modelcontextprotocol.server.McpSyncServerExchange exchange, Map<String, Object> arguments) Description copied from class:AbstractPromptGenaiAdapterAdds transport-specific session data to prompt arguments when available.- Overrides:
addSessionIdentifierin classAbstractPromptGenaiAdapter<io.modelcontextprotocol.server.McpSyncServerExchange, io.modelcontextprotocol.server.McpServerFeatures.SyncToolSpecification, io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>- Parameters:
exchange- server exchange or transport contextarguments- prompt arguments
-
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>
-