Package org.machanism.machai.mcp.server
Class HttpStatelessGenericGenaiAdapter
java.lang.Object
org.machanism.machai.ai.provider.AbstractAIProvider
org.machanism.machai.mcp.server.GenericGenaiAdapter<io.modelcontextprotocol.common.McpTransportContext,io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification>
org.machanism.machai.mcp.server.HttpStatelessGenericGenaiAdapter
- All Implemented Interfaces:
Genai
public class HttpStatelessGenericGenaiAdapter
extends GenericGenaiAdapter<io.modelcontextprotocol.common.McpTransportContext,io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Loggerprivate List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> private List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> Fields inherited from class org.machanism.machai.ai.provider.AbstractAIProvider
chatModel, DEFAULT_WEBSEARCH_TYPE_NAME, instructions, LINE_SEPARATOR, LOG_LINE_LENG, LOG_SECTION_SEPARATOR, MAX_OUTPUT_TOKENS, maxOutputTokens, maxToolCalls, MCP_PROP_NAME_PREFIX, PARAGRAPH_SEPARATOR, PASSWORD_PROP_NAME, PROJECT_DIR_PARAM_NAME, projectDir, SERVERID_PROP_NAME, timeoutSec, USERNAME_PROP_NAME -
Constructor Summary
ConstructorsConstructorDescriptionHttpStatelessGenericGenaiAdapter(List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification> toolSpecifications, AbstractMcpServer.ToolSpecificationBuilder<io.modelcontextprotocol.common.McpTransportContext> builder) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPrompt(String name, String description, ToolFunction function, Role role, ParamDescriptor... paramsDesc) private voidaddPrompt(List<io.modelcontextprotocol.spec.McpSchema.PromptMessage> promptMessageList, String text, Role role, Map<String, Object> args) protected voidaddResource(URI uri, String description, String mimeType, ToolFunction function, ParamDescriptor... paramsDesc) List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> Methods inherited from class org.machanism.machai.mcp.server.GenericGenaiAdapter
addTool, perform, toHumanReadableMethods inherited from class org.machanism.machai.ai.provider.AbstractAIProvider
addMcpServer, addMcpServers, addPrompts, addResources, addTools, addWebSearch, addWebSearch, clear, getConfigurator, getEnabledTools, getParamValue, getProjectDir, getTimeout, init, instructions, isErrorHandling, normalize, prompt, safelyInvokeTool, setEnabledTools, setErrorHandling, setProjectDir, setTimeout
-
Field Details
-
log
private final org.slf4j.Logger log -
promptSpecifications
private List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> promptSpecifications -
resourceSpecifications
private List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> resourceSpecifications
-
-
Constructor Details
-
HttpStatelessGenericGenaiAdapter
HttpStatelessGenericGenaiAdapter(List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncToolSpecification> toolSpecifications, AbstractMcpServer.ToolSpecificationBuilder<io.modelcontextprotocol.common.McpTransportContext> builder)
-
-
Method Details
-
addPrompt
protected void addPrompt(String name, String description, ToolFunction function, Role role, ParamDescriptor... paramsDesc) - Overrides:
addPromptin classAbstractAIProvider
-
addPrompt
-
addResource
protected void addResource(URI uri, String description, String mimeType, ToolFunction function, ParamDescriptor... paramsDesc) - Overrides:
addResourcein classAbstractAIProvider
-
getPrompts
public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> getPrompts()- Returns:
- the promptSpecifications
-
getResources
public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncResourceSpecification> getResources()
-