public class McpServerEndpointProvider extends Object implements org.noear.solon.core.bean.LifecycleBean
| Modifier and Type | Class and Description |
|---|---|
static class |
McpServerEndpointProvider.Builder |
| Constructor and Description |
|---|
McpServerEndpointProvider(McpServerProperties serverProperties) |
McpServerEndpointProvider(Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTool(FunctionTool functionTool)
登记工具
|
void |
addTool(ToolProvider toolProvider)
登记工具
|
protected void |
addToolSpec(FunctionTool functionTool) |
static McpServerEndpointProvider.Builder |
builder() |
protected org.noear.snack.ONode |
buildJsonSchema(FunctionTool functionTool) |
String |
getChannel()
通道
|
String |
getName()
名字
|
McpSyncServer |
getServer()
获取内部处理服务(postStart 后有效)
|
String |
getSseEndpoint()
端点
|
Collection<FunctionTool> |
getTools()
获取所有工具
|
String |
getVersion()
版本
|
void |
notifyToolsListChanged()
通知工具变化
|
boolean |
pause()
暂停(主要用于测试)
|
void |
postStart() |
void |
removeTool(String toolName)
移除工具
|
void |
removeTool(ToolProvider toolProvider)
移除工具
|
boolean |
resume()
恢复(主要用于测试)
|
void |
start() |
void |
stop() |
public McpServerEndpointProvider(Properties properties)
public McpServerEndpointProvider(McpServerProperties serverProperties)
public String getName()
public String getVersion()
public String getChannel()
public String getSseEndpoint()
public void addTool(FunctionTool functionTool)
public void addTool(ToolProvider toolProvider)
public void removeTool(String toolName)
public void removeTool(ToolProvider toolProvider)
public Collection<FunctionTool> getTools()
public void notifyToolsListChanged()
@Nullable public McpSyncServer getServer()
public void start()
start in interface org.noear.solon.core.bean.LifecycleBeanstart in interface org.noear.solon.core.Lifecyclepublic void postStart()
postStart in interface org.noear.solon.core.Lifecyclepublic boolean pause()
public boolean resume()
public void stop()
stop in interface org.noear.solon.core.Lifecycleprotected void addToolSpec(FunctionTool functionTool)
protected org.noear.snack.ONode buildJsonSchema(FunctionTool functionTool)
public static McpServerEndpointProvider.Builder builder()
Copyright © 2025. All rights reserved.