Package org.noear.solon.ai.mcp.server
Class McpServerProvider
java.lang.Object
org.noear.solon.ai.mcp.server.McpServerProvider
- All Implemented Interfaces:
org.noear.solon.core.Lifecycle
Mcp 服务端提供者
- Since:
- 3.1
- Author:
- noear
-
Constructor Summary
ConstructorsConstructorDescriptionMcpServerProvider(org.noear.solon.core.AppContext appContext, McpServerProperties serverProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTool(org.noear.solon.ai.chat.tool.FunctionTool functionTool) 登记工具voidaddTool(org.noear.solon.ai.chat.tool.ToolProvider toolProvider) 登记工具protected voidaddToolSpec(io.modelcontextprotocol.server.McpServer.AsyncSpecification mcpServerSpec, org.noear.solon.ai.chat.tool.FunctionTool functionTool) protected org.noear.snack.ONodebuildJsonSchema(org.noear.solon.ai.chat.tool.FunctionTool functionTool) voidvoidstart()voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.noear.solon.core.Lifecycle
preStop
-
Constructor Details
-
McpServerProvider
public McpServerProvider(org.noear.solon.core.AppContext appContext, McpServerProperties serverProperties)
-
-
Method Details
-
addTool
public void addTool(org.noear.solon.ai.chat.tool.FunctionTool functionTool) 登记工具 -
addTool
public void addTool(org.noear.solon.ai.chat.tool.ToolProvider toolProvider) 登记工具 -
start
- Specified by:
startin interfaceorg.noear.solon.core.Lifecycle- Throws:
Throwable
-
postStart
- Specified by:
postStartin interfaceorg.noear.solon.core.Lifecycle- Throws:
Throwable
-
stop
- Specified by:
stopin interfaceorg.noear.solon.core.Lifecycle- Throws:
Throwable
-
addToolSpec
protected void addToolSpec(io.modelcontextprotocol.server.McpServer.AsyncSpecification mcpServerSpec, org.noear.solon.ai.chat.tool.FunctionTool functionTool) -
buildJsonSchema
protected org.noear.snack.ONode buildJsonSchema(org.noear.solon.ai.chat.tool.FunctionTool functionTool)
-